From e111435d04d84d67b3d7c699876ec34e29ec6cfb Mon Sep 17 00:00:00 2001
From: jhz <jinghz@oceic.com>
Date: 星期二, 14 六月 2022 21:49:54 +0800
Subject: [PATCH] 刷卡自动登录
---
WarM/条码打印/Sc_ICMOToBarCode.cs | 2
BLL/公用模块/FrmLogin.designer.cs | 115 +++++++++++++++++++++++---------------
WarM/Sc_MESNowWorkBill_Fast.designer.cs | 1
BLL/公用模块/FrmLogin.cs | 47 +++++++++------
BLL/公用模块/FrmLogin.resx | 2
5 files changed, 100 insertions(+), 67 deletions(-)
diff --git "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs" "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs"
index 494c221..03207e5 100644
--- "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs"
+++ "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs"
@@ -271,6 +271,7 @@
{
textBox1.Visible = true;
button1.Visible = true;
+ textBox1.Focus();
}
else
{
@@ -455,12 +456,21 @@
private void textBox1_TextChanged(object sender, EventArgs e)
{
+
+ }
+
+ private void textBox1_KeyDown(object sender, KeyEventArgs e)
+ {
string HPassWord = textBox1.Text.Trim().ToString();
+ if (HPassWord.Length < 10)
+ {
+ return;
+ }
//MessageBox.Show(HPassWord);
//婕旂ず瑙嗛鐢紝骞虫椂灞忚斀鎺�
- if (HPassWord.Trim() == "")
+ if (HPassWord.Trim() == "3012460306-1" || HPassWord.Contains("3012460306-1") == true)
{
- MessageBox.Show("鎮ㄥ埛鐨勫憳宸ュ崱锛屾病鏈夌粡杩囨妧鑳界殑鍩硅锛屼笉鑳藉湪鏈伐搴忎笂宀楋紒");
+ MessageBox.Show("鎮ㄥ埛鐨勫憳宸ュ崱锛屾病鏈夌粡杩囨妧鑳界殑鍩硅锛屼笉鑳藉湪鏈伐绔欎笂宀楋紒");
return;
}
//
@@ -480,7 +490,7 @@
if (AllowLogin() != true)
return;
- DataSet ds = null;
+ //DataSet ds = null;
ClsCNmaster oCn = new ClsCNmaster();
ClsCN oCnLoc = new ClsCN();
string sDataBase;
@@ -493,23 +503,23 @@
ClsIni.WriteIni("K3Erp", "DataBase", sDataBase_K3.Trim(), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
DAL.ClsUser oUser = new DAL.ClsUser();
- ds = oUser.CheckCzymc(cmbUser.Text.Trim(), textBox1.Text.Trim());
- if (ds == null)
- {
- MessageBox.Show("閫夋嫨鐨勫笎濂椾笉瀛樺湪锛�", "鎻愮ず");
- return;
- }
- if (ds.Tables[0].Rows.Count > 0)
- {
- ClsPub.CurUserID = ds.Tables[0].Rows[0]["Czybm"].ToString();
+ //ds = oUser.CheckCzymc(cmbUser.Text.Trim(), textBox1.Text.Trim());
+ //if (ds == null)
+ //{
+ // MessageBox.Show("閫夋嫨鐨勫笎濂椾笉瀛樺湪锛�", "鎻愮ず");
+ // return;
+ //}
+ //if (ds.Tables[0].Rows.Count > 0)
+ //{
+ ClsPub.CurUserID = DSet.Tables[0].Rows[0]["Czybm"].ToString();
this.Close();
isOk = true;
- }
- else
- {
- MessageBox.Show("閿欒鐨勭敤鎴峰瘑鐮侊紒", "鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
+ //}
+ //else
+ //{
+ // MessageBox.Show("閿欒鐨勭敤鎴峰瘑鐮侊紒", "鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ // return;
+ //}
//寰楀埌褰撳墠浼氳鏈熼棿
int sYear = 0;
int sPeriod = 0;
@@ -562,7 +572,6 @@
ClsIni.WriteIni("UserInfo", "Remember", "0", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
}
}
-
}
}
}
\ No newline at end of file
diff --git "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.designer.cs" "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.designer.cs"
index cb36c14..b3a6adc 100644
--- "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.designer.cs"
+++ "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.designer.cs"
@@ -58,18 +58,20 @@
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.White;
- this.label1.Location = new System.Drawing.Point(279, 260);
+ this.label1.Location = new System.Drawing.Point(372, 325);
+ this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(59, 12);
+ this.label1.Size = new System.Drawing.Size(76, 15);
this.label1.TabIndex = 0;
this.label1.Text = "鐢� 鎴� 鍚�:";
//
// txtUser
//
this.txtUser.ImeMode = System.Windows.Forms.ImeMode.On;
- this.txtUser.Location = new System.Drawing.Point(78, 149);
+ this.txtUser.Location = new System.Drawing.Point(104, 186);
+ this.txtUser.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtUser.Name = "txtUser";
- this.txtUser.Size = new System.Drawing.Size(167, 21);
+ this.txtUser.Size = new System.Drawing.Size(221, 25);
this.txtUser.TabIndex = 1;
this.txtUser.Visible = false;
this.txtUser.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtUser_KeyUp);
@@ -77,10 +79,11 @@
// txtPsd
//
this.txtPsd.ImeMode = System.Windows.Forms.ImeMode.On;
- this.txtPsd.Location = new System.Drawing.Point(347, 290);
+ this.txtPsd.Location = new System.Drawing.Point(463, 362);
+ this.txtPsd.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtPsd.Name = "txtPsd";
this.txtPsd.PasswordChar = '*';
- this.txtPsd.Size = new System.Drawing.Size(167, 21);
+ this.txtPsd.Size = new System.Drawing.Size(221, 25);
this.txtPsd.TabIndex = 3;
this.txtPsd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPsd_KeyUp);
//
@@ -88,17 +91,19 @@
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.White;
- this.label2.Location = new System.Drawing.Point(279, 293);
+ this.label2.Location = new System.Drawing.Point(372, 366);
+ this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(59, 12);
+ this.label2.Size = new System.Drawing.Size(76, 15);
this.label2.TabIndex = 2;
this.label2.Text = "瀵� 銆�鐮�:";
//
// btnOK
//
- this.btnOK.Location = new System.Drawing.Point(391, 339);
+ this.btnOK.Location = new System.Drawing.Point(521, 424);
+ this.btnOK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnOK.Name = "btnOK";
- this.btnOK.Size = new System.Drawing.Size(81, 25);
+ this.btnOK.Size = new System.Drawing.Size(108, 31);
this.btnOK.TabIndex = 4;
this.btnOK.Text = "纭畾(&O)";
this.btnOK.UseVisualStyleBackColor = true;
@@ -106,9 +111,10 @@
//
// button2
//
- this.button2.Location = new System.Drawing.Point(502, 339);
+ this.button2.Location = new System.Drawing.Point(669, 424);
+ this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(81, 25);
+ this.button2.Size = new System.Drawing.Size(108, 31);
this.button2.TabIndex = 5;
this.button2.Text = "鍙栨秷(&C)";
this.button2.UseVisualStyleBackColor = true;
@@ -118,9 +124,10 @@
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.White;
- this.label3.Location = new System.Drawing.Point(279, 222);
+ this.label3.Location = new System.Drawing.Point(372, 278);
+ this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(59, 12);
+ this.label3.Size = new System.Drawing.Size(75, 15);
this.label3.TabIndex = 6;
this.label3.Text = "閫夋嫨甯愬:";
//
@@ -129,17 +136,19 @@
this.cmbAccount.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAccount.FormattingEnabled = true;
this.cmbAccount.ImeMode = System.Windows.Forms.ImeMode.On;
- this.cmbAccount.Location = new System.Drawing.Point(347, 219);
+ this.cmbAccount.Location = new System.Drawing.Point(463, 274);
+ this.cmbAccount.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cmbAccount.Name = "cmbAccount";
- this.cmbAccount.Size = new System.Drawing.Size(167, 20);
+ this.cmbAccount.Size = new System.Drawing.Size(221, 23);
this.cmbAccount.TabIndex = 7;
//
// lblStatus
//
this.lblStatus.BackColor = System.Drawing.Color.Transparent;
- this.lblStatus.Location = new System.Drawing.Point(240, 339);
+ this.lblStatus.Location = new System.Drawing.Point(320, 424);
+ this.lblStatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblStatus.Name = "lblStatus";
- this.lblStatus.Size = new System.Drawing.Size(145, 21);
+ this.lblStatus.Size = new System.Drawing.Size(193, 26);
this.lblStatus.TabIndex = 8;
this.lblStatus.Click += new System.EventHandler(this.lblStatus_Click);
//
@@ -152,9 +161,10 @@
//
this.chkRemember.AutoSize = true;
this.chkRemember.BackColor = System.Drawing.Color.White;
- this.chkRemember.Location = new System.Drawing.Point(520, 295);
+ this.chkRemember.Location = new System.Drawing.Point(693, 369);
+ this.chkRemember.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkRemember.Name = "chkRemember";
- this.chkRemember.Size = new System.Drawing.Size(72, 16);
+ this.chkRemember.Size = new System.Drawing.Size(89, 19);
this.chkRemember.TabIndex = 9;
this.chkRemember.Text = "淇濆瓨瀵嗙爜";
this.chkRemember.UseVisualStyleBackColor = false;
@@ -163,36 +173,40 @@
// lblChangePsd
//
this.lblChangePsd.BackColor = System.Drawing.Color.Transparent;
- this.lblChangePsd.Location = new System.Drawing.Point(547, 6);
+ this.lblChangePsd.Location = new System.Drawing.Point(729, 8);
+ this.lblChangePsd.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblChangePsd.Name = "lblChangePsd";
- this.lblChangePsd.Size = new System.Drawing.Size(66, 21);
+ this.lblChangePsd.Size = new System.Drawing.Size(88, 26);
this.lblChangePsd.TabIndex = 10;
this.lblChangePsd.Click += new System.EventHandler(this.lblChangePsd_Click);
//
// lblSetServer
//
this.lblSetServer.BackColor = System.Drawing.Color.Transparent;
- this.lblSetServer.Location = new System.Drawing.Point(459, 6);
+ this.lblSetServer.Location = new System.Drawing.Point(612, 8);
+ this.lblSetServer.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblSetServer.Name = "lblSetServer";
- this.lblSetServer.Size = new System.Drawing.Size(66, 21);
+ this.lblSetServer.Size = new System.Drawing.Size(88, 26);
this.lblSetServer.TabIndex = 11;
this.lblSetServer.Click += new System.EventHandler(this.lblSetServer_Click);
//
// lblVersion
//
this.lblVersion.BackColor = System.Drawing.Color.Transparent;
- this.lblVersion.Location = new System.Drawing.Point(454, 130);
+ this.lblVersion.Location = new System.Drawing.Point(605, 162);
+ this.lblVersion.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblVersion.Name = "lblVersion";
this.lblVersion.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
- this.lblVersion.Size = new System.Drawing.Size(150, 15);
+ this.lblVersion.Size = new System.Drawing.Size(200, 19);
this.lblVersion.TabIndex = 12;
//
// lblVersion2
//
this.lblVersion2.BackColor = System.Drawing.Color.Transparent;
- this.lblVersion2.Location = new System.Drawing.Point(451, 152);
+ this.lblVersion2.Location = new System.Drawing.Point(601, 190);
+ this.lblVersion2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblVersion2.Name = "lblVersion2";
- this.lblVersion2.Size = new System.Drawing.Size(150, 15);
+ this.lblVersion2.Size = new System.Drawing.Size(200, 19);
this.lblVersion2.TabIndex = 13;
this.lblVersion2.Visible = false;
//
@@ -202,9 +216,10 @@
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Font = new System.Drawing.Font("瀹嬩綋", 7.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.ForeColor = System.Drawing.Color.Yellow;
- this.label4.Location = new System.Drawing.Point(486, 104);
+ this.label4.Location = new System.Drawing.Point(648, 130);
+ this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(49, 10);
+ this.label4.Size = new System.Drawing.Size(63, 13);
this.label4.TabIndex = 14;
this.label4.Text = "鎵嬪姩鏇存柊";
this.label4.Click += new System.EventHandler(this.label4_Click);
@@ -213,17 +228,19 @@
//
this.lblIPAddress.AutoSize = true;
this.lblIPAddress.BackColor = System.Drawing.Color.Transparent;
- this.lblIPAddress.Location = new System.Drawing.Point(389, 380);
+ this.lblIPAddress.Location = new System.Drawing.Point(519, 475);
+ this.lblIPAddress.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblIPAddress.Name = "lblIPAddress";
- this.lblIPAddress.Size = new System.Drawing.Size(0, 12);
+ this.lblIPAddress.Size = new System.Drawing.Size(0, 15);
this.lblIPAddress.TabIndex = 15;
//
// cmbUser
//
this.cmbUser.FormattingEnabled = true;
- this.cmbUser.Location = new System.Drawing.Point(347, 257);
+ this.cmbUser.Location = new System.Drawing.Point(463, 321);
+ this.cmbUser.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cmbUser.Name = "cmbUser";
- this.cmbUser.Size = new System.Drawing.Size(167, 20);
+ this.cmbUser.Size = new System.Drawing.Size(221, 23);
this.cmbUser.TabIndex = 16;
//
// cmbHOrg
@@ -231,46 +248,51 @@
this.cmbHOrg.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbHOrg.FormattingEnabled = true;
this.cmbHOrg.ImeMode = System.Windows.Forms.ImeMode.On;
- this.cmbHOrg.Location = new System.Drawing.Point(347, 187);
+ this.cmbHOrg.Location = new System.Drawing.Point(463, 234);
+ this.cmbHOrg.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cmbHOrg.Name = "cmbHOrg";
- this.cmbHOrg.Size = new System.Drawing.Size(167, 20);
+ this.cmbHOrg.Size = new System.Drawing.Size(221, 23);
this.cmbHOrg.TabIndex = 18;
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.White;
- this.label5.Location = new System.Drawing.Point(279, 190);
+ this.label5.Location = new System.Drawing.Point(372, 238);
+ this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(59, 12);
+ this.label5.Size = new System.Drawing.Size(77, 15);
this.label5.TabIndex = 17;
this.label5.Text = "缁� 缁�:";
//
// button1
//
- this.button1.Location = new System.Drawing.Point(269, 339);
+ this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+ this.button1.Location = new System.Drawing.Point(359, 424);
+ this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(81, 25);
+ this.button1.Size = new System.Drawing.Size(108, 31);
this.button1.TabIndex = 19;
this.button1.Text = "鍒峰崱鐧婚檰";
- this.button1.UseVisualStyleBackColor = true;
+ this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.ImeMode = System.Windows.Forms.ImeMode.On;
- this.textBox1.Location = new System.Drawing.Point(347, 149);
+ this.textBox1.Location = new System.Drawing.Point(463, 186);
+ this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(167, 21);
+ this.textBox1.Size = new System.Drawing.Size(221, 25);
this.textBox1.TabIndex = 20;
- this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
+ this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
//
// FrmLogin
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
- this.ClientSize = new System.Drawing.Size(613, 401);
+ this.ClientSize = new System.Drawing.Size(817, 501);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.cmbHOrg);
@@ -294,6 +316,7 @@
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.ImeMode = System.Windows.Forms.ImeMode.On;
+ this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmLogin";
diff --git "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.resx" "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.resx"
index 331d1a0..072b05d 100644
--- "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.resx"
+++ "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.resx"
@@ -121,7 +121,7 @@
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>25</value>
+ <value>66</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
diff --git a/WarM/Sc_MESNowWorkBill_Fast.designer.cs b/WarM/Sc_MESNowWorkBill_Fast.designer.cs
index b462ea0..46c0a8e 100644
--- a/WarM/Sc_MESNowWorkBill_Fast.designer.cs
+++ b/WarM/Sc_MESNowWorkBill_Fast.designer.cs
@@ -1912,6 +1912,7 @@
this.Name = "Sc_MESNowWorkBill_Fast";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "宸ヤ綅鎸囧涔�";
+ this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Sc_MESNowWorkBill_Fast_FormClosing);
this.Load += new System.EventHandler(this.Sc_MESNowWorkBill_Fast_Load);
this.Tool.ResumeLayout(false);
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
index f95880c..07f7c53 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
@@ -2082,7 +2082,7 @@
return;
}
//閫夋嫨鎵撳嵃妯℃澘
- Sub_SetReport("鎵撳嵃妯℃澘");
+ Sub_SetReport("娉ㄥ鐗╂枡鏍囩");
Report.Print(false);
Thread.Sleep(1000);
}
--
Gitblit v1.9.1