| | |
| | | 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); |
| | |
| | | { |
| | | 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()) |
| | |
| | | |
| | | private bool CheckServer()//æ£æ¥æå¡å¨åæ£ç¡®æ§ //Lock |
| | | { |
| | | ClsCN oCn=new ClsCN(); |
| | | ClsCN oCn = new ClsCN(); |
| | | if (oCn.CheckOpen()) |
| | | { |
| | | lblStatus.Text = "æå¡å¨è¿æ¥æå"; |
| | |
| | | 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(); |
| | |
| | | //å¾å°å½åä¼è®¡æé´ |
| | | 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; |
| | |
| | | } |
| | | 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"); |
| | |
| | | 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) |
| | |
| | | |
| | | 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) |
| | |
| | | } |
| | | 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) |
| | |
| | | } |
| | | 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"); |
| | |
| | | } |
| | | else |
| | | { |
| | | txtPsd.Text =""; |
| | | chkRemember.Checked = false ; |
| | | txtPsd.Text = ""; |
| | | chkRemember.Checked = false; |
| | | } |
| | | } |
| | | |
| | |
| | | public DataSet get_ORGANIZATIONSList() |
| | | { |
| | | try |
| | | { |
| | | return ClsPub.get_ORGANIZATIONSList(); |
| | | { |
| | | return ClsPub.get_ORGANIZATIONSList(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | |
| | | 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); |
| | |
| | | { |
| | | //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.æ¥æ¾æ°æ®åºæä½å管ç表é颿¯å¦æå¯¹åºè¿ä¸ªå å¯å符串对åºçè®°å½ |