diff --git a/DB/DB.csproj b/DB/DB.csproj
index c966063..ddce222 100644
--- a/DB/DB.csproj
+++ b/DB/DB.csproj
@@ -105,11 +105,13 @@
+
+
diff --git a/DB/Entity/Point.cs b/DB/Entity/Point.cs
index 7150e64..d144040 100644
--- a/DB/Entity/Point.cs
+++ b/DB/Entity/Point.cs
@@ -1,4 +1,6 @@
-namespace DB.Entity
+using NewLife.Data;
+
+namespace DB.Entity
{
public class Point:BaseChimsDb
{
@@ -24,4 +26,16 @@
}
}
+
+
+ public class PointLogMapper : SystemEntityTypeBuilder
+ {
+ public PointLogMapper() : base("PointLog")
+ {
+ this.Property(x => x.Msg).HasSize(500);
+ this.Property(x => x.PointAddress).HasSize(10);
+ this.Property(x => x.PointName).HasSize(10);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/DB/Service/PointLogService.cs b/DB/Service/PointLogService.cs
index a818aba..f509fe8 100644
--- a/DB/Service/PointLogService.cs
+++ b/DB/Service/PointLogService.cs
@@ -1,7 +1,34 @@
-namespace DB.Service
+using Chloe;
+
+using DB.Entity;
+
+namespace DB.Service
{
public class PointLogService
{
-
+
+ public void Add(PointLog entityLog)
+ {
+ using (var dbContext = DbFactory.GetContext)
+ {
+ dbContext.Insert(entityLog);
+ }
+ }
+
+
+ public PagingResult GetPagedList(int pageIndex, int pageSize, string key)
+ {
+
+ using (var dbContext = DbFactory.GetContext)
+ {
+ var dao = dbContext.Query()
+ .WhereIf(!string.IsNullOrEmpty(key),x=>x.PointName.Contains(key))
+ .OrderByDesc(x => x.ID)
+ .Paging(pageIndex, pageSize);
+ return dao;
+
+ }
+
+ }
}
}
\ No newline at end of file
diff --git a/RfidWeb/FormMain.cs b/RfidWeb/FormMain.cs
index 38d52c6..163e9c8 100644
--- a/RfidWeb/FormMain.cs
+++ b/RfidWeb/FormMain.cs
@@ -124,7 +124,21 @@ namespace RfidWeb
private void btnAlarm_Click(object sender, EventArgs e)
{
- SetBackGroupImage(sender as Button);
+ bool isLogin = UserManager.IsExit();
+ if (!isLogin)
+ {
+ FormLogin loigLogin = new FormLogin();
+ loigLogin.StartPosition = FormStartPosition.CenterScreen; // 设置窗口显示在屏幕中央
+ loigLogin.ShowDialog();
+ }
+
+ isLogin = UserManager.IsExit();
+ if (isLogin)
+ {
+ panContent.Controls.Clear();
+ panContent.Controls.Add(new FormAlarm());
+ SetBackGroupImage(sender as Button);
+ }
}
///
diff --git a/RfidWeb/Frm/FormAccount.cs b/RfidWeb/Frm/FormAccount.cs
index 833c2e1..d966e79 100644
--- a/RfidWeb/Frm/FormAccount.cs
+++ b/RfidWeb/Frm/FormAccount.cs
@@ -42,7 +42,7 @@ namespace RfidWeb.Frm
ucPagerControl21.PageModel = PageModel.PageCount;
ucPagerControl21.PageIndex = 1;
ucPagerControl21.PageSize = 20;
- // ucPagerControl21_ShowSourceChanged(new object());
+
}
@@ -70,15 +70,21 @@ namespace RfidWeb.Frm
}
var page = userService.GetPagedList(index, ucPagerControl21.PageSize, key,lsInts);
ucPagerControl21.PageCount = page.TotalPages;
-
- this.ucDataGridViewContent.IsShowCheckBox = true;
- // this.ucDataGridViewContent.DataSource = null;
this.ucDataGridViewContent.DataSource = page.Items;
+
+ var dataGridViewRows = ucDataGridViewContent.SelectRows;
+ foreach (var row in dataGridViewRows)
+ {
+ if (row.IsChecked)
+ {
+ row.IsChecked = false;
+ }
+ }
}
private void ucBtnSelect_BtnClick(object sender, EventArgs e)
{
- ucPagerControl21_ShowSourceChanged(new object());
+ Replace();
}
private void ucBtnAdd_BtnClick(object sender, EventArgs e)
@@ -120,12 +126,7 @@ namespace RfidWeb.Frm
if (ls.Any())
{
userService.UpdateDel(ls);
-
- ucPagerControl21.PageIndex = 1;
-
- this.ucDataGridViewContent.IsShowCheckBox = false;
- ucPagerControl21_ShowSourceChanged(new object());
-
+ Replace();
}
@@ -149,10 +150,23 @@ namespace RfidWeb.Frm
formRegis.StartPosition = FormStartPosition.CenterScreen; // 设置窗口显示在屏幕中央
formRegis.ShowDialog();
- ucPagerControl21.PageIndex = 1;
- this.ucDataGridViewContent.IsShowCheckBox = false;
- ucPagerControl21_ShowSourceChanged(new object());
+
+ Replace();
+
+ }
+ private void Replace()
+ {
+ ucPagerControl21.PageIndex = 1;
+
+ var dataGridViewRows = ucDataGridViewContent.SelectRows;
+ foreach (var row in dataGridViewRows)
+ {
+ if (row.IsChecked)
+ {
+ row.IsChecked = false;
+ }
+ }
}
}
}
diff --git a/RfidWeb/Frm/FormAlarm.Designer.cs b/RfidWeb/Frm/FormAlarm.Designer.cs
new file mode 100644
index 0000000..08e426a
--- /dev/null
+++ b/RfidWeb/Frm/FormAlarm.Designer.cs
@@ -0,0 +1,215 @@
+namespace RfidWeb.Frm
+{
+ partial class FormAlarm
+ {
+ ///
+ /// 必需的设计器变量。
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// 清理所有正在使用的资源。
+ ///
+ /// 如果应释放托管资源,为 true;否则为 false。
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region 组件设计器生成的代码
+
+ ///
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAlarm));
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.panelTop = new System.Windows.Forms.Panel();
+ this.ucBtnDel = new HZH_Controls.Controls.UCBtnExt();
+ this.ucBtnSelect = new HZH_Controls.Controls.UCBtnExt();
+ this.textBoxSel = new HZH_Controls.Controls.TextBoxEx();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.ucPagerControl21 = new HZH_Controls.Controls.UCPagerControl2();
+ this.ucDataGridViewContent = new HZH_Controls.Controls.UCDataGridView();
+ this.panel1.SuspendLayout();
+ this.panelTop.SuspendLayout();
+ this.panel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.panelTop);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(910, 80);
+ this.panel1.TabIndex = 0;
+ //
+ // panelTop
+ //
+ this.panelTop.Controls.Add(this.ucBtnDel);
+ this.panelTop.Controls.Add(this.ucBtnSelect);
+ this.panelTop.Controls.Add(this.textBoxSel);
+ this.panelTop.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panelTop.Location = new System.Drawing.Point(0, 0);
+ this.panelTop.Name = "panelTop";
+ this.panelTop.Size = new System.Drawing.Size(910, 80);
+ this.panelTop.TabIndex = 1;
+ //
+ // ucBtnDel
+ //
+ this.ucBtnDel.BackColor = System.Drawing.Color.White;
+ this.ucBtnDel.BtnBackColor = System.Drawing.Color.White;
+ this.ucBtnDel.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.ucBtnDel.BtnForeColor = System.Drawing.Color.White;
+ this.ucBtnDel.BtnText = "删除 ";
+ this.ucBtnDel.ConerRadius = 5;
+ this.ucBtnDel.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.ucBtnDel.EnabledMouseEffect = false;
+ this.ucBtnDel.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
+ this.ucBtnDel.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
+ this.ucBtnDel.IsRadius = true;
+ this.ucBtnDel.IsShowRect = true;
+ this.ucBtnDel.IsShowTips = false;
+ this.ucBtnDel.Location = new System.Drawing.Point(382, 26);
+ this.ucBtnDel.Margin = new System.Windows.Forms.Padding(0);
+ this.ucBtnDel.Name = "ucBtnDel";
+ this.ucBtnDel.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(83)))), ((int)(((byte)(171)))));
+ this.ucBtnDel.RectWidth = 1;
+ this.ucBtnDel.Size = new System.Drawing.Size(121, 28);
+ this.ucBtnDel.TabIndex = 5;
+ this.ucBtnDel.TabStop = false;
+ this.ucBtnDel.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
+ this.ucBtnDel.TipsText = "";
+ //
+ // ucBtnSelect
+ //
+ this.ucBtnSelect.BackColor = System.Drawing.Color.White;
+ this.ucBtnSelect.BtnBackColor = System.Drawing.Color.White;
+ this.ucBtnSelect.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.ucBtnSelect.BtnForeColor = System.Drawing.Color.White;
+ this.ucBtnSelect.BtnText = "查询";
+ this.ucBtnSelect.ConerRadius = 5;
+ this.ucBtnSelect.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.ucBtnSelect.EnabledMouseEffect = false;
+ this.ucBtnSelect.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
+ this.ucBtnSelect.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
+ this.ucBtnSelect.IsRadius = true;
+ this.ucBtnSelect.IsShowRect = true;
+ this.ucBtnSelect.IsShowTips = false;
+ this.ucBtnSelect.Location = new System.Drawing.Point(226, 26);
+ this.ucBtnSelect.Margin = new System.Windows.Forms.Padding(0);
+ this.ucBtnSelect.Name = "ucBtnSelect";
+ this.ucBtnSelect.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(83)))), ((int)(((byte)(171)))));
+ this.ucBtnSelect.RectWidth = 1;
+ this.ucBtnSelect.Size = new System.Drawing.Size(121, 28);
+ this.ucBtnSelect.TabIndex = 2;
+ this.ucBtnSelect.TabStop = false;
+ this.ucBtnSelect.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
+ this.ucBtnSelect.TipsText = "";
+ this.ucBtnSelect.BtnClick += new System.EventHandler(this.ucBtnSelect_BtnClick);
+ //
+ // textBoxSel
+ //
+ this.textBoxSel.DecLength = 2;
+ this.textBoxSel.InputType = HZH_Controls.TextInputType.NotControl;
+ this.textBoxSel.Location = new System.Drawing.Point(33, 26);
+ this.textBoxSel.MaxValue = new decimal(new int[] {
+ 1000000,
+ 0,
+ 0,
+ 0});
+ this.textBoxSel.MinValue = new decimal(new int[] {
+ 1000000,
+ 0,
+ 0,
+ -2147483648});
+ this.textBoxSel.MyRectangle = new System.Drawing.Rectangle(0, 0, 0, 0);
+ this.textBoxSel.Name = "textBoxSel";
+ this.textBoxSel.OldText = null;
+ this.textBoxSel.PromptColor = System.Drawing.Color.Gray;
+ this.textBoxSel.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
+ this.textBoxSel.PromptText = "";
+ this.textBoxSel.RegexPattern = "";
+ this.textBoxSel.Size = new System.Drawing.Size(158, 28);
+ this.textBoxSel.TabIndex = 0;
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.ucPagerControl21);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panel2.Location = new System.Drawing.Point(0, 894);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(910, 41);
+ this.panel2.TabIndex = 1;
+ //
+ // ucPagerControl21
+ //
+ this.ucPagerControl21.BackColor = System.Drawing.Color.White;
+ this.ucPagerControl21.DataSource = ((System.Collections.Generic.List