CC/iWareCC_ASRS/Forms/FormManagerPassword.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,200 @@ namespace iWareCC.Forms { partial class FormManagerPassword { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormManagerPassword)); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); this.button1 = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button(); this.lbResult = new System.Windows.Forms.Label(); this.tB_Password = new System.Windows.Forms.TextBox(); this.lbl_FormPlaceAddOrUpdate_PLACEID = new System.Windows.Forms.Label(); this.lbl_FormPlaceAddOrUpdate_Title = new System.Windows.Forms.Label(); this.tableLayoutPanel1.SuspendLayout(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 3; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 7.777778F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 73.33334F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.88889F)); this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 55); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 91.03139F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8.96861F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(800, 395); this.tableLayoutPanel1.TabIndex = 52; // // panel1 // this.panel1.Controls.Add(this.panel2); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(66, 4); this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(578, 351); this.panel1.TabIndex = 0; // // panel2 // this.panel2.Controls.Add(this.button1); this.panel2.Controls.Add(this.btnSave); this.panel2.Controls.Add(this.lbResult); this.panel2.Controls.Add(this.tB_Password); this.panel2.Controls.Add(this.lbl_FormPlaceAddOrUpdate_PLACEID); this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Margin = new System.Windows.Forms.Padding(1); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(664, 209); this.panel2.TabIndex = 1; // // button1 // this.button1.BackColor = System.Drawing.Color.WhiteSmoke; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.button1.Font = new System.Drawing.Font("微软é é»", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button1.ForeColor = System.Drawing.Color.Maroon; this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image"))); this.button1.Location = new System.Drawing.Point(348, 112); this.button1.Margin = new System.Windows.Forms.Padding(1); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(215, 59); this.button1.TabIndex = 34; this.button1.Text = " å ³ é "; this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.button1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click); // // btnSave // this.btnSave.BackColor = System.Drawing.Color.WhiteSmoke; this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btnSave.Font = new System.Drawing.Font("微软é é»", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSave.ForeColor = System.Drawing.Color.Maroon; this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image"))); this.btnSave.Location = new System.Drawing.Point(81, 112); this.btnSave.Margin = new System.Windows.Forms.Padding(1); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(215, 59); this.btnSave.TabIndex = 2; this.btnSave.Text = " å¯ ç ç¡® 认 "; this.btnSave.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.btnSave.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnSave.UseVisualStyleBackColor = false; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // lbResult // this.lbResult.Dock = System.Windows.Forms.DockStyle.Bottom; this.lbResult.Font = new System.Drawing.Font("微软é é»", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbResult.ForeColor = System.Drawing.Color.Red; this.lbResult.Location = new System.Drawing.Point(0, 187); this.lbResult.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbResult.Name = "lbResult"; this.lbResult.Size = new System.Drawing.Size(664, 22); this.lbResult.TabIndex = 33; this.lbResult.Text = " "; this.lbResult.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // tB_Password // this.tB_Password.ForeColor = System.Drawing.Color.Maroon; this.tB_Password.Location = new System.Drawing.Point(185, 33); this.tB_Password.Margin = new System.Windows.Forms.Padding(4); this.tB_Password.Name = "tB_Password"; this.tB_Password.PasswordChar = '*'; this.tB_Password.Size = new System.Drawing.Size(390, 25); this.tB_Password.TabIndex = 23; // // lbl_FormPlaceAddOrUpdate_PLACEID // this.lbl_FormPlaceAddOrUpdate_PLACEID.AutoSize = true; this.lbl_FormPlaceAddOrUpdate_PLACEID.Font = new System.Drawing.Font("微软é é»", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbl_FormPlaceAddOrUpdate_PLACEID.ForeColor = System.Drawing.Color.Maroon; this.lbl_FormPlaceAddOrUpdate_PLACEID.Location = new System.Drawing.Point(75, 27); this.lbl_FormPlaceAddOrUpdate_PLACEID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbl_FormPlaceAddOrUpdate_PLACEID.Name = "lbl_FormPlaceAddOrUpdate_PLACEID"; this.lbl_FormPlaceAddOrUpdate_PLACEID.Size = new System.Drawing.Size(83, 31); this.lbl_FormPlaceAddOrUpdate_PLACEID.TabIndex = 22; this.lbl_FormPlaceAddOrUpdate_PLACEID.Text = "å¯ ç :"; // // lbl_FormPlaceAddOrUpdate_Title // this.lbl_FormPlaceAddOrUpdate_Title.BackColor = System.Drawing.Color.WhiteSmoke; this.lbl_FormPlaceAddOrUpdate_Title.Dock = System.Windows.Forms.DockStyle.Top; this.lbl_FormPlaceAddOrUpdate_Title.Font = new System.Drawing.Font("微软é é»", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbl_FormPlaceAddOrUpdate_Title.ForeColor = System.Drawing.Color.Maroon; this.lbl_FormPlaceAddOrUpdate_Title.Location = new System.Drawing.Point(0, 0); this.lbl_FormPlaceAddOrUpdate_Title.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbl_FormPlaceAddOrUpdate_Title.Name = "lbl_FormPlaceAddOrUpdate_Title"; this.lbl_FormPlaceAddOrUpdate_Title.Size = new System.Drawing.Size(800, 55); this.lbl_FormPlaceAddOrUpdate_Title.TabIndex = 51; this.lbl_FormPlaceAddOrUpdate_Title.Text = "请è¾å ¥ç®¡çåå¯ç !!!"; this.lbl_FormPlaceAddOrUpdate_Title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // FormManagerPassword // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.lbl_FormPlaceAddOrUpdate_Title); this.Name = "FormManagerPassword"; this.Text = "FormManagerPassword"; this.tableLayoutPanel1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Label lbResult; private System.Windows.Forms.TextBox tB_Password; private System.Windows.Forms.Label lbl_FormPlaceAddOrUpdate_PLACEID; private System.Windows.Forms.Label lbl_FormPlaceAddOrUpdate_Title; } } CC/iWareCC_ASRS/Forms/FormManagerPassword.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,51 @@ using iWareSql.DataAccess; using iWareSql.WmsDBModel; 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 iWareCC.Forms { public partial class FormManagerPassword : Form { public bool isValidateOk = false; public FormManagerPassword() { InitializeComponent(); } private void btnSave_Click(object sender, EventArgs e) { //å¿ é¡»å è¾å ¥å¯ç ï¼ï¼ï¼ï¼ var tb_password = this.tB_Password.Text.Trim(); if (tb_password == string.Empty) { MessageBox.Show("å¯ç ä¸è½ä¸ºç©ºï¼è¯·éæ°è¾å ¥!"); return; } using (WmsDBModel edm = new WmsDBModel()) { var right = WmsConfigEncryptionHandler.ValidtePassword(edm, tb_password); if (right == false) { MessageBox.Show("å¯ç 䏿£ç¡®ï¼è¯·éæ°è¾å ¥!"); return; } isValidateOk = true; this.Close(); } } private void button1_Click(object sender, EventArgs e) { isValidateOk = false; this.Close(); } } } CC/iWareCC_ASRS/Forms/FormManagerPassword.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,150 @@ <?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> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="button1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJOSURBVFhHxdbJaxNhGMfx/gW2LnWlsQRtPQmC2uIu okTrUqQuVGkpakViPUjuQW1PohfxJKIHwYuCIBUPgqgIHoTagx5KDtYuSSbLpJNpJslk5uc70Y4z87xO esnbgc8h75P3nW8GEtIAYElxF0X69+JG+4Iogzqxzv5zH2+Aeb3NAkFoQOXa5igDQaIkQB/cBJFIQOlS ECKRAK2/FSKRAPVCACKRAOVcC0QiAbnTG1CLOtIH7cktzF3cQudnW1F4GKnK9QTo3IMEZLvXw496P2xt ql5GOo7c1U57Jve2oxIb/zsFtJcPXHt52OUOyJxcBz/FN0/Z20ybkZ6FfKUD2fNt0GPfXDP9+xfuGU7s cgekj6+FHzl8AKY2zz6+YTOkGegTY641izI8wD3DiQSkjq1BLbnICZiFPFDR/yt/b4i714sESKHVWAz5 ZhdMdQ4olwjlbpi7h4cEJI80YzGk7iD0H1+BouZiJKeR7t/B3cNDAhKHm1FL8lQQ5fHPQEHlMqZiSPVt 5+71IgHxQ6vgJ9EVQHnsI2A9fgczm3S9rkxOQOrdxj3DiQTMHlwJP/nHI4Aiu8jDg0gPHYXJfhec69q7 F9wznEjAzP4V8KM8ugPkMjb59mV7lgqHYLKv5MJMe/vctZeHBuxjAx/x0EYURp+h9GkUmUgPmUsDe1F8 /wrFD6+ROLOVzL1IwPSe5RCJBEztboJIJODXriaIRAM6GyESCZjsaIRIJODnzmVRBoLQv+Vs0cJ7cz3Y 9/UG1PtJWGdX70MClgp3URw0/AZ83FxSgxGYwAAAAABJRU5ErkJggg== </value> </data> <data name="btnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGeSURBVFhHxda5SwNBFMfxn0FFBLEQLCwsLCxsLGws LCwsLAQLEcQ2xvsW7xOPeNvvX+GNt3jEI2o0xvw/z7dhg7uzk8RidlK8LV7z+bI7AwsiyupIlzpHutQ5 0qXOkS51jnSpcxKPvXg7duNt2Plp5WnBdqwZW7EmbH43YiPagPVoPYJfdVj7rMVqpAYrkWosf1Rh6b0S i28VWAiXYz5chrnXUsy+lGDmuRjTT0WYChViMlRgTDzm0/hDnjF2n4vROx9Gbn3OAA9xsnBinBgnEx++ yXEGaMSJcRq6/vv0VoBWnAavYDgCNOM0cGmytgDdeP+F8AY049R3LpwB3XjvmRAg4AbjxLjhFd5zKgTY cLJwYpwYJy/w7hMhIA1OjJNqvOtYCLC9dhlOjJNKvFMM+AdOjJMqPHAkBFgHLhNOqvDAoRDAuHnateEd B0IA48mrpgX3iwEWnrxqnuP+fSHAhievmqe4K0DAlV21VLgrQIKDcXiFuwJS4GDc/IdTjrsC0uCJH0jV uDmOgAw4GIdK3BxHQDZHutQ50qW+IfwC0ZOLx5yppDcAAAAASUVORK5CYII= </value> </data> </root> CC/iWareCC_ASRS/ThreadService/00_269¹¤Î»/DataProcess_269.cs
@@ -1,9 +1,11 @@ using Admin.NET.Application; using iWareCC.Common.Helper; using iWareCC.Forms; using iWareCC.StationService; using iWareCommon.Common.Globle; using iWareCommon.Utils; using iWareModel; using iWareSql.DataAccess; using iWareSql.DBModel; using iWareSql.WmsDBModel; using System; @@ -12,6 +14,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using XiGang.Core.Model; namespace iWareCC.ThreadService @@ -32,11 +35,30 @@ { Thread.Sleep(1000);//ä¼ç 2ç§ï¼å°ä¼ç åå°åé¢ï¼æ¯ä¸ºäºä¸é¢çcontinueæ¹æ³æ§è¡å䏿¾ç¤ºé误信æ¯çæç¤ºï¼ï¼ï¼ãEditBy shaocx,2022-05-24ã SystemWarningMsg._lbl_alert_DataProcess_269 = string.Empty; try { //if (SystemValue.isAllowRuning_DataProcess_269 && SystemValue.isStartedModel) if (SystemValue.isStartedModel) { //å¢å éªè¯å¯ç ãEditby shaocx,2024-12-19ã using (WmsDBModel edm = new WmsDBModel()) { var isTrigger = WmsConfigEncryptionHandler.IsTrigger(edm); if (isTrigger) { //è¦æ±å¿ é¡»è¾å ¥ç®¡çåå¯ç æå¯ä»¥!!! FormManagerPassword fr = new FormManagerPassword(); fr.StartPosition = FormStartPosition.CenterScreen; fr.ShowDialog(); if (!fr.isValidateOk) { return; } } } var rgvLocation = StationLocationEnum.馿¬¡æ«ç å·¥ä½.ToString(); /* * 1ã仿°æ®åºä¸å¤ææ¯å¦é½å¥ CC/iWareCC_ASRS/iWareCC.csproj
@@ -142,6 +142,12 @@ <Compile Include="FormCC.Designer.cs"> <DependentUpon>FormCC.cs</DependentUpon> </Compile> <Compile Include="Forms\FormManagerPassword.cs"> <SubType>Form</SubType> </Compile> <Compile Include="Forms\FormManagerPassword.Designer.cs"> <DependentUpon>FormManagerPassword.cs</DependentUpon> </Compile> <Compile Include="Forms\SrmStockForm.cs"> <SubType>Form</SubType> </Compile> @@ -187,6 +193,9 @@ <EmbeddedResource Include="FormCC.resx"> <DependentUpon>FormCC.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="Forms\FormManagerPassword.resx"> <DependentUpon>FormManagerPassword.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="Forms\SrmStockForm.resx"> <DependentUpon>SrmStockForm.cs</DependentUpon> </EmbeddedResource> CC/iWareCommon/Utils/DESEncryptHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,80 @@ using System; using System.Security.Cryptography; using System.Text; namespace iWareCommon.Utils { /// <summary> /// DESå å¯/è§£å¯ç±»ã /// </summary> public class DESEncryptHelper { #region ========å å¯======== private static string txtKey = "PatrickpanP="; private static string txtIV = "LiuJineagel="; /// <summary> /// å 坿°æ® /// </summary> /// <param name="Text"></param> /// <param name="sKey"></param> /// <returns></returns> public static string Encrypt(string Text) { DESCryptoServiceProvider des = new DESCryptoServiceProvider(); byte[] inputByteArray; inputByteArray = Encoding.Default.GetBytes(Text); //des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); //des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); des.Key = Convert.FromBase64String(txtKey); des.IV = Convert.FromBase64String(txtIV); System.IO.MemoryStream ms = new System.IO.MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write); cs.Write(inputByteArray, 0, inputByteArray.Length); cs.FlushFinalBlock(); StringBuilder ret = new StringBuilder(); foreach (byte b in ms.ToArray()) { ret.AppendFormat("{0:X2}", b); } return ret.ToString(); } #endregion #region ========è§£å¯======== /// <summary> /// è§£å¯æ°æ® /// </summary> /// <param name="Text"></param> /// <param name="sKey"></param> /// <returns></returns> public static string Decrypt(string Text) { DESCryptoServiceProvider des = new DESCryptoServiceProvider(); int len; len = Text.Length / 2; byte[] inputByteArray = new byte[len]; int x, i; for (x = 0; x < len; x++) { i = Convert.ToInt32(Text.Substring(x * 2, 2), 16); inputByteArray[x] = (byte)i; } //des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); //des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); des.Key = Convert.FromBase64String(txtKey); des.IV = Convert.FromBase64String(txtIV); System.IO.MemoryStream ms = new System.IO.MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write); cs.Write(inputByteArray, 0, inputByteArray.Length); cs.FlushFinalBlock(); return Encoding.Default.GetString(ms.ToArray()); } #endregion } } CC/iWareCommon/iWareCommon.csproj
@@ -79,6 +79,7 @@ <Compile Include="Common\Globle\SysGloble.cs" /> <Compile Include="Common\Service\CommonService.cs" /> <Compile Include="Utils\CSharpHelper.cs" /> <Compile Include="Utils\DESEncryptHelper.cs" /> <Compile Include="Utils\HTTP\HTTPService.cs" /> <Compile Include="Utils\HTTP\SSLUtil.cs" /> <Compile Include="Utils\SysHelper.cs" /> CC/iWareSql/DataAccess/WmsConfigEncryptionHandler.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,67 @@ using iWareCommon.Utils; using iWareSql.WmsDBModel; using System; using System.Linq; namespace iWareSql.DataAccess { public class WmsConfigEncryptionHandler { /// <summary> /// æ¯å¦è§¦å /// </summary> /// <param name="edm"></param> /// <returns></returns> public static bool IsTrigger(WmsDBModel.WmsDBModel edm) { //模æ //return true; var dbList = edm.wms_config_encryption.Where(x => x.IsDelete == false).ToList(); if (dbList?.Count > 0) { var fisrt = dbList.OrderBy(x => x.Id).First(); //è§£å¯æ¶é´ var deTime = DESEncryptHelper.Decrypt(fisrt.IssueTime); var valieTime = Convert.ToDateTime(deTime); var nowTime = DateTime.Now; if (nowTime > valieTime) { return true; } return false; } return false; //*/ } /// <summary> /// æ¯å¦éªè¯å¯ç æå /// </summary> /// <param name="edm"></param> /// <returns></returns> public static bool ValidtePassword(WmsDBModel.WmsDBModel edm, string valiPasswrod) { var dbList = edm.wms_config_encryption.ToList(); if (dbList?.Count > 0) { var fisrt = dbList.Where(x => x.IsDelete == false).OrderBy(x => x.Id).First(); var dePassword = DESEncryptHelper.Decrypt(fisrt.PassWord); if (valiPasswrod == dePassword) { //å é¤è¯¥æ°æ® edm.wms_config_encryption.Remove(fisrt); edm.SaveChanges(); return true; } return false; } return false; } } } CC/iWareSql/WmsDBModel/WmsDBModel.cs
@@ -72,6 +72,7 @@ public virtual DbSet<wms_base_place> wms_base_place { get; set; } public virtual DbSet<wms_base_warehouse> wms_base_warehouse { get; set; } public virtual DbSet<wms_config_device_warning> wms_config_device_warning { get; set; } public virtual DbSet<wms_config_encryption> wms_config_encryption { get; set; } public virtual DbSet<wms_config_no_rule> wms_config_no_rule { get; set; } public virtual DbSet<wms_config_print> wms_config_print { get; set; } public virtual DbSet<wms_config_serial_rule> wms_config_serial_rule { get; set; } CC/iWareSql/WmsDBModel/wms_config_encryption.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,38 @@ namespace iWareSql.WmsDBModel { using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; public partial class wms_config_encryption { [DatabaseGenerated(DatabaseGeneratedOption.None)] public long Id { get; set; } [Required] [StringLength(50)] public string IssueTime { get; set; } [Required] [StringLength(50)] public string PassWord { get; set; } public DateTime? CreateTime { get; set; } public DateTime? UpdateTime { get; set; } public long? CreateUserId { get; set; } [StringLength(64)] public string CreateUserName { get; set; } public long? UpdateUserId { get; set; } [StringLength(64)] public string UpdateUserName { get; set; } public bool IsDelete { get; set; } } } CC/iWareSql/iWareSql.csproj
@@ -55,6 +55,7 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="DataAccess\WmsConfigEncryptionHandler.cs" /> <Compile Include="DataAccess\TaskHandler.cs" /> <Compile Include="DataAccess\AgvHandler.cs" /> <Compile Include="DataAccess\Base_CodeItemsHandler.cs" /> @@ -219,6 +220,7 @@ <Compile Include="WmsDBModel\wms_base_place.cs" /> <Compile Include="WmsDBModel\wms_base_warehouse.cs" /> <Compile Include="WmsDBModel\wms_config_device_warning.cs" /> <Compile Include="WmsDBModel\wms_config_encryption.cs" /> <Compile Include="WmsDBModel\wms_config_no_rule.cs" /> <Compile Include="WmsDBModel\wms_config_print.cs" /> <Compile Include="WmsDBModel\wms_config_serial_rule.cs" /> CC/iWareUnitTest/CSharpTest.cs
@@ -132,5 +132,31 @@ sList.Add("888"); string cc = JsonConvert.SerializeObject(sList); } [TestMethod] public void Test_Encrypt() { var txt = DESEncryptHelper.Encrypt("2025-01-25");//C3F3DD5F2C816041775DB87739E1F729 var txt1 = DESEncryptHelper.Encrypt("2025-02-25");//125B1E37E4C1F3C8DD1F36B342ED1307 var txt2 = DESEncryptHelper.Encrypt("2025-03-30");//45BAF941111384BEE21F89FD18461EC1 var to_txt = DESEncryptHelper.Decrypt("C3F3DD5F2C816041775DB87739E1F729");// var to_txt1 = DESEncryptHelper.Decrypt("125B1E37E4C1F3C8DD1F36B342ED1307");// var to_txt2 = DESEncryptHelper.Decrypt("45BAF941111384BEE21F89FD18461EC1");// var password_txt = DESEncryptHelper.Encrypt("DZhjdue245");//8A758F5E99473D3718569DCCEC7E3CD0 var password_txt1 = DESEncryptHelper.Encrypt("365YUhd32s");//0B5230C94E2692763B00FAE4B0205C7F var password_txt2 = DESEncryptHelper.Encrypt("7422djkjhdh_");//8C2676E7F5D49F0F3E6E32033E2A6A4B //æµè¯ var test_txt = DESEncryptHelper.Encrypt("2024-12-19");//46039E400A485A5B383F51212D562772 var test_txt2 = DESEncryptHelper.Encrypt("2024-12-25");//46039E400A485A5B80BA4C2C44FEA6AF Assert.IsFalse(false); } } } LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsSystemConfig/WmsConfigEncryption.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,32 @@ using Admin.NET.Core; /* * @author : æ¨çåå * @date : 2024/7/21ä¸å10:18:14 * @desc : æå°é 置表 */ namespace Admin.NET.Application.Entity { /// <summary> /// å å¯è¡¨ /// </summary> [SugarTable("wms_config_encryption", "å å¯è¡¨")] public class WmsConfigEncryption : EntityBase { /// <summary> /// å å¯è§¦åæ¶é´ /// </summary> [SugarColumn(ColumnName = "IssueTime", ColumnDescription = "å å¯è§¦åæ¶é´", Length = 50)] public string IssueTime { get; set; } /// <summary> /// å å¯å¯ç /// </summary> [SugarColumn(ColumnName = "PassWord", ColumnDescription = "å å¯å¯ç ", Length = 50)] public string PassWord { get; set; } } }