using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DBUtility; using DAL; namespace BLL { public partial class Xt_UserNew : Form { public Xt_UserNew() { InitializeComponent(); } public Pub_Class.ClsPub.Enum_InputMode InputMode; //¼Èë״̬±êÖ¾(0-·Ç¼Èë״̬ 1-Ôö¼Ó 2-ÐÞ¸Ä) public string Czybm; public Int64 HOrgID = -1; SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //´°Ìå¼ÓÔØ private void Xt_UserNew_Load(object sender, EventArgs e) { lblError.Text = ""; LbYes.Items.Clear(); LbNo.Items.Clear(); //¼ÓÔØ×éÖ¯ÐÅÏ¢ Sub_AddOrdList(); Init(); Display(); } //¼ÓÔØ×éÖ¯ÐÅÏ¢ private void Sub_AddOrdList() { DataSet ds; DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); ds = oClsGy_ORGANIZATIONS_View.GetList(); if (ds == null || ds.Tables[0].Rows.Count == 0) { MessageBox.Show("»ñÈ¡×é֯ʧ°Ü"); return; } cmbHOrgID.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { cmbHOrgID.Items.Add(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HName"])); } } //²éÕÒÊý¾Ý----Óû§×é private void Display() { if (InputMode == Pub_Class.ClsPub.Enum_InputMode.InputMode_AddNew) { try { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); DataSet oDs = new DataSet(); oDs = oCn.RunProcReturn("select GroupID,GroupName from System_UserGroup order by GroupName", "System_UserGroup", ref ClsPub.sExeReturnInfo); if (oDs == null) { MessageBox.Show("ÏÔʾʧ°Ü£¡Ô­Òò£º" + ClsPub.sExeReturnInfo); return; } // for (int i = 0; i <= oDs.Tables[0].Rows.Count - 1; i++) { LbNo.Items.Add(oDs.Tables[0].Rows[i][0].ToString().Trim() + "-" + oDs.Tables[0].Rows[i][1].ToString().Trim()); } } catch (Exception e) { MessageBox.Show(e.Message, "Ìáʾ"); return; } } else { try { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); DataSet oDs = new DataSet(); DataSet oDS = new DataSet(); //¼ÓÔØ²»Êô×é oDs = oCn.RunProcReturn("select GroupID,GroupName from System_UserGroup" +" where Groupid not IN (select Groupid from system_UserGroupInfo where userid='"+Czybm+"')", "System_UserGroup", ref ClsPub.sExeReturnInfo); if (oDs == null) { MessageBox.Show("ÏÔʾʧ°Ü£¡Ô­Òò£º" + ClsPub.sExeReturnInfo); return; } // if (oDs.Tables[0].Rows.Count != 0) { for (int i = 0; i <= oDs.Tables[0].Rows.Count - 1; i++) { LbNo.Items.Add(oDs.Tables[0].Rows[i][0].ToString().Trim() + "-" + oDs.Tables[0].Rows[i][1].ToString().Trim()); } } //¼ÓÔØÊôÓÚ×é oDS = oCn.RunProcReturn("select GroupID,GroupName from System_UserGroup" + " where Groupid IN (select Groupid from system_UserGroupInfo where userid='" + Czybm + "')", "System_UserGroup", ref ClsPub.sExeReturnInfo); if (oDS == null) { MessageBox.Show("ÏÔʾʧ°Ü£¡Ô­Òò£º" + ClsPub.sExeReturnInfo); return; } // if (oDS.Tables[0].Rows.Count != 0) { for (int i = 0; i <= oDS.Tables[0].Rows.Count - 1; i++) { LbYes.Items.Add(oDS.Tables[0].Rows[i][0].ToString().Trim() + "-" + oDS.Tables[0].Rows[i][1].ToString().Trim()); } } } catch (Exception e) { MessageBox.Show(e.Message, "Ìáʾ"); return; } } } //³õʼ»¯½çÃæ private void Init() { txtHK3UserID.ReadOnly = true; txtHKeeperID.ReadOnly = true; txtHSecManagerID.ReadOnly = true; txtHSellManID.ReadOnly = true; txtHDeptID.ReadOnly = true; txtHWhID.ReadOnly = true; txtHSCWH.ReadOnly = true; txtHSupID.ReadOnly = true; if (InputMode == Pub_Class.ClsPub.Enum_InputMode.InputMode_AddNew) { txtCzybm.Text = ""; txtCzymc.Text = ""; txtCzymm.Text = ""; txtCzyyz.Text = ""; txtExplain.Text = ""; txtHEmpID.Text = ""; txtHK3UserID.Text = ""; txtHKeeperID.Text = ""; txtHSecManagerID.Text = ""; txtHSellManID.Text = ""; txtHDeptID.Text = ""; txtHWhID.Text = ""; txtHSCWH.Text = ""; txtHSupID.Text = ""; txtHCloudUserName.Text = ""; txtHCloudUserPsd.Text = ""; cmdAllRight.PerformClick(); //»ñÈ¡µ±Ç°×éÖ¯ÐÅÏ¢ DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + ClsPub.HOrgID, "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo); if (Ds1.Tables[0].Rows.Count != 0) { cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]); } } else { txtCzybm.ReadOnly = true; txtCzymm.ReadOnly = true; txtCzyyz.ReadOnly = true; ShowData(Czybm); } } //¼ÓÔØ±íÍ· private void ShowData(string sCzybm) { DataSet oDs = new DataSet(); DAL.ClsIF_User_View oUser = new ClsIF_User_View(); DAL.ClsIF_Employee_View oEmp = new DAL.ClsIF_Employee_View(); DAL.ClsIF_ORGANIZATIONS_View oORG = new DAL.ClsIF_ORGANIZATIONS_View(); DAL.ClsIF_Department_View oDep = new DAL.ClsIF_Department_View(); DAL.ClsIF_Warehouse_View oWh = new DAL.ClsIF_Warehouse_View(); DAL.ClsIF_Supplier_View oSup = new DAL.ClsIF_Supplier_View(); try { oDs = oCn.RunProcReturn("select Czybm,Czymc,Explain,HEmpID,HK3UserID,HCloudUserName,HCloudUserPsd,HKeeperID,HKeeper,HSecManagerID,HSecManager,HSellManID,HSellMan,HDeptID,HDept,HWhID,HWHName,HSCWHID,HSCWHName,HSupID,HSupName,HUSEORGID from Gy_Czygl where Czybm='" + sCzybm + "'", "Gy_Czygl", ref ClsPub.sExeReturnInfo); if (oDs == null) { MessageBox.Show("ÏÔʾʧ°Ü£¡Ô­Òò£º" + ClsPub.sExeReturnInfo); return; } else if (oDs.Tables[0].Rows.Count != 0) { txtCzybm.Text = oDs.Tables[0].Rows[0]["Czybm"].ToString().Trim(); txtCzymc.Text = oDs.Tables[0].Rows[0]["Czymc"].ToString().Trim(); txtCzymm.Text = "*****"; txtCzyyz.Text = "*****"; txtExplain.Text = oDs.Tables[0].Rows[0]["Explain"].ToString().Trim(); if (oORG.GetInfoByID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HUSEORGID"]))) { cmbHOrgID.Text = ClsPub.isStrNull(oORG.omodel.HName); } else { cmbHOrgID.Text = ""; } if (oEmp.GetInfoByID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HEmpID"]))) { txtHEmpID.Text = ClsPub.isStrNull(oEmp.omodel.HName); txtHEmpID.Tag = ClsPub.isLong(oEmp.omodel.HItemID); } else { txtHEmpID.Text = ""; txtHEmpID.Tag = 0; } if (oUser.GetInfoByID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HK3UserID"]))) { txtHK3UserID.Text = ClsPub.isStrNull(oUser.omodel.HName); txtHK3UserID.Tag = ClsPub.isLong(oUser.omodel.HItemID); } else { txtHK3UserID.Text = ""; txtHK3UserID.Tag = 0; } if (oEmp.GetInfoByID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HKeeperID"]))) { txtHKeeperID.Text = ClsPub.isStrNull(oEmp.omodel.HName); txtHKeeperID.Tag = ClsPub.isLong(oEmp.omodel.HItemID); } else { txtHKeeperID.Text = ""; txtHKeeperID.Tag = 0; } if (oEmp.GetInfoByID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HSecManagerID"]))) { txtHSecManagerID.Text = ClsPub.isStrNull(oEmp.omodel.HName); txtHSecManagerID.Tag = ClsPub.isLong(oEmp.omodel.HItemID); } else { txtHSecManagerID.Text = ""; txtHSecManagerID.Tag = 0; } if (oEmp.GetInfoByID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HSellManID"]))) { txtHSellManID.Text = ClsPub.isStrNull(oEmp.omodel.HName); txtHSellManID.Tag = ClsPub.isLong(oEmp.omodel.HItemID); } else { txtHSellManID.Text = ""; txtHSellManID.Tag = 0; } if (oDep.GetInfoByIDandOrgID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HDeptID"]), ClsPub.isLong(oDs.Tables[0].Rows[0]["HUSEORGID"]))) { txtHDeptID.Text = ClsPub.isStrNull(oDep.omodel.HName); txtHDeptID.Tag = ClsPub.isLong(oDep.omodel.HItemID); } else { txtHDeptID.Text = ""; txtHDeptID.Tag = 0; } if (oWh.GetInfoByIDandOrgID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HWhID"]), ClsPub.isLong(oDs.Tables[0].Rows[0]["HUSEORGID"]))) { txtHWhID.Text = ClsPub.isStrNull(oWh.omodel.HName); txtHWhID.Tag = ClsPub.isLong(oWh.omodel.HItemID); } else { txtHWhID.Text = ""; txtHWhID.Tag = 0; } if (oWh.GetInfoByIDandOrgID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HSCWHID"]), ClsPub.isLong(oDs.Tables[0].Rows[0]["HUSEORGID"]))) { txtHSCWH.Text = ClsPub.isStrNull(oWh.omodel.HName); txtHSCWH.Tag = ClsPub.isLong(oWh.omodel.HItemID); } else { txtHSCWH.Text = ""; txtHSCWH.Tag = 0; } if (oSup.GetInfoByIDandOrgID(ClsPub.isLong(oDs.Tables[0].Rows[0]["HSupID"]), ClsPub.isLong(oDs.Tables[0].Rows[0]["HUSEORGID"]))) { txtHSupID.Text = ClsPub.isStrNull(oSup.omodel.HName); txtHSupID.Tag = ClsPub.isLong(oSup.omodel.HItemID); } else { txtHSupID.Text = ""; txtHSupID.Tag = 0; } txtHCloudUserName.Text = oDs.Tables[0].Rows[0]["HCloudUserName"].ToString().Trim(); txtHCloudUserPsd.Text = oDs.Tables[0].Rows[0]["HCloudUserPsd"].ToString().Trim(); } } catch (Exception e) { MessageBox.Show(e.Message, "Ìáʾ"); return; } } //È¡Ïû private void cmdCancel_Click(object sender, EventArgs e) { this.Close(); } //×óÒÆ private void cmdLeft_Click(object sender, EventArgs e) { if (this.LbNo.SelectedItems.Count > 0) { int i = this.LbNo.SelectedIndex; this.LbYes.Items.Add(this.LbNo.SelectedItem.ToString()); this.LbNo.Items.RemoveAt(i); } } //È«²¿×óÒÆ private void cmdAllLeft_Click(object sender, EventArgs e) { if (this.LbNo.Items.Count > 0) { for (int i = 0; i <= this.LbNo.Items.Count - 1; i++) { this.LbYes.Items.Add(this.LbNo.Items[i].ToString()); this.LbNo.Items.RemoveAt(i); i--; } } } //ÓÒÒÆ private void cmdRight_Click(object sender, EventArgs e) { if (this.LbYes.SelectedItems.Count > 0) { int i = this.LbYes.SelectedIndex; this.LbNo.Items.Add(this.LbYes.SelectedItem.ToString()); this.LbYes.Items.RemoveAt(i); } } //È«²¿ÓÒÒÆ private void cmdAllRight_Click(object sender, EventArgs e) { if (this.LbYes.Items.Count > 0) { for (int i = 0; i <= this.LbYes.Items.Count - 1; i++) { this.LbNo.Items.Add(this.LbYes.Items[i].ToString()); this.LbYes.Items.RemoveAt(i); i--; } } } //È·¶¨ private void cmdOK_Click(object sender, EventArgs e) { lblError.Text = ""; DataSet oDs = new DataSet(); if (!Sub_AllowSave()) //µ¥¾ÝÍêÕûÐÔÅÐ¶Ï { tabControl1.SelectedIndex = 0; return; } DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) { HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; } if (HOrgID == -1) { MessageBox.Show("Ñ¡Ôñ×éÖ¯ÓдíÎó£¡"); return; } if (InputMode == Pub_Class.ClsPub.Enum_InputMode.InputMode_AddNew) { oCn.RunProc("insert into Gy_Czygl (Czybm,Czymc,Czmm,Explain,HempID,HK3UserID " + ",HKeeperID,HKeeper,HSecManagerID,HSecManager " + ",HSellManID,HSellMan,HDeptID,HDept " + ",HWhID,HWHName,HSupID,HSupName " + ",HSCWHID,HSCWHName " + ",HCloudUserName,HCloudUserPsd,HUSEORGID)" + "values (" + "'" + txtCzybm.Text.ToString() + "','" + txtCzymc.Text.ToString() + "','" + ClsPub.StrToPsd(txtCzymm.Text.ToString()) + "','" + txtExplain.Text.ToString() + "'," + ClsPub.isLong(txtHEmpID.Tag).ToString() + "," + ClsPub.isLong(txtHK3UserID.Tag).ToString() + "," + ClsPub.isLong(txtHKeeperID.Tag).ToString() + ",'" + txtHKeeperID.Text.ToString() + "'," + ClsPub.isLong(txtHSecManagerID.Tag).ToString() + ",'" + txtHSecManagerID.Text.ToString() + "'" + "," + ClsPub.isLong(txtHSellManID.Tag).ToString() + ",'" + txtHSellManID.Text.ToString() + "'," + ClsPub.isLong(txtHDeptID.Tag).ToString() + ",'" + txtHDeptID.Text.ToString() + "'" + "," + ClsPub.isLong(txtHWhID.Tag).ToString() + ",'" + txtHWhID.Text.ToString() + "'," + ClsPub.isLong(txtHSupID.Tag).ToString() + ",'" + txtHSupID.Text.ToString() + "'" + "," + ClsPub.isLong(txtHSCWH.Tag).ToString() + ",'" + txtHSCWH.Text.ToString() + "'" + ",'" + txtHCloudUserName.Text.ToString() + "','" + txtHCloudUserPsd.Text.ToString() + "'," + HOrgID + ")"); oDs = oCn.RunProcReturn("Select * from Gy_Czygl where Czybm='" + txtCzybm.Text.ToString()+"'", "Gy_Czygl"); if (oDs == null || oDs.Tables[0].Rows.Count == 0) { MessageBox.Show("ÐÂÔöʧ°Ü£¡", "Ìáʾ"); } this.Czybm = oDs.Tables[0].Rows[0]["Czybm"].ToString(); oCn.RunProc("delete from System_UserGroupInfo where UserId='" + Czybm.ToString()+"'"); for (int i = 0; i <= LbYes.Items.Count - 1; i++) { oCn.RunProc("insert into System_UserGroupInfo (GroupId,UserId) values (" +ClsPub.isLong(Get_Code(this.LbYes.Items[i].ToString())) + ",'" + Czybm.ToString() + "')"); } lblError.Text = "* ÐÂÔö³É¹¦£¡"; Init(); tabControl1.SelectedIndex = 0; } else { oCn.RunProc("update Gy_Czygl set Czymc='" + txtCzymc.Text.ToString() + "'" + ",Explain='" + txtExplain.Text.ToString() + "'" + ",HEmpID=" + ClsPub.isLong(txtHEmpID.Tag).ToString() + ",HK3UserID=" + ClsPub.isLong(txtHK3UserID.Tag).ToString() + ",HKeeperID=" + ClsPub.isLong(txtHKeeperID.Tag).ToString() + ",HKeeper='" + txtHKeeperID.Text.ToString() + "'" + ",HSecManagerID=" + ClsPub.isLong(txtHSecManagerID.Tag).ToString() + ",HSecManager='" + txtHSecManagerID.Text.ToString() + "'" + ",HSellManID=" + ClsPub.isLong(txtHSellManID.Tag).ToString() + ",HSellMan='" + txtHSellManID.Text.ToString() + "'" + ",HDeptID=" + ClsPub.isLong(txtHDeptID.Tag).ToString() + ",HDept='" + txtHDeptID.Text.ToString() + "'" + ",HWhID=" + ClsPub.isLong(txtHWhID.Tag).ToString() + ",HWHName='" + txtHWhID.Text.ToString() + "'" + ",HSCWHID=" + ClsPub.isLong(txtHSCWH.Tag).ToString() + ",HSCWHName='" + txtHSCWH.Text.ToString() + "'" + ",HSupID=" + ClsPub.isLong(txtHSupID.Tag).ToString() + ",HSupName='" + txtHSupID.Text.ToString() + "'" + ",HCloudUserName='" + txtHCloudUserName.Text.ToString() + "'" + ",HCloudUserPsd='" + txtHCloudUserPsd.Text.ToString() + "'" + ",HUSEORGID=" + HOrgID.ToString() + "where Czybm='" + Czybm + "'"); // oCn.RunProc("delete from System_UserGroupInfo where UserId='" +Czybm+"'"); for (int i = 0; i <= LbYes.Items.Count - 1; i++) { oCn.RunProc("insert into System_UserGroupInfo (GroupId,UserId) values (" + ClsPub.isLong(Get_Code(this.LbYes.Items[i].ToString())) + ",'" + Czybm + "')"); } lblError.Text = "* Ð޸ijɹ¦£¡"; tabControl1.SelectedIndex = 0; } } //µ¥¾ÝÍêÕûÐÔÅÐ¶Ï private bool Sub_AllowSave() { if (txtCzybm.Text.Trim() == "") { lblError.Text = "* ±àÂë²»ÄÜΪ¿Õ£¡"; return false; } if (txtCzymc.Text.Trim() == "") { lblError.Text = "* Óû§Ãû²»ÄÜΪ¿Õ£¡"; return false; } // ÑéÖ¤ÃÜÂë if (txtCzymm.Text.Trim() != "") { if (txtCzymm.Text.Trim() != txtCzyyz.Text.Trim()) { lblError.Text = "* ÃÜÂëÑéÖ¤´íÎó£¡"; return false; } } // Óû§±àÂëºÍÓû§Ãû ÊÇ·ñÖØ¸´ if (InputMode == Pub_Class.ClsPub.Enum_InputMode.InputMode_AddNew) { DataSet oDs = new DataSet(); DataSet oDS = new DataSet(); oDs = oCn.RunProcReturn("select * from Gy_Czygl where Czybm='" + txtCzybm.Text.ToString()+"'", "Gy_Czygl"); oDS = oCn.RunProcReturn("select * from Gy_Czygl where Czymc='" + txtCzymc.Text.ToString() + "'", "Gy_Czygl"); if (oDs.Tables[0].Rows.Count != 0) { lblError.Text = "* ±àÂëÖØ¸´£¡"; return false; } if (oDS.Tables[0].Rows.Count != 0) { lblError.Text = "* Óû§ÃûÖØ¸´£¡"; return false; } } return true; } //²ð·Ö private string Get_Code(string sCode) { sCode = sCode.Trim(); char c = Convert.ToChar("-"); string[] s = sCode.Split(c); if (s.Length > 1) { return s[0].Trim(); } else { return "0"; } } //ÐÞ¸ÄÃÜÂë private void cmdPassWord_Click(object sender, EventArgs e) { Xt_Password oPassword = new Xt_Password(); oPassword.Czybm = this.Czybm; oPassword.ShowDialog(); } #region ¶ÔÓ¦»ù´¡×ÊÁÏÉèÖà //²éÕÒ½ÇÉ« public int i = 0; //ÐеÄÏÂ±ê¿ØÖÆÆ÷ (*****¿ØÖÆ´ÓµÚ¼¸ÐпªÊ¼±éÀú*****) public bool notNull = false; //µÝ¹é¿ØÖÆÆ÷ (*****¿ØÖÆÊÇ·ñ¿Éµ÷Óõݹé******) private void cmdHGroup_Click(object sender, EventArgs e) { string sFind = txtHGroup.Text.Trim(); string sGroup = ""; for (int a = i; a <= LbNo.Items.Count - 1; a++) { sGroup = this.LbNo.Items[a].ToString(); if (sGroup.IndexOf(sFind) != -1) { this.LbNo.SelectedIndex = a; i = a + 1; //ʹÏ´αéÀú´Ó¸ÃÐеÄÏÂÒ»ÐпªÊ¼²éÕÒ notNull = true; return; //ÉèÖÃnotNullÎªÕæ,Ìø³ö } } if (notNull) //ʼÖÕδÕÒµ½Æ¥ÅäÏîÔò½øÈë { i = 0; //ÖØÖôӵÚÒ»ÐбéÀú notNull = false; //ÉèÖÃnotNullΪ¼Ù,Èç¹ûÔÙÒ»´Î´ÓµÚÒ»ÐбéÀúδÕÒµ½Æ¥ÅäÏîÔò²»»áÔÙ½øÈëIFµ÷Óõݹé cmdHGroup_Click(sender, e); //µÝ¹é } else { MessageBox.Show("δÕÒµ½£¡£¡"); } } private void cmdHEmpID_Click(object sender, EventArgs e) { BLL.ClsBaseSelect_InterFace.SetTextByEmp(txtHEmpID); } private void txtHEmpID_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHEmpID); } private void cmdHK3UserID_Click(object sender, EventArgs e) { ClsIF_User_View oUser = new ClsIF_User_View(); if (oUser.RefreshView()) { txtHK3UserID.Tag = ClsPub.isLong(oUser.oModel.HItemID); txtHK3UserID.Text = ClsPub.isStrNull(oUser.oModel.HName); } else { txtHK3UserID.Text = ""; } } private void txtHK3UserID_TextChanged(object sender, EventArgs e) { if (txtHK3UserID.Text.Trim() == "") { txtHK3UserID.Tag = "0"; } } private void cmdHKeeperID_Click(object sender, EventArgs e) { BLL.ClsBaseSelect_InterFace.SetTextByEmp(txtHKeeperID); } private void txtHKeeperID_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHKeeperID); } private void cmdHSecManagerID_Click(object sender, EventArgs e) { BLL.ClsBaseSelect_InterFace.SetTextByEmp(txtHSecManagerID); } private void txtHSecManagerID_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHSecManagerID); } private void cmdHSellManID_Click(object sender, EventArgs e) { BLL.ClsBaseSelect_InterFace.SetTextByEmp(txtHSellManID); } private void txtHSellManID_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHSellManID); } private void cmdHDeptID_Click(object sender, EventArgs e) { DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) { HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; } if (HOrgID == -1) { MessageBox.Show("Ñ¡Ôñ×éÖ¯ÓдíÎó£¡"); return; } string DeWhere = ""; DeWhere = " and HUSEORGID = " + HOrgID; BLL.ClsBaseSelect_InterFace.SetTextByDept(txtHDeptID, DeWhere); } private void txtHDeptID_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHDeptID); } private void cmdHWhID_Click(object sender, EventArgs e) { DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) { HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; } if (HOrgID == -1) { MessageBox.Show("Ñ¡Ôñ×éÖ¯ÓдíÎó£¡"); return; } string DeWhere = ""; DeWhere = " and HUSEORGID = " + HOrgID; BLL.ClsBaseSelect_InterFace.SetTextByWarehouse(txtHWhID, DeWhere); if (txtHWhID.Tag.ToString() == txtHSCWH.Tag.ToString()) { MessageBox.Show("¶ÔÓ¦²Ö¿â²»ÄÜÓëµ÷Èë²Ö¿âÏàͬ£¡"); this.txtHWhID.Text = ""; return; } } private void txtHWhID_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHWhID); } //µ÷Èë²Ö¿â private void cmdHSCWH_Click(object sender, EventArgs e) { DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) { HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; } if (HOrgID == -1) { MessageBox.Show("Ñ¡Ôñ×éÖ¯ÓдíÎó£¡"); return; } string DeWhere = ""; DeWhere = " and HUSEORGID = " + HOrgID; BLL.ClsBaseSelect_InterFace.SetTextByWarehouse(txtHSCWH, DeWhere); if (txtHSCWH.Tag.ToString() == txtHWhID.Tag.ToString()) { MessageBox.Show("µ÷Èë²Ö¿â²»ÄÜÓë¶ÔÓ¦²Ö¿âÏàͬ£¡"); this.txtHSCWH.Text = ""; return; } } private void txtHSCWH_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHSCWH); } private void cmdHSupID_Click(object sender, EventArgs e) { DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) { HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; } if (HOrgID == -1) { MessageBox.Show("Ñ¡Ôñ×éÖ¯ÓдíÎó£¡"); return; } string DeWhere = ""; DeWhere = " and HUSEORGID = " + HOrgID; BLL.ClsBaseSelect_InterFace.SetTextBySupplier(txtHSupID, DeWhere); } private void txtHSupID_TextChanged(object sender, EventArgs e) { BLL.ClsPub_BLL.Sub_ClearText(txtHSupID); } #endregion } }