private void btnSex_Click(object sender, EventArgs e) { PopList1.Groups.Clear(); DataTable table = new DataTable(); PopListGroup poli = new PopListGroup(); PopList1.Groups.Add(poli); poli.Text = "性别"; table.Columns.Add("sex", typeof(System.Int32)); table.Columns.Add("sexDesc", typeof(System.String)); table.Rows.Add(0, "男"); table.Rows.Add(1, "女"); foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["sexDesc"].ToString(), rowli["sex"].ToString()); if (sex.ToString().Length > 0) { if (sex.Equals(rowli["sex"])) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } PopList1.Show(); }
//获取审批人或抄送人 private void BtnCUser_Click(object sender, EventArgs e) { //获取审批人或抄送人 btn = sender; //获取数据 LeaveInfo Leave = new LeaveInfo(); DataTable table = Leave.GetConfirmUser(); PopList1.Groups.Clear(); PopListGroup poli = new PopListGroup(); PopList1.Groups.Add(poli); switch (((Button)sender).Name) { case "btnCUser": case "BtnCUser2": PopList1.MultiSelect = false; poli.Text = "审批人"; break; case "Btnccuser2": case "btnccuser1": PopList1.MultiSelect = true; poli.Text = "抄送人"; break; } //显示选择列表中key和values foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["USER_ID"].ToString(), rowli["USER_ID"].ToString()); switch (((Button)sender).Name) { case "btnCUser": case "BtnCUser2": if (CUser.Trim().Length > 0) { if (CUser.Trim().ToUpper() == rowli["USER_ID"].ToString().Trim().ToUpper()) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } break; case "Btnccuser2": case "btnccuser1": if (CCUser.Trim().Length > 0) { if (CCUser.Trim().ToUpper() == rowli["USER_ID"].ToString().Trim().ToUpper()) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } break; } } PopList1.Show(); }
private void btnpop_Click(object sender, EventArgs e) { try { btnName = sender; COMSSmobilerDemo.common.NBRecordInfo NBRecordInfo = new COMSSmobilerDemo.common.NBRecordInfo(); COMSSmobilerDemo.common.NBInfo NBInfo = new COMSSmobilerDemo.common.NBInfo(); DataTable table = new DataTable(); PopList1.Groups.Clear(); PopListGroup poli = new PopListGroup(); PopList1.Groups.Add(poli); switch (((Button)btnName).Name) { case "btnCODE2": table = NBInfo.GetNootBooksData(0, 3); poli.Text = "笔记本序列号选择"; foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["NB_EQNO"].ToString(), rowli["NB_EQNO"].ToString()); if (string.IsNullOrWhiteSpace(NB_EQNO) == false) { if (NB_EQNO.Equals(rowli["NB_EQNO"].ToString())) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } break; case "btnUser": case "btnUser2": table = NBRecordInfo.GetUserData(); poli.Text = "用户选择"; foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["USER_NAME"].ToString(), rowli["USER_ID"].ToString()); if (string.IsNullOrWhiteSpace(User) == false) { if (User.Trim().ToUpper() == rowli["USER_ID"].ToString().Trim().ToUpper()) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } break; case "btnType": case "btnType2": table = NBRecordInfo.StateData(); poli.Text = "操作类型选择"; foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["StateName"].ToString(), rowli["State"].ToString()); if (Type.ToString().Length > 0) { if (Type.Equals(rowli["State"])) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } break; case "btnNBR_LOCATION": case "btnNBR_LOCATION2": table = NBInfo.AddressData(); poli.Text = "所在位置"; foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["Address"].ToString(), rowli["ID"].ToString()); if (btnNBR_LOCATION.Text.Trim().Length > 0) { if (btnNBR_LOCATION.Text.Equals(rowli["Address"])) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } break; } PopList1.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// ÏÂÀÑ¡Ôñ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <remarks></remarks> private void btnpop_Click(object sender, EventArgs e) { try { btnName = sender; PopList1.Groups.Clear(); PopListGroup poli = new PopListGroup(); PopList1.Groups.Add(poli); COMSSmobilerDemo.common.BookLogInfo BookLogInfo = new COMSSmobilerDemo.common.BookLogInfo(); COMSSmobilerDemo.common.BookSNInfo BookSNInfo = new COMSSmobilerDemo.common.BookSNInfo(); DataTable table = new DataTable(); switch (((Button)btnName).Name) { case "btnBOOKSN2": table = BookSNInfo.GetBookSNbyBookID(); poli.Text = "ͼÊéÐòºÅÑ¡Ôñ"; foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["BOOKSNID"].ToString(), rowli["BOOKSNID"].ToString()); if (txtBOOKSNID.Text.Trim().Length > 0) { if (txtBOOKSNID.Text.Trim().Equals(rowli["BOOKSNID"])) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } break; case "btnState": case "btnState2": table = BookLogInfo.StateData(); poli.Text = "״̬ѡÔñ"; foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["StateName"].ToString(), rowli["State"].ToString()); if (state.ToString().Length > 0) { if (state.Equals(rowli["State"])) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } break; case "btnBORROWER2": table = BookLogInfo.GetUserData(); poli.Text = "Óû§Ñ¡Ôñ"; foreach (DataRow rowli in table.Rows) { poli.Items.Add(rowli["USER_NAME"].ToString(), rowli["USER_ID"].ToString()); if (string.IsNullOrWhiteSpace(txtBORROWER.Text) == false) { if (txtBORROWER.Text.Trim().ToUpper() == rowli["USER_ID"].ToString().Trim().ToUpper()) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } } break; } switch (((Button)btnName).Name) { case "btnState": case "btnState2": PopList1.ShowDialog(); break; default: PopList1.Show(); break; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 客户,处理结果,审批人选择 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnpop_Click(object sender, EventArgs e) { try { PopList1.Groups.Clear(); //获取审批人 btnmode = sender; OperationalInfo OperationalR = new OperationalInfo(); DataTable table = new DataTable(); PopListGroup poli = new PopListGroup(); PopList1.Groups.Add(poli); switch (((Button)sender).Name) { case "btnCU": case "btnCU2": poli.Text = "客户选择"; table = OperationalR.GetCUData(); break; case "btnOR_PROCESSRESULT": case "btnOR_PROCESSRESULT2": poli.Text = "处理方式选择"; table = OperationalR.GetProcessResultData(); break; case "btnOR_MAINTAINER": case "btnOR_MAINTAINER2": poli.Text = "维护人员选择"; table = OperationalR.GetUserData(); break; } foreach (DataRow rowli in table.Rows) { switch (((Button)sender).Name) { case "btnCU": case "btnCU2": poli.Items.Add(rowli["CUST_NAME"].ToString(), rowli["CUST_ID"].ToString()); if (CUST_ID.Trim().Length > 0) { if (CUST_ID.Trim().Equals(rowli["CUST_ID"].ToString().Trim())) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } break; case "btnOR_PROCESSRESULT": case "btnOR_PROCESSRESULT2": poli.Items.Add(rowli["ProcessResultStateName"].ToString(), rowli["ProcessResultState"].ToString()); if (OR_PROCESSRESULT.Trim().Length > 0) { if (OR_PROCESSRESULT.Trim().Equals(rowli["ProcessResultState"].ToString().Trim())) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } break; case "btnOR_MAINTAINER": case "btnOR_MAINTAINER2": poli.Items.Add(rowli["USER_ID"].ToString(), rowli["USER_ID"].ToString()); if (OR_MAINTAINER.Trim().Length > 0) { if (OR_MAINTAINER.Trim().ToUpper().Equals(rowli["USER_ID"].ToString().Trim().ToUpper())) { PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]); } } break; } } switch (((Button)sender).Name) { case "btnCU": case "btnCU2": case "btnOR_MAINTAINER": case "btnOR_MAINTAINER2": PopList1.Show(); poli.Text = "客户选择"; table = OperationalR.GetCUData(); break; case "btnOR_PROCESSRESULT": case "btnOR_PROCESSRESULT2": PopList1.ShowDialog(); break; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }