void client_GetCompanyActivedCompleted(object sender, GetCompanyActivedCompletedEventArgs e) { ObservableCollection <T_HR_COMPANY> cmp = new ObservableCollection <T_HR_COMPANY>(); if (e.Error != null && e.Error.Message != "") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } else { // ComboBox cbxCompanyName = Utility.FindChildControl<ComboBox>(expander, "cbxCompanyName"); AutoCompleteComboBox acbCompanyName = Utility.FindChildControl <AutoCompleteComboBox>(expander, "acbCompanyName"); cmp = e.Result; T_HR_COMPANY all = new T_HR_COMPANY(); all.COMPANYID = "companyID"; all.CNAME = Utility.GetResourceStr("ALL"); if (cmp != null) { cmp.Insert(0, all); } acbCompanyName.ItemsSource = cmp; acbCompanyName.ValueMemberPath = "CNAME"; } }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); TextBox txtPostCode = Utility.FindChildControl <TextBox>(expander, "txtPostCode"); if (txtPostCode != null) { if (!string.IsNullOrEmpty(txtPostCode.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } //filter += "POSTCODE==@" + paras.Count().ToString(); filter += " @" + paras.Count().ToString() + ".Contains(POSTCODE)"; paras.Add(txtPostCode.Text.Trim()); } } TextBox txtPostName = Utility.FindChildControl <TextBox>(expander, "txtPostName"); if (txtPostName != null) { if (!string.IsNullOrEmpty(txtPostName.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += " @" + paras.Count().ToString() + ".Contains(POSTNAME)"; paras.Add(txtPostName.Text.Trim()); } } //ComboBox cbxDepName = Utility.FindChildControl<ComboBox>(expander, "cbxDepName"); AutoCompleteComboBox acbDepName = Utility.FindChildControl <AutoCompleteComboBox>(expander, "acbDepName"); if (acbDepName != null) { if (acbDepName.SelectedItem != null) { T_HR_DEPARTMENTDICTIONARY ent = acbDepName.SelectedItem as T_HR_DEPARTMENTDICTIONARY; if (!string.IsNullOrEmpty(ent.DEPARTMENTDICTIONARYID)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID==@" + paras.Count().ToString(); paras.Add(ent.DEPARTMENTDICTIONARYID); } } } client.PostDictionaryPagingAsync(dataPager.PageIndex, dataPager.PageSize, "POSTCODE", filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, Checkstate); }
//overrides the OnLoad function which is basically called when the ComboHolder is called protected override void OnLoad(EventArgs e) { //having the OnLoad of the base function copied base.OnLoad(e); AutoCompleteComboBox combo = new AutoCompleteComboBox(); combo.Location = new Point(10, 10); //setting the combo box as a control for the form this.Controls.Add(combo); //adds item to the combo box combo.Items.Add("word"); combo.Items.Add("world"); combo.Items.Add("wording"); combo.Items.Add("worse"); }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; string strState = ""; System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); if (Checkstate != Convert.ToInt32(CheckStates.All).ToString()) { strState = Checkstate; } //ComboBox cbxCompanyName = Utility.FindChildControl<ComboBox>(expander, "cbxCompanyName"); AutoCompleteComboBox acbCompanyName = Utility.FindChildControl <AutoCompleteComboBox>(expander, "acbCompanyName"); TextBox txtEmpName = Utility.FindChildControl <TextBox>(expander, "txtEmpName"); if (acbCompanyName != null) { if (acbCompanyName.SelectedItem != null) { T_HR_COMPANY ent = acbCompanyName.SelectedItem as T_HR_COMPANY; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "T_HR_COMPANY.CNAME==@" + paras.Count().ToString(); paras.Add(ent.CNAME); } } if (txtEmpName != null) { if (!string.IsNullOrEmpty(txtEmpName.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } // filter += "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME.Contains(@" + paras.Count().ToString()+")"; filter += " @" + paras.Count().ToString() + ".Contains(T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME)"; paras.Add(txtEmpName.Text.Trim()); } } client.DepartmentPagingAsync(dataPager.PageIndex, dataPager.PageSize, "SORTINDEX", filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strState); }
void client_GetDepartmentDictionaryAllCompleted(object sender, GetDepartmentDictionaryAllCompletedEventArgs e) { ObservableCollection <T_HR_DEPARTMENTDICTIONARY> dtmp = new ObservableCollection <T_HR_DEPARTMENTDICTIONARY>(); if (e.Error != null && e.Error.Message != "") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } else { //ComboBox cbxDepName = Utility.FindChildControl<ComboBox>(expander, "cbxDepName"); AutoCompleteComboBox acbDepName = Utility.FindChildControl <AutoCompleteComboBox>(expander, "acbDepName"); if (e.Result != null) { dtmp = e.Result; T_HR_DEPARTMENTDICTIONARY all = new T_HR_DEPARTMENTDICTIONARY(); all.DEPARTMENTDICTIONARYID = "dictionaryID"; all.DEPARTMENTNAME = Utility.GetResourceStr("ALL"); dtmp.Insert(0, all); } var entity = from ent in e.Result orderby ent.DEPARTMENTNAME select ent; List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY> dicts = Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>; dicts = dicts.Where(s => s.DICTIONCATEGORY == "COMPANYTYPE").OrderBy(s => s.DICTIONARYVALUE).ToList(); foreach (T_HR_DEPARTMENTDICTIONARY diction in entity) { decimal dptype = Convert.ToDecimal(diction.DEPARTMENTTYPE); var tmp = dicts.Where(s => s.DICTIONARYVALUE == dptype).FirstOrDefault(); if (tmp != null) { diction.DEPARTMENTNAME = diction.DEPARTMENTNAME + "(" + tmp.DICTIONARYNAME + ")"; } } acbDepName.ItemsSource = entity; acbDepName.ValueMemberPath = "DEPARTMENTNAME"; } }