From 39965ac16351d5b814ea4cdaf8017695ba42530f Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期一, 30 五月 2022 13:36:19 +0800
Subject: [PATCH] 修改了选机台直接根据系统登录人员过滤功能
---
WarM/条码打印/Sc_ICMOToBarCode.cs | 27 ++++++++-----
BLL/公用模块/FrmLogin.cs | 49 +++++++++++++-----------
2 files changed, 43 insertions(+), 33 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 00253fd..af3aed1 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"
@@ -22,7 +22,7 @@
private void SetCmbAccount(string sServer)//cmb涓缃笎濂� //Lock
{
ClsCNmaster oCn = new ClsCNmaster();
- DataSet DS ;
+ DataSet DS;
try
{
DS = oCn.RunProcReturn("select * from HDSystem_DataBases where YNuse=1 ", "HDSystem_DataBases", ref ClsPub.sExeReturnInfo);
@@ -40,7 +40,7 @@
{
cmbAccount.SelectedIndex = 0;
ClsIni oIni = new ClsIni();
- string sNumber = ClsIni.ReadIni("Erp", "DataBaseNumber",DBUtility.ClsPub.AppPath + @"/HXErp.ini");
+ string sNumber = ClsIni.ReadIni("Erp", "DataBaseNumber", DBUtility.ClsPub.AppPath + @"/HXErp.ini");
for (int j = 0; j < cmbAccount.Items.Count; j++)
{
if (sNumber.Trim() == cmbAccount.Items[j].ToString().Trim())
@@ -56,7 +56,7 @@
private bool CheckServer()//妫�鏌ユ湇鍔″櫒鍚嶆纭�� //Lock
{
- ClsCN oCn=new ClsCN();
+ ClsCN oCn = new ClsCN();
if (oCn.CheckOpen())
{
lblStatus.Text = "鏈嶅姟鍣ㄨ繛鎺ユ垚鍔�";
@@ -109,19 +109,19 @@
string sDataBase_K3 = "";
string sDataBase_K32 = "";
string sDataBase_K33 = "";
- sDataBase = oCn.GetDataBase(cmbAccount.Text.Trim(),ref sDataBase_K3);
+ sDataBase = oCn.GetDataBase(cmbAccount.Text.Trim(), ref sDataBase_K3);
ClsIni oIni = new ClsIni();
ClsIni.WriteIni("Erp", "DataBase", sDataBase.Trim(), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
ClsIni.WriteIni("K3Erp", "DataBase", sDataBase_K3.Trim(), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
DAL.ClsUser oUser = new DAL.ClsUser();
-
- ds = oUser.CheckCzymc(cmbUser.Text.Trim(),ClsPub.StrToPsd( txtPsd.Text.Trim()));
- if (ds ==null)
+
+ ds = oUser.CheckCzymc(cmbUser.Text.Trim(), ClsPub.StrToPsd(txtPsd.Text.Trim()));
+ if (ds == null)
{
MessageBox.Show("閫夋嫨鐨勫笎濂椾笉瀛樺湪锛�", "鎻愮ず");
return;
}
- if (ds.Tables[0].Rows.Count >0)
+ if (ds.Tables[0].Rows.Count > 0)
{
ClsPub.CurUserID = ds.Tables[0].Rows[0]["Czybm"].ToString();
this.Close();
@@ -135,7 +135,7 @@
//寰楀埌褰撳墠浼氳鏈熼棿
int sYear = 0;
int sPeriod = 0;
- if (!ClsPub.Sub_GetCurPeriod(ref sYear,ref sPeriod))
+ if (!ClsPub.Sub_GetCurPeriod(ref sYear, ref sPeriod))
{
MessageBox.Show("寰楀埌褰撳墠浼氳鏈熼棿澶辫触锛�", "鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error);
isOk = false;
@@ -162,18 +162,18 @@
}
foreach (string eachStr in listStr)
{
- UserName = UserName+eachStr + ",";
+ UserName = UserName + eachStr + ",";
}
UserName = UserName.Remove(UserName.LastIndexOf(","), 1);
//
- ClsIni.WriteIni("UserInfo", "UserName", UserName, DBUtility.ClsPub.AppPath + @"/HXERP.ini");
+ ClsIni.WriteIni("UserInfo", "UserName", UserName, DBUtility.ClsPub.AppPath + @"/HXERP.ini");
ClsIni.WriteIni("UserInfo", "HOrgName", cmbHOrg.Text.ToString(), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
ClsPub.CurUserName = cmbUser.Text.Trim();
ClsPub.AppPath = System.Environment.CurrentDirectory;
ClsPub.HOrgID = ClsPub.get_ORGANIZATIONSIDByName(ClsPub.isStrNull(cmbHOrg.Text));
ClsPub.HOrgNumber = ClsPub.get_ORGANIZATIONSNOByName(ClsPub.isStrNull(cmbHOrg.Text));
ClsPub.HOrgName = ClsPub.isStrNull(cmbHOrg.Text);
- if(chkRemember.Checked==true )
+ if (chkRemember.Checked == true)
{
ClsIni.WriteIni("UserInfo", "UserPsd", "", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
ClsIni.WriteIni("UserInfo", "Remember", "1", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
@@ -183,7 +183,7 @@
ClsIni.WriteIni("UserInfo", "UserPsd", "", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
ClsIni.WriteIni("UserInfo", "Remember", "0", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
}
-
+
}
private void txtUser_KeyUp(object sender, KeyEventArgs e)
@@ -194,8 +194,8 @@
private void txtPsd_KeyUp(object sender, KeyEventArgs e)
{
- if (e.KeyValue == 13)
- this.btnOK_Click(sender,e);
+ if (e.KeyValue == 13)
+ this.btnOK_Click(sender, e);
}
private void timer1_Tick(object sender, EventArgs e)
@@ -207,7 +207,7 @@
}
ClsIni oIni = new ClsIni();
//
- UserName = ClsIni.ReadIni("UserInfo", "UserName",DBUtility.ClsPub.AppPath + @"/HXERP.ini");
+ UserName = ClsIni.ReadIni("UserInfo", "UserName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
string[] strArr = UserName.Split(',');
foreach (string str in strArr)
@@ -216,7 +216,7 @@
}
cmbUser.SelectedIndex = 0;
//
- txtUser.Text = ClsIni.ReadIni("UserInfo", "UserName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
+ txtUser.Text = ClsIni.ReadIni("UserInfo", "UserName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
if (ClsIni.ReadIni("UserInfo", "Remember", DBUtility.ClsPub.AppPath + @"/HXERP.ini") == "1")
{
txtPsd.Text = ClsIni.ReadIni("UserInfo", "UserPsd", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
@@ -224,8 +224,8 @@
}
else
{
- txtPsd.Text ="";
- chkRemember.Checked = false ;
+ txtPsd.Text = "";
+ chkRemember.Checked = false;
}
}
@@ -319,8 +319,8 @@
public DataSet get_ORGANIZATIONSList()
{
try
- {
- return ClsPub.get_ORGANIZATIONSList();
+ {
+ return ClsPub.get_ORGANIZATIONSList();
}
catch (Exception e)
{
@@ -335,7 +335,7 @@
private void label4_Click(object sender, EventArgs e)
{
- if (MessageBox.Show("纭畾瑕佹墜鍔ㄦ洿鏂扮▼搴忓悧锛熸湰绋嬪簭灏嗚嚜鍔ㄥ叧闂紒","鎻愮ず",MessageBoxButtons.OKCancel)==DialogResult.OK)
+ if (MessageBox.Show("纭畾瑕佹墜鍔ㄦ洿鏂扮▼搴忓悧锛熸湰绋嬪簭灏嗚嚜鍔ㄥ叧闂紒", "鎻愮ず", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
string strFileName = ClsPub.AppPath + @"/HX_Update.exe";
System.Diagnostics.Process.Start(strFileName);
@@ -347,6 +347,11 @@
{
//textBox1.Focus();
string HPassWord = textBox1.Text.Trim().ToString();
+ if (HPassWord == null || HPassWord == "")
+ {
+ MessageBox.Show("璇峰埛鍗�");
+ return;
+ }
//MessageBox.Show(HPassWord);
SQLHelper.ClsCN oCn1 = new SQLHelper.ClsCN();
//1.鏌ユ壘鏁版嵁搴撴搷浣滃憳绠$悊琛ㄩ噷闈㈡槸鍚︽湁瀵瑰簲杩欎釜鍔犲瘑瀛楃涓插搴旂殑璁板綍
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 759a957..b18ec97 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"
@@ -228,7 +228,7 @@
DataSet DSet;
- DSet = oCn.RunProcReturn("Select * from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
+ DSet = oCn.RunProcReturn("Select HEmpID from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
if (DSet == null)
//if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
@@ -244,7 +244,7 @@
{
- txtHEmpID.Tag = DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["HEmpID"]);
+ txtHEmpID.Tag = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HEmpID"]);
}
else
{
@@ -1078,18 +1078,19 @@
{
if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value))
{
- //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
- //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
- MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
- return;
+ HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+
+ //MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
+ //return;
}
else
{
- //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = HZXQty;
+ grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = HZXQty;
//
- HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
- grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
}
}
else
@@ -1756,14 +1757,17 @@
private void cmdHSourceID_Click(object sender, EventArgs e)
{
Int64 HEmpID = 0;
- HEmpID = ClsPub.isLong(txtHEmpID.Tag);
+ HEmpID = Convert.ToInt64(txtHEmpID.Tag);
+
+
+ //MessageBox.Show(ClsPub.isStrNull(HEmpID));
//string HEmpName = "";
//HEmpName = ClsPub.isStrNull(txtHEmpID.Text);
DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
if (HEmpID != 0)
{
- if (oSource.GetInfoByID(HEmpID))
+ if (oSource.GetInfoByID_AoBang(HEmpID))
{
this.txtHSourceID.Text = oSource.oModel.HName;
this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
@@ -1981,6 +1985,7 @@
grdList.DataSource = null;
grdSub.DataSource = null;
grdMain.DataSource = null;
+ txtHEmpID.Tag = 0;
}
private void button2_Click(object sender, EventArgs e)
--
Gitblit v1.9.1