警告页面

1023
nodyang@aliyun.com 1 month ago
parent 6790c9e560
commit 2dc9f1f0f2

@ -105,11 +105,13 @@
<Compile Include="Entity\Function.cs" />
<Compile Include="Entity\Log.cs" />
<Compile Include="Entity\Point.cs" />
<Compile Include="Entity\PointLog.cs" />
<Compile Include="Entity\Role.cs" />
<Compile Include="Entity\UpdateLog.cs" />
<Compile Include="Entity\User.cs" />
<Compile Include="MappingHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Service\PointLogService.cs" />
<Compile Include="Service\UserService.cs" />
<Compile Include="SystemEntityTypeBuilder.cs" />
</ItemGroup>

@ -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<PointLog>
{
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);
}
}
}

@ -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<PointLog> GetPagedList(int pageIndex, int pageSize, string key)
{
using (var dbContext = DbFactory.GetContext)
{
var dao = dbContext.Query<PointLog>()
.WhereIf(!string.IsNullOrEmpty(key),x=>x.PointName.Contains(key))
.OrderByDesc(x => x.ID)
.Paging(pageIndex, pageSize);
return dao;
}
}
}
}

@ -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);
}
}
/// <summary>

@ -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;
}
}
}
}
}

@ -0,0 +1,215 @@
namespace RfidWeb.Frm
{
partial class FormAlarm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
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<object>)(resources.GetObject("ucPagerControl21.DataSource")));
this.ucPagerControl21.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucPagerControl21.Location = new System.Drawing.Point(0, 0);
this.ucPagerControl21.Name = "ucPagerControl21";
this.ucPagerControl21.PageCount = 0;
this.ucPagerControl21.PageIndex = 1;
this.ucPagerControl21.PageModel = HZH_Controls.Controls.PageModel.Soure;
this.ucPagerControl21.PageSize = 10;
this.ucPagerControl21.Size = new System.Drawing.Size(910, 41);
this.ucPagerControl21.StartIndex = 0;
this.ucPagerControl21.TabIndex = 1;
this.ucPagerControl21.ShowSourceChanged += new HZH_Controls.Controls.PageControlEventHandler(this.ucPagerControl21_ShowSourceChanged);
//
// ucDataGridViewContent
//
this.ucDataGridViewContent.BackColor = System.Drawing.Color.White;
this.ucDataGridViewContent.Columns = null;
this.ucDataGridViewContent.DataSource = null;
this.ucDataGridViewContent.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucDataGridViewContent.HeadFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucDataGridViewContent.HeadHeight = 40;
this.ucDataGridViewContent.HeadPadingLeft = 0;
this.ucDataGridViewContent.HeadTextColor = System.Drawing.Color.Black;
this.ucDataGridViewContent.IsShowCheckBox = false;
this.ucDataGridViewContent.IsShowHead = true;
this.ucDataGridViewContent.Location = new System.Drawing.Point(0, 80);
this.ucDataGridViewContent.Name = "ucDataGridViewContent";
this.ucDataGridViewContent.Padding = new System.Windows.Forms.Padding(0, 40, 0, 0);
this.ucDataGridViewContent.RowHeight = 40;
this.ucDataGridViewContent.RowType = typeof(HZH_Controls.Controls.UCDataGridViewRow);
this.ucDataGridViewContent.Size = new System.Drawing.Size(910, 814);
this.ucDataGridViewContent.TabIndex = 2;
//
// FormAlarm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.ucDataGridViewContent);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Name = "FormAlarm";
this.Size = new System.Drawing.Size(910, 935);
this.panel1.ResumeLayout(false);
this.panelTop.ResumeLayout(false);
this.panelTop.PerformLayout();
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panelTop;
private HZH_Controls.Controls.UCBtnExt ucBtnDel;
private HZH_Controls.Controls.UCBtnExt ucBtnSelect;
private HZH_Controls.Controls.TextBoxEx textBoxSel;
private HZH_Controls.Controls.UCPagerControl2 ucPagerControl21;
private HZH_Controls.Controls.UCDataGridView ucDataGridViewContent;
}
}

@ -0,0 +1,78 @@
using DB.Dto;
using DB.Service;
using HZH_Controls.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RfidWeb.Frm
{
public partial class FormAlarm : UserControl
{
private UserDto OlduserDto;
private PointLogService PointLogService = new PointLogService();
public FormAlarm()
{
InitializeComponent();
OlduserDto = UserManager.GetUser();
Init();
}
private void Init()
{
List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>
{
new DataGridViewColumnEntity() { DataField = "PointName", HeadText = "名称", Width = 90, WidthType = SizeType.Absolute },
new DataGridViewColumnEntity() { DataField = "Msg", HeadText = "异常内容", Width = 700, WidthType = SizeType.Absolute },
};
ucDataGridViewContent.AutoScroll = false;
this.ucDataGridViewContent.Columns = lstCulumns;
this.ucDataGridViewContent.IsShowCheckBox = true;
ucPagerControl21.PageModel = PageModel.PageCount;
ucPagerControl21.PageIndex = 1;
ucPagerControl21.PageSize = 20;
}
private void ucPagerControl21_ShowSourceChanged(object currentSource)
{
string key = this.textBoxSel.Text.Trim();
var index = ucPagerControl21.PageIndex;
var page = PointLogService.GetPagedList(index, ucPagerControl21.PageSize,key);
ucPagerControl21.PageCount = page.Totals.ToInt();
this.ucDataGridViewContent.DataSource = page.DataList;
var dataGridViewRows = ucDataGridViewContent.SelectRows;
foreach (var row in dataGridViewRows)
{
if (row.IsChecked)
{
row.IsChecked = false;
}
}
}
private void ucBtnSelect_BtnClick(object sender, EventArgs e)
{
ucPagerControl21.PageIndex = 1;
ucPagerControl21_ShowSourceChanged(new object());
}
}
}

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ucPagerControl21.DataSource" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u
ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u
PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB
AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLk9iamVjdAMAAAAGX2l0
ZW1zBV9zaXplCF92ZXJzaW9uBQAACAgCAAAACQMAAAAAAAAAAAAAABADAAAAAAAAAAs=
</value>
</data>
</root>

@ -29,11 +29,12 @@
private void InitializeComponent()
{
this.ucBtnExt1 = new HZH_Controls.Controls.UCBtnExt();
this.ucBtnExt2 = new HZH_Controls.Controls.UCBtnExt();
this.SuspendLayout();
//
// ucBtnExt1
//
this.ucBtnExt1.BackColor = System.Drawing.Color.Transparent;
this.ucBtnExt1.BackColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnBackColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt1.BtnForeColor = System.Drawing.Color.White;
@ -46,24 +47,53 @@
this.ucBtnExt1.IsRadius = true;
this.ucBtnExt1.IsShowRect = true;
this.ucBtnExt1.IsShowTips = false;
this.ucBtnExt1.Location = new System.Drawing.Point(31, 18);
this.ucBtnExt1.Location = new System.Drawing.Point(21, 12);
this.ucBtnExt1.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt1.Name = "ucBtnExt1";
this.ucBtnExt1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnExt1.RectWidth = 1;
this.ucBtnExt1.Size = new System.Drawing.Size(213, 60);
this.ucBtnExt1.Size = new System.Drawing.Size(142, 40);
this.ucBtnExt1.TabIndex = 0;
this.ucBtnExt1.TabStop = false;
this.ucBtnExt1.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExt1.TipsText = "";
this.ucBtnExt1.BtnClick += new System.EventHandler(this.ucBtnExt1_BtnClick);
//
// ucBtnExt2
//
this.ucBtnExt2.BackColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnBackColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt2.BtnForeColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnText = "插入数据库用户表";
this.ucBtnExt2.ConerRadius = 5;
this.ucBtnExt2.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExt2.EnabledMouseEffect = false;
this.ucBtnExt2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucBtnExt2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExt2.IsRadius = true;
this.ucBtnExt2.IsShowRect = true;
this.ucBtnExt2.IsShowTips = false;
this.ucBtnExt2.Location = new System.Drawing.Point(21, 68);
this.ucBtnExt2.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt2.Name = "ucBtnExt2";
this.ucBtnExt2.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnExt2.RectWidth = 1;
this.ucBtnExt2.Size = new System.Drawing.Size(142, 40);
this.ucBtnExt2.TabIndex = 1;
this.ucBtnExt2.TabStop = false;
this.ucBtnExt2.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExt2.TipsText = "";
this.ucBtnExt2.BtnClick += new System.EventHandler(this.ucBtnExt2_BtnClick);
//
// FromSQl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1093, 450);
this.ClientSize = new System.Drawing.Size(729, 300);
this.Controls.Add(this.ucBtnExt2);
this.Controls.Add(this.ucBtnExt1);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "FromSQl";
this.Text = "FromSQl";
this.ResumeLayout(false);
@ -73,5 +103,6 @@
#endregion
private HZH_Controls.Controls.UCBtnExt ucBtnExt1;
private HZH_Controls.Controls.UCBtnExt ucBtnExt2;
}
}

@ -31,7 +31,7 @@ namespace RfidWeb
var dbContext = DbFactory.GetContext;
// new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
//dbContext.Insert(new Role()
//{
@ -53,97 +53,117 @@ namespace RfidWeb
//});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842295074816,
UserName = "管理员1",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842295074816,
UserName = "管理员2",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842295074816,
UserName = "管理员2",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842295074816,
// UserName = "管理员1",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
//});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842295074816,
// UserName = "管理员2",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842295074816,
// UserName = "管理员2",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842987134976,
UserName = "设备层1",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842987134976,
UserName = "设备层2",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842987134976,
UserName = "设备层2",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842987134976,
// UserName = "设备层1",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842999717888,
UserName = "使用层1",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842999717888,
UserName = "使用层2",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
dbContext.Insert(new UserInfo()
{
ID = SnowflakeFactory.NewId,
RoleId =
7254091842999717888,
UserName = "使用层2",
Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842987134976,
// UserName = "设备层2",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
});
//});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842987134976,
// UserName = "设备层2",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842999717888,
// UserName = "使用层1",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842999717888,
// UserName = "使用层2",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//});
//dbContext.Insert(new UserInfo()
//{
// ID = SnowflakeFactory.NewId,
// RoleId =
// 7254091842999717888,
// UserName = "使用层2",
// Pwd = "E10ADC3949BA59ABBE56E057F20F883E",
//});
// new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateNew);
}
private void ucBtnExt2_BtnClick(object sender, EventArgs e)
{
var dbContext = DbFactory.GetContext;
for (int i = 0; i < 100; i++)
{
PointLog log = new PointLog();
log.ID = SnowflakeFactory.NewId;
log.PointName = "测试:" + i;
log.PointAddress = "DB:" + i;
log.Msg = "test:" + i;
log.CreateDate=DateTime.Now;
log.LastModifyDate=DateTime.Now;
log.LastModifyUserId = "123";
log.CreateUserId = "123";
dbContext.Insert(log);
}
}
}
}

@ -20,8 +20,7 @@ namespace RfidWeb
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new FormLogin());
//Application.Run(new FromSQl());
Application.Run(new FormMain());
}

@ -136,6 +136,12 @@
<Compile Include="Frm\FormAccount.Designer.cs">
<DependentUpon>FormAccount.cs</DependentUpon>
</Compile>
<Compile Include="Frm\FormAlarm.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Frm\FormAlarm.Designer.cs">
<DependentUpon>FormAlarm.cs</DependentUpon>
</Compile>
<Compile Include="Frm\FormRegister.cs">
<SubType>Form</SubType>
</Compile>
@ -166,6 +172,9 @@
<EmbeddedResource Include="Frm\FormAccount.resx">
<DependentUpon>FormAccount.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FormAlarm.resx">
<DependentUpon>FormAlarm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FormRegister.resx">
<DependentUpon>FormRegister.cs</DependentUpon>
</EmbeddedResource>

Loading…
Cancel
Save