void client_GetDepartmentAllCompleted(object sender, GetDepartmentAllCompletedEventArgs e) { if (e.Error != null && e.Error.Message != "") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } else { if (e.Result == null) { return; } ObservableCollection <T_HR_DEPARTMENT> entTemps = e.Result; allDepartments = new List <T_HR_DEPARTMENT>(); allDepartments.Clear(); var ents = entTemps.OrderBy(c => c.FATHERID); ents.ForEach(item => { allDepartments.Add(item); }); UICache.CreateCache("ORGTREESYSDepartmentInfoALL", allDepartments); // BindDepartment(); BindCompany(); client.GetPostAllAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); } }
void organClient_GetDepartmentAllCompleted(object sender, GetDepartmentAllCompletedEventArgs e) { if (e.Error == null) { if (e.Result != null) { App.Current.Resources.Add("SYS_DepartmentInfo", e.Result.ToList()); //organClient.GetPostAllAsync(""); } } }
void organClient_GetDepartmentAllCompleted(object sender, GetDepartmentAllCompletedEventArgs e) { if (e.Error == null) { if (e.Result != null) { App.Current.Resources.Add("SYS_DepartmentInfo", e.Result.ToList()); //organClient.GetPostAllAsync(""); } } }
void client_GetDepartmentAllCompleted(object sender, GetDepartmentAllCompletedEventArgs e) { if (e.Error != null && e.Error.Message != "") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } else { if (e.Result == null) { return; } ObservableCollection<T_HR_DEPARTMENT> entTemps = e.Result; allDepartments = new List<T_HR_DEPARTMENT>(); allDepartments.Clear(); var ents = entTemps.OrderBy(c => c.FATHERID); ents.ForEach(item => { allDepartments.Add(item); }); UICache.CreateCache("ORGTREESYSDepartmentInfoALL", allDepartments); // BindDepartment(); BindCompany(); client.GetPostAllAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); } }
/// <summary> /// 获取所有部门 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void client_GetDepartmentAllCompleted(object sender, GetDepartmentAllCompletedEventArgs e) { //if (e.Error != null && string.IsNullOrEmpty(e.Error.Message)) //{ // ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), // Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); //} //else //{ // if (lkCompany.DataContext != null || Post != null) // { // T_HR_COMPANY ent = null; // if (Post.T_HR_DEPARTMENT != null) // { // ent = Post.T_HR_DEPARTMENT.T_HR_COMPANY; // } // else // { // ent = lkCompany.DataContext as T_HR_COMPANY; // } // if (e.UserState.ToString() == "SetCompany") // { // ent = lkCompany.DataContext as T_HR_COMPANY; // } // if (e.Result != null) // { // string checkState = Convert.ToInt32(CheckStates.Approved).ToString(); // string editState = Convert.ToInt32(EditStates.Actived).ToString(); // System.Collections.ObjectModel.ObservableCollection<T_HR_DEPARTMENT> tempList = e.Result; // var entity = tempList.Where(s => s.T_HR_COMPANY.COMPANYID == ent.COMPANYID && s.CHECKSTATE == checkState && s.EDITSTATE == editState); // entity = entity.Count() > 0 ? entity.ToList() : null; // cbxDepartment.ItemsSource = entity; // cbxDepartment.DisplayMemberPath = "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME"; // if (e.UserState.ToString() == "SetCompany") // { // return; // } // if (Post.T_HR_DEPARTMENT != null) // { // foreach (var item in cbxDepartment.Items) // { // T_HR_DEPARTMENT dict = item as T_HR_DEPARTMENT; // if (dict != null) // { // if (dict.DEPARTMENTID == Post.T_HR_DEPARTMENT.DEPARTMENTID) // { // cbxDepartment.SelectedItem = item; // break; // } // } // } // } // } // } //} }