/// <summary> /// 获取部门字典 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void client_GetDepartmentDictionaryAllCompleted(object sender, GetDepartmentDictionaryAllCompletedEventArgs e) { if (e.Error != null && e.Error.Message != "") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } else { 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 + ")"; } } //ComboBox数据源 //cbxDepName.ItemsSource = entity; //cbxDepName.DisplayMemberPath = "DEPARTMENTNAME"; //AutoCompleteBox数据源 acbDepName.ItemsSource = entity; acbDepName.ValueMemberPath = "DEPARTMENTNAME"; if (PostDictionary.T_HR_DEPARTMENTDICTIONARY != null) { foreach (var dep in acbDepName.ItemsSource) { T_HR_DEPARTMENTDICTIONARY ent = dep as T_HR_DEPARTMENTDICTIONARY; if (ent.DEPARTMENTDICTIONARYID == PostDictionary.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID) { //cbxDepName.SelectedItem = dep; acbDepName.SelectedItem = dep; break; } } } } RefreshUI(RefreshedTypes.HideProgressBar); }
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"; } }
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"; } }
void client_GetDepartmentDictionaryAllCompleted(object sender, GetDepartmentDictionaryAllCompletedEventArgs e) { cbxDepartMent.ItemsSource = e.Result; cbxDepartMent.DisplayMemberPath = "DEPARTMENTNAME"; if (Department.T_HR_DEPARTMENTDICTIONARY != null) { foreach (var item in cbxDepartMent.Items) { T_HR_DEPARTMENTDICTIONARY dict = item as T_HR_DEPARTMENTDICTIONARY; if (dict != null) { if (dict.DEPARTMENTDICTIONARYID == Department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID) { cbxDepartMent.SelectedItem = item; txtDepartmentCode.Text = dict.DEPARTMENTCODE; break; } } } } }
void client_GetDepartmentDictionaryAllCompleted(object sender, GetDepartmentDictionaryAllCompletedEventArgs e) { cbxDepartMent.ItemsSource = e.Result; cbxDepartMent.DisplayMemberPath = "DEPARTMENTNAME"; if (Department.T_HR_DEPARTMENTDICTIONARY != null) { foreach (var item in cbxDepartMent.Items) { T_HR_DEPARTMENTDICTIONARY dict = item as T_HR_DEPARTMENTDICTIONARY; if (dict != null) { if (dict.DEPARTMENTDICTIONARYID == Department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID) { cbxDepartMent.SelectedItem = item; txtDepartmentCode.Text = dict.DEPARTMENTCODE; break; } } } } }
void client_GetDepartmentDictionaryAllCompleted(object sender, GetDepartmentDictionaryAllCompletedEventArgs e) { if (Department.T_HR_COMPANY != null || Department != null) { //判断状态是否为修改 T_HR_COMPANY ent = Department.T_HR_COMPANY; tempList = e.Result; var entity = tempList.Where(s => s.DEPARTMENTTYPE == "-1" || s.DEPARTMENTTYPE == ent.COMPANYTYPE); entity = entity.Count() > 0 ? entity.ToList() : null; 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.OWNERPOSTID = diction.DEPARTMENTNAME;//暂存部门名称 diction.DEPARTMENTNAME = diction.DEPARTMENTNAME + "(" + tmp.DICTIONARYNAME + ")"; } } //cbxDepartMent.ItemsSource = entity; //cbxDepartMent.DisplayMemberPath = "DEPARTMENTNAME"; acbDepName.ItemsSource = entity; acbDepName.ValueMemberPath = "DEPARTMENTNAME"; string deptName = string.Empty; if (Department.T_HR_DEPARTMENTDICTIONARY != null) { foreach (var item in acbDepName.ItemsSource) { T_HR_DEPARTMENTDICTIONARY dict = item as T_HR_DEPARTMENTDICTIONARY; if (dict != null) { if (dict.DEPARTMENTDICTIONARYID == Department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID) { //cbxDepartMent.SelectedItem = item; acbDepName.SelectedItem = item; deptName = dict.DEPARTMENTNAME; break; } } } } acbDepName.IsEnabled = true; //acbDepName.ToggleButton.IsEnabled = false; //acbDepName.TxtLookUp.IsReadOnly = true; ToolTipService.SetToolTip(this.acbDepName.TxtLookUp, deptName); } }
/// <summary> /// 获取部门字典 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void client_GetDepartmentDictionaryAllCompleted(object sender, GetDepartmentDictionaryAllCompletedEventArgs e) { if (e.Error != null && e.Error.Message != "") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } else { 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 + ")"; } } //ComboBox数据源 //cbxDepName.ItemsSource = entity; //cbxDepName.DisplayMemberPath = "DEPARTMENTNAME"; //AutoCompleteBox数据源 acbDepName.ItemsSource = entity; acbDepName.ValueMemberPath = "DEPARTMENTNAME"; if (PostDictionary.T_HR_DEPARTMENTDICTIONARY != null) { foreach (var dep in acbDepName.ItemsSource) { T_HR_DEPARTMENTDICTIONARY ent = dep as T_HR_DEPARTMENTDICTIONARY; if (ent.DEPARTMENTDICTIONARYID == PostDictionary.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID) { //cbxDepName.SelectedItem = dep; acbDepName.SelectedItem = dep; break; } } } } RefreshUI(RefreshedTypes.HideProgressBar); }