nodyang@aliyun.com 1 week ago
parent 258a84dee2
commit 17a51e5d92

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using DB.Entity;
using NewLife.Caching;
@ -18,7 +19,34 @@ namespace DB.Service
}
public string GetAddressName(string address)
{
using (var dbContext = DbFactory.GetContext)
{
var entity= dbContext.Query<Point>()
.Where(x => x.PointAddress == address)
.Select(x => x.PointName).FirstOrDefault();
return string.IsNullOrEmpty(entity) ? "" : entity;
}
}
public Dictionary<string, string> GetValueName()
{
using (var dbContext = DbFactory.GetContext)
{
var entity = dbContext.Query<Point>()
.Select(x=>new Point()
{
PointAddress = x.PointAddress,
PointName = x.PointName
})
.ToList();
Dictionary<string, string> dic =
entity.ToDictionary(x => x.PointAddress, x => x.PointName);
return dic;
}
}
}
}

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Forms.VisualStyles;
using Chloe;
using DB.Dto;
using DB.Entity;
@ -9,6 +10,10 @@ using Tool;
namespace DB.Service
{
/// <summary>
/// 参数修改日志
/// </summary>
public class UpdateLogService
{
public bool AddOrUpdateLog(UserDto user,string address,uint value)
@ -54,5 +59,32 @@ namespace DB.Service
}
public PagedList<UpdateLog> GetPagedList(int pageIndex, int pageSize, string key)
{
PagingResult<UpdateLog> pagePagingResult;
using (var dbContext = DbFactory.GetContext)
{
pagePagingResult = dbContext.Query<UpdateLog>()
.WhereIf(!string.IsNullOrEmpty(key),x=>x.PointName.Contains(key))
.OrderByDesc(x => x.ID)
.Paging(pageIndex, pageSize);
}
PagedList<UpdateLog> paged = new PagedList<UpdateLog>(pagePagingResult.DataList,
pagePagingResult.Totals.ToInt(), pageIndex, pageSize);
return paged;
}
}
}

@ -50,6 +50,7 @@
this.labTime = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.buttonUpdateLog = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel6.SuspendLayout();
this.panel7.SuspendLayout();
@ -111,6 +112,7 @@
// panel8
//
this.panel8.BackColor = System.Drawing.Color.Transparent;
this.panel8.Controls.Add(this.buttonUpdateLog);
this.panel8.Controls.Add(this.hslLanternSimplePlc);
this.panel8.Controls.Add(this.button2);
this.panel8.Controls.Add(this.button1);
@ -130,7 +132,7 @@
//
// hslLanternSimplePlc
//
this.hslLanternSimplePlc.Location = new System.Drawing.Point(22, 536);
this.hslLanternSimplePlc.Location = new System.Drawing.Point(22, 641);
this.hslLanternSimplePlc.Name = "hslLanternSimplePlc";
this.hslLanternSimplePlc.Size = new System.Drawing.Size(78, 94);
this.hslLanternSimplePlc.TabIndex = 10;
@ -336,6 +338,21 @@
this.label1.TabIndex = 0;
this.label1.Text = "佳通RFID层合裁切设备";
//
// buttonUpdateLog
//
this.buttonUpdateLog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173)))));
this.buttonUpdateLog.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonUpdateLog.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonUpdateLog.ForeColor = System.Drawing.SystemColors.Window;
this.buttonUpdateLog.Location = new System.Drawing.Point(22, 522);
this.buttonUpdateLog.Margin = new System.Windows.Forms.Padding(4);
this.buttonUpdateLog.Name = "buttonUpdateLog";
this.buttonUpdateLog.Size = new System.Drawing.Size(300, 65);
this.buttonUpdateLog.TabIndex = 11;
this.buttonUpdateLog.Text = "参数修改记录";
this.buttonUpdateLog.UseVisualStyleBackColor = false;
this.buttonUpdateLog.Click += new System.EventHandler(this.buttonUpdateLog_Click);
//
// FormMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -376,5 +393,6 @@
private System.Windows.Forms.Label labTime;
private System.Windows.Forms.Label labUser;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button buttonUpdateLog;
}
}

@ -105,27 +105,27 @@ namespace RfidWeb
}
private UpdateLogService updateLogService = new UpdateLogService();
private PointService pointService = new PointService();
private void UpdateLog()
{
if (UserManager.IsExit())
{
var dic = pointService.GetValueName();
if (cache.ContainsKey(CacheKeyManager.UpdateLog)) return;
cache.Set(CacheKeyManager.UpdateLog, DateTime.Now, TimeSpan.FromSeconds(5));
var plc = PlcConnect.Instance;
var userDto = TestFactory.TestUser();
var strings = HmiPoint.GetValue();
var userDto = UserManager.GetUser();
var strings = dic.Keys;
foreach (var se in strings)
{
var res = plc.ReadUInt32(se);
if (res.IsSuccess)
{
updateLogService.AddOrUpdateLog(userDto, se, res.Content);
string name = dic[se];
updateLogService.AddOrUpdateLog(userDto, name, res.Content);
}
}
cache.Remove(CacheKeyManager.UpdateLog);
@ -246,5 +246,12 @@ namespace RfidWeb
}
}
}
private void buttonUpdateLog_Click(object sender, EventArgs e)
{
panContent.Controls.Clear();
panContent.Controls.Add(new FromUploadLog());
CheckButton(buttonUpdateLog);
}
}
}

@ -0,0 +1,253 @@
namespace RfidWeb.Frm
{
partial class FromUploadLog
{
/// <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(FromUploadLog));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
this.panelTop = new System.Windows.Forms.Panel();
this.ucBtnSelect = new HZH_Controls.Controls.UCBtnExt();
this.textBoxSel = new HZH_Controls.Controls.TextBoxEx();
this.ucPagerControl21 = new HZH_Controls.Controls.UCPagerControl2();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Alarm = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UserName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RoleName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.CreateUserName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.CreateDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panelTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// panelTop
//
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 = 2;
//
// 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, 18);
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, 35);
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_1);
//
// textBoxSel
//
this.textBoxSel.DecLength = 2;
this.textBoxSel.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBoxSel.InputType = HZH_Controls.TextInputType.NotControl;
this.textBoxSel.Location = new System.Drawing.Point(32, 18);
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, 30);
this.textBoxSel.TabIndex = 0;
//
// 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.Bottom;
this.ucPagerControl21.Location = new System.Drawing.Point(0, 894);
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 = 1;
this.ucPagerControl21.TabIndex = 3;
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ID,
this.Alarm,
this.UserName,
this.RoleName,
this.CreateUserName,
this.CreateDate});
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle7;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 80);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(910, 814);
this.dataGridView1.TabIndex = 4;
//
// ID
//
this.ID.DataPropertyName = "ID";
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.ID.DefaultCellStyle = dataGridViewCellStyle6;
this.ID.HeaderText = "ID";
this.ID.Name = "ID";
this.ID.ReadOnly = true;
this.ID.Visible = false;
//
// Alarm
//
this.Alarm.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.Alarm.DataPropertyName = "PointName";
this.Alarm.HeaderText = "点位名称";
this.Alarm.Name = "Alarm";
this.Alarm.ReadOnly = true;
//
// UserName
//
this.UserName.DataPropertyName = "OldValue";
this.UserName.HeaderText = "修改前数据";
this.UserName.Name = "UserName";
this.UserName.ReadOnly = true;
this.UserName.Width = 180;
//
// RoleName
//
this.RoleName.DataPropertyName = "NewValue";
this.RoleName.HeaderText = "当前数据";
this.RoleName.Name = "RoleName";
this.RoleName.ReadOnly = true;
this.RoleName.Width = 180;
//
// CreateUserName
//
this.CreateUserName.DataPropertyName = "CreateUserName";
this.CreateUserName.HeaderText = "修改人";
this.CreateUserName.Name = "CreateUserName";
this.CreateUserName.ReadOnly = true;
this.CreateUserName.Width = 180;
//
// CreateDate
//
this.CreateDate.DataPropertyName = "CreateDate";
this.CreateDate.HeaderText = "修改时间";
this.CreateDate.Name = "CreateDate";
this.CreateDate.ReadOnly = true;
this.CreateDate.Width = 180;
//
// FromUploadLog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.ucPagerControl21);
this.Controls.Add(this.panelTop);
this.Name = "FromUploadLog";
this.Size = new System.Drawing.Size(910, 935);
this.panelTop.ResumeLayout(false);
this.panelTop.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panelTop;
private HZH_Controls.Controls.UCBtnExt ucBtnSelect;
private HZH_Controls.Controls.TextBoxEx textBoxSel;
private HZH_Controls.Controls.UCPagerControl2 ucPagerControl21;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
private System.Windows.Forms.DataGridViewTextBoxColumn Alarm;
private System.Windows.Forms.DataGridViewTextBoxColumn UserName;
private System.Windows.Forms.DataGridViewTextBoxColumn RoleName;
private System.Windows.Forms.DataGridViewTextBoxColumn CreateUserName;
private System.Windows.Forms.DataGridViewTextBoxColumn CreateDate;
}
}

@ -0,0 +1,59 @@
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;
using DB.Service;
namespace RfidWeb.Frm
{
public partial class FromUploadLog : UserControl
{
public FromUploadLog()
{
InitializeComponent();
Init();
}
UpdateLogService updateLogService=new UpdateLogService();
private void Init()
{
this.dataGridView1.AutoGenerateColumns = false;
ucPagerControl21.PageModel = PageModel.PageCount;
ucPagerControl21.PageIndex = 1;
ucPagerControl21.PageSize = 20;
}
private void Replace()
{
ucPagerControl21.PageIndex = 1;
ucPagerControl21_ShowSourceChanged(new object());
}
private void ucPagerControl21_ShowSourceChanged(object currentSource)
{
string key = textBoxSel.Text;
int index = ucPagerControl21.PageIndex;
var page = updateLogService.GetPagedList(ucPagerControl21.PageSize,
ucPagerControl21.PageSize,key);
ucPagerControl21.PageCount = page.TotalPages;
this.dataGridView1.DataSource = page.Items;
}
private void ucBtnSelect_BtnClick_1(object sender, EventArgs e)
{
Replace();
}
}
}

@ -0,0 +1,147 @@
<?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>
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Alarm.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UserName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RoleName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="CreateUserName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="CreateDate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -28,125 +28,35 @@ namespace RfidWeb
var rfidSetting = RfidSetting.Current;
var dbContext = DbFactory.GetContext;
new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
//dbContext.Insert(new Role()
//{
// ID = SnowflakeFactory.NewId,
// RoleName = "管理层",
// RoleLevel = 1
//});
//dbContext.Insert(new Role()
//{
// ID = SnowflakeFactory.NewId,
// RoleName = "设备层",
// RoleLevel = 2
//});
//dbContext.Insert(new Role()
//{
// ID = SnowflakeFactory.NewId,
// RoleName = "使用层",
// RoleLevel = 3
//});
//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 =
// 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);
// new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
Dictionary<string, string> dic = new Dictionary<string, string>();
dic["feeding_motor_speed"] = "供料电机速度";
dic["Laminated_motor_speed"] = "层合电机速度";
dic["Felt_belt_motor_speed"] = "毛毡带电机速度";
dic["Receiving_Electric_motor_speed"] = "收料电机1&2速度";
dic["Product_counter2"] = "层合生产数量";
dic["CQ_Chip1_counter"] = "裁切1生产数量";
dic["CQ_Chip2_counter"] = "裁切2生产数量";
dic["QDWD1SS"] = "裁刀1温度";
dic["QDWD2SS"] = "裁刀2温度";
dic["QDWD2SS"] = "裁刀2温度";
foreach (var ee in dic)
{
Point point = new Point();
point.DataType = "Uint32";
point.FromType = "参数";
point.PointAddress = ee.Key;
point.PointName=ee.Value;
point.ID = GetId;
dbContext.Insert(point);
}
}

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

@ -172,6 +172,12 @@
<Compile Include="Frm\FromAlarmLog.Designer.cs">
<DependentUpon>FromAlarmLog.cs</DependentUpon>
</Compile>
<Compile Include="Frm\FromUploadLog.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Frm\FromUploadLog.Designer.cs">
<DependentUpon>FromUploadLog.cs</DependentUpon>
</Compile>
<Compile Include="Frm\UserAlarmShow.cs">
<SubType>UserControl</SubType>
</Compile>
@ -215,6 +221,9 @@
<EmbeddedResource Include="Frm\FromAlarmLog.resx">
<DependentUpon>FromAlarmLog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FromUploadLog.resx">
<DependentUpon>FromUploadLog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\UserAlarmShow.resx">
<DependentUpon>UserAlarmShow.cs</DependentUpon>
<SubType>Designer</SubType>

Loading…
Cancel
Save