void btnDelete_Click(object sender, RoutedEventArgs e) { agentsetId = new ObservableCollection <string>(); if (DaGr.SelectedItems.Count > 0) { for (int i = 0; i < DaGr.SelectedItems.Count; i++) { T_OA_AGENTSET ent = DaGr.SelectedItems[i] as T_OA_AGENTSET; agentsetId.Add((DaGr.SelectedItems[i] as T_OA_AGENTSET).AGENTSETID); string Result = ""; ComfirmWindow com = new ComfirmWindow(); com.OnSelectionBoxClosed += (obj, result) => { SoaChannel.DeleteAgentSetAsync(agentsetId); LoadData(); }; com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result); } } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON")); } }
private void InitData() { if (actions == FormTypes.New) { AgentSetInfo = new T_OA_AGENTSET(); //this.cbSYSTEMTYPE.SelectedIndex = 0; client.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID);//获取当期用户信息 } else { if (string.IsNullOrEmpty(AgentSetID)) { this.DataContext = AgentSetInfo; } else { SoaChannel.GetAgentSetBysIdAsync(AgentSetID); } } if (actions == FormTypes.Browse) { this.cbSYSTEMTYPE.IsEnabled = false; this.txtEMPLOYEENAME.IsEnabled = false; } }
void btnEdit_Click(object sender, RoutedEventArgs e) { string strLeaveTypeSetID = string.Empty; if (DaGr.SelectedItems == null) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT")); return; } if (DaGr.SelectedItems.Count == 0) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT")); return; } T_OA_AGENTSET ent = DaGr.SelectedItems[0] as T_OA_AGENTSET; ProxySettingsForm AddWin = new ProxySettingsForm(FormTypes.Edit, ent.AGENTSETID); EntityBrowser browser = new EntityBrowser(AddWin); browser.FormType = FormTypes.Edit; browser.MinWidth = 600; browser.MinHeight = 180; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); }
void BtnView_Click(object sender, RoutedEventArgs e) { if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } T_OA_AGENTSET ent = DaGr.SelectedItems[0] as T_OA_AGENTSET; ProxySettingsForm AddWin = new ProxySettingsForm(FormTypes.Browse, ent.AGENTSETID); EntityBrowser browser = new EntityBrowser(AddWin); browser.FormType = FormTypes.Browse; browser.MinWidth = 500; browser.MinHeight = 300; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); }
public T_OA_AGENTSET GetAgentSetBysId(string AgentSetId) { using (ProxySettingsBLL psbll = new ProxySettingsBLL()) { T_OA_AGENTSET AgentSetById = psbll.GetAgentSetBysId(AgentSetId); return(AgentSetById == null ? null : AgentSetById); } }
void SoaChannel_GetAgentSetBysIdCompleted(object sender, GetAgentSetBysIdCompletedEventArgs e) { try { if (e.Error == null) { if (e.Result != null) { AgentSetInfo = e.Result; this.DataContext = AgentSetInfo; if (!string.IsNullOrEmpty(AgentSetInfo.SYSCODE.ToString()))//系统代码 { foreach (T_SYS_DICTIONARY Region in cbSYSTEMTYPE.Items) { if (Region.DICTIONARYVALUE == int.Parse(AgentSetInfo.SYSCODE)) { cbSYSTEMTYPE.SelectedItem = Region; break; } } } //if (!string.IsNullOrEmpty(AgentSetInfo.MODELCODE.ToString()))//模块代码 //{ // foreach (SMT.Saas.Tools.FlowDesignerWS.FLOW_MODELDEFINE_T Region in cbModelCode.Items) // { // if (Region.MODELCODE == AgentSetInfo.MODELCODE) // { // ModelDefineList.Add(Region); // cbModelCode.SelectedItem = Region; // break; // } // } //} FlowDesigner.GetModelNameInfosComboxAsync(); //T_OA_AGENTSET PARENTMODELCODE = cbModelCode.ItemsSource.Cast<T_OA_AGENTSET>().Where(a => a.MODELCODE == MODELDEFINE.MODELCODE).ToList().First(); //cbModelCode.SelectedItem = PARENTMODELCODE; txtPostId.Text = Utility.GetPostName(AgentSetInfo.AGENTPOSTID);//岗位ID txtCompanyId.Text = Utility.GetCompanyName(AgentSetInfo.OWNERCOMPANYID); txtDepartmentId.Text = Utility.GetDepartmentName(AgentSetInfo.OWNERDEPARTMENTID); Party.Add(AgentSetInfo.USERID); client.GetEmployeeByIDsAsync(Party); } } else { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString()); } }
[OperationContract]//更新代理设置 public string UpdateAgentSet(T_OA_AGENTSET AgentSet) { using (ProxySettingsBLL psbll = new ProxySettingsBLL()) { string returnStr = ""; if (!psbll.UpdateAgentSet(AgentSet)) { returnStr = "更新数据失败!"; } return returnStr; } }
[OperationContract]//更新代理设置 public string UpdateAgentSet(T_OA_AGENTSET AgentSet) { using (ProxySettingsBLL psbll = new ProxySettingsBLL()) { string returnStr = ""; if (!psbll.UpdateAgentSet(AgentSet)) { returnStr = "更新数据失败!"; } return(returnStr); } }
[OperationContract]//添加代理设置信息 public string AgentSetAdd(T_OA_AGENTSET AgentSet) { using (ProxySettingsBLL psbll = new ProxySettingsBLL()) { string returnStr = ""; if (!psbll.IsExistAgentSet(AgentSet.SYSCODE, AgentSet.MODELCODE)) { if (!psbll.AgentSetAdd(AgentSet)) { returnStr = "添加数据失败"; } } else { returnStr = "该代理设置已经存在,添加数据失败"; } return returnStr; } }
[OperationContract]//添加代理设置信息 public string AgentSetAdd(T_OA_AGENTSET AgentSet) { using (ProxySettingsBLL psbll = new ProxySettingsBLL()) { string returnStr = ""; if (!psbll.IsExistAgentSet(AgentSet.SYSCODE, AgentSet.MODELCODE)) { if (!psbll.AgentSetAdd(AgentSet)) { returnStr = "添加数据失败"; } } else { returnStr = "该代理设置已经存在,添加数据失败"; } return(returnStr); } }
public T_HR_EMPLOYEE GetQueryAgent(string UserId, string ModCode) { ProxySettingsBLL psbll = new ProxySettingsBLL(); PersonnelServiceClient psc = new PersonnelServiceClient(); if (psbll.IsExistAGENTForUser(UserId)) { T_OA_AGENTSET AgentList = psbll.GetQueryAgent(UserId, ModCode); T_HR_EMPLOYEE employee = null; if (AgentList != null) { T_HR_EMPLOYEEPOST[] tmps = psc.GetEmployeePostByPostID(AgentList.AGENTPOSTID); if (tmps != null && tmps.Count() > 0) { employee = tmps[0].T_HR_EMPLOYEE; } else { T_HR_EMPLOYEE[] tmp = psc.GetEmployeeLeader(UserId, 0); if (tmp != null && tmp.Count() > 0) { employee = tmp[0];//返回该岗位员工的直接上级 } } } else { T_HR_EMPLOYEE[] tmp = psc.GetEmployeeLeader(UserId, 0); if (tmp != null && tmp.Count() > 0) { employee = tmp[0];//返回该岗位员工的直接上级 } } return(employee); } return(null); }