private void InitParas(string menuID) { ServiceClient = new PermissionServiceClient(); //ServiceClient.SysMenuAddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_SysMenuAddCompleted); ServiceClient.SysMenuAddCompleted += new EventHandler <SysMenuAddCompletedEventArgs>(ServiceClient_SysMenuAddCompleted); ServiceClient.SysMenuUpdateCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_SysMenuUpdateCompleted); //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); ServiceClient.GetSysMenuByIDCompleted += new EventHandler <GetSysMenuByIDCompletedEventArgs>(ServiceClient_GetSysMenuByIDCompleted); ServiceClient.GetSysDictionaryByCategoryCompleted += new EventHandler <GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); if (FormType == FormTypes.New) { SysMenu = new T_SYS_ENTITYMENU(); SysMenu.ENTITYMENUID = Guid.NewGuid().ToString(); //绑定系统类型 ServiceClient.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); //BindParentMenu(); } if (!string.IsNullOrEmpty(menuID)) { ServiceClient.GetSysMenuByIDAsync(menuID); } }
/// <summary> /// 登录验证 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void LoginButton_Click(object sender, EventArgs e) { try { PermissionServiceClient clPerm = new PermissionServiceClient(); SmtOnlinePortalTools.PermissWS.T_SYS_USER entUser = clPerm.UserLogin(UserName.Text, GetMd5Hash(MD5.Create(),Password.Text)); if (entUser == null) { ltlMsg.Text = "用户不存在或密码错误,请重新输入。"; return; } //if (UserName.Text != "xianghanyong" && Password.Text != "xianghanyong") //{ // ltlMsg.Text = "用户不存在或密码错误,请重新输入。"; // return; //} Session["LOGINUSER"] = entUser; plLogin.Visible = false; plManage.Visible = true; } catch (Exception ex) { ltlMsg.Text = "登录异常,请联系管理员。" + ex.ToString(); ; } }
private void InitParas(string roleMenuID) { ServiceClient = new PermissionServiceClient(); //RoleClient = new SysRoleManagementServiceClient(); ServiceClient.RoleEntityMenuAddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_RoleEntityMenuAddCompleted); ServiceClient.RoleEntityMenuUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_RoleEntityMenuUpdateCompleted); ServiceClient.GetRoleEntityMenuByIDCompleted += new EventHandler<GetRoleEntityMenuByIDCompletedEventArgs>(ServiceClient_GetRoleEntityMenuByIDCompleted); //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); ServiceClient.GetSysRoleInfosCompleted += new EventHandler<GetSysRoleInfosCompletedEventArgs>(ServiceClient_GetSysRoleInfosCompleted); if (FormType == FormTypes.New) { RoleMenu = new T_SYS_ROLEENTITYMENU(); RoleMenu.ROLEENTITYMENUID = Guid.NewGuid().ToString(); //绑定系统类型 ServiceClient.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); } //初始化权限菜单 if (!string.IsNullOrEmpty(roleMenuID)) { ServiceClient.GetRoleEntityMenuByIDAsync(roleMenuID); } }
public BaseBll() { //if (!string.IsNullOrEmpty(CommonUserInfo.EmployeeID)) //{ // //dal.CurrentUserID = CommonUserInfo.EmployeeID; //} if (MemCacheClient == null) { MemCacheClient = new MemcachedClient(); } if (personClient == null) { personClient = new PersonnelServiceClient(); } if (PermClient == null) { PermClient = new SMT.SaaS.BLLCommonServices.PermissionWS.PermissionServiceClient(); } if (BllPermClient == null) { BllPermClient = new SMT.SaaS.BLLCommonServices.BllCommonUserPermissionWS.BllCommonPermissionServicesClient(); } if (UtilityClass == null) { UtilityClass = new SMT.SaaS.BLLCommonServices.Utility(); } if (dal == null) { dal = new CommDaL <TEntity>(); //dal.LogNewDal(typeof(TEntity).Name); } }
private void InitParas(string CustPermID) { ServiceClient = new PermissionServiceClient(); ServiceClient.GetEntityMenuCustomPermByIDCompleted += new EventHandler<GetEntityMenuCustomPermByIDCompletedEventArgs>(ServiceClient_GetEntityMenuCustomPermByIDCompleted); //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); ServiceClient.FindSysPermissionByTypeCompleted += new EventHandler<FindSysPermissionByTypeCompletedEventArgs>(ServiceClient_FindSysPermissionByTypeCompleted); ServiceClient.EntityMenuCustomPermAddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermAddCompleted); ServiceClient.EntityMenuCustomPermUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermUpdateCompleted); if (FormType == FormTypes.New) { CustPerm = new T_SYS_ENTITYMENUCUSTOMPERM(); CustPerm.ENTITYMENUCUSTOMPERMID = Guid.NewGuid().ToString(); } //初始化角色权限 if (!string.IsNullOrEmpty(CustPermID)) { ServiceClient.GetEntityMenuCustomPermByIDAsync(CustPermID); } else { //ServiceClient.GetSysMenuByTypeAsync(""); ServiceClient.FindSysPermissionByTypeAsync(""); } }
private void InitControlEvent() { GetEntityLogo("T_SYS_USERROLE"); gridToolBar.btnNew.Click += new RoutedEventHandler(btnNew_Click); gridToolBar.btnNew.Content = "添加角色"; gridToolBar.btnEdit.Visibility = Visibility.Collapsed; //gridToolBar.btnEdit.Click += new RoutedEventHandler(btnEdit_Click); //gridToolBar.btnEdit.Visibility = Visibility.Collapsed; gridToolBar.btnDelete.Click += new RoutedEventHandler(btnDelete_Click); gridToolBar.btnAudit.Visibility = Visibility.Collapsed; gridToolBar.BtnView.Visibility = Visibility.Collapsed; gridToolBar.btnAudit.Visibility = Visibility.Collapsed; gridToolBar.stpCheckState.Visibility = Visibility.Collapsed; DtGrid.CurrentCellChanged += new EventHandler <EventArgs>(DtGrid_CurrentCellChanged); gridToolBar.btnRefresh.Click += new RoutedEventHandler(btnRefresh_Click); gridToolBar.ShowRect(); ServiceClient = new PermissionServiceClient(); //ServiceClient.GetSysUserRoleByTypeCompleted += new EventHandler<GetSysUserRoleByTypeCompletedEventArgs>(ServiceClient_GetSysUserRoleByTypeCompleted); ServiceClient.GetSysUserRoleByUserCompleted += new EventHandler <GetSysUserRoleByUserCompletedEventArgs>(ServiceClient_GetSysUserRoleByUserCompleted); ServiceClient.SysUserRoleDeleteCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_SysUserRoleDeleteCompleted); ServiceClient.GetUserByIDCompleted += new EventHandler <GetUserByIDCompletedEventArgs>(ServiceClient_GetUserByIDCompleted); ServiceClient.GetUserByIDAsync(tmpUserID); }
protected void LoadDicts() { try { PermissionServiceClient cliet = new PermissionServiceClient(); cliet.GetSysDictionaryByCategoryCompleted += (o, e) => { if (e.Error != null && e.Error.Message != "") { MessageBox.Show(Utility.GetResourceStr(e.Error.Message)); } else { List <T_SYS_DICTIONARY> dicts = new List <T_SYS_DICTIONARY>(); dicts = e.Result == null ? null : e.Result.ToList(); Application.Current.Resources.Add("SYS_DICTIONARY", dicts); } }; //TODO: 按需取出字典值 cliet.GetSysDictionaryByCategoryAsync("CHECKSTATE"); } catch (Exception ex) { MessageBox.Show(Utility.GetResourceStr(ex.Message)); } }
//通过Permission项目提供的WCf服务验证 //protected Identity CurrentIdentity = null; //protected override void OnInit(EventArgs e) //{ // if (HttpContext.Current.User.Identity.Name.Trim() != string.Empty) // { // AuthenticateModule.SetPrincipal(HttpContext.Current.User.Identity.Name); // CurrentIdentity = (Identity)Principal.Current.Identity; // } // if (CurrentIdentity == null) // { // Response.Redirect("~/login.aspx", true); // } // base.OnInit(e); //} #endregion #region "验证Form,View权限" #endregion /// <summary> /// 获取实体Logo /// </summary> /// <param name="entityCode">实体标示</param> public void GetEntityLogo(string entityCode) { PermissionServiceClient client = new PermissionServiceClient(); client.GetSysMenuByEntityCodeCompleted += new EventHandler <GetSysMenuByEntityCodeCompletedEventArgs>(client_GetSysMenuByEntityCodeCompleted); client.GetSysMenuByEntityCodeAsync(entityCode); }
public void InitPara() { try { PARENT.Children.Add(loadbar); loadbar.Start(); DictManager.OnDictionaryLoadCompleted += new EventHandler <OnDictionaryLoadArgs>(DictManager_OnDictionaryLoadCompleted); client = new SMT.Saas.Tools.PersonnelWS.PersonnelServiceClient(); client.GetEmployeePagingCompleted += new EventHandler <GetEmployeePagingCompletedEventArgs>(client_GetEmployeePagingCompleted); //client.GetEmployeesWithOutPermissionsCompleted += new EventHandler<GetEmployeesWithOutPermissionsCompletedEventArgs>(client_GetEmployeesWithOutPermissionsCompleted); client.GetEmployeeViewsPagingCompleted += new EventHandler <GetEmployeeViewsPagingCompletedEventArgs>(client_GetEmployeeViewsPagingCompleted); client.EmployeeDeleteCompleted += new EventHandler <EmployeeDeleteCompletedEventArgs>(client_EmployeeDeleteCompleted); //client.GetEmployeeViewsActivedPagingCompleted += new EventHandler<GetEmployeeViewsActivedPagingCompletedEventArgs>(client_GetEmployeeViewsActivedPagingCompleted); permclient = new PermissionServiceClient(); permclient.GetUserByEmployeeIDCompleted += new EventHandler <Saas.Tools.PermissionWS.GetUserByEmployeeIDCompletedEventArgs>(permclient_GetUserByEmployeeIDCompleted); //this.Loaded += new RoutedEventHandler(Employee_Loaded); } catch (Exception ex) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } }
private void LoadDicts() { try { PermissionServiceClient clientPerm = new PermissionServiceClient(); clientPerm.GetSysDictionaryByCategoryCompleted += (o, e) => { if (e.Error != null && e.Error.Message != "") { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message)); } else { List <T_SYS_DICTIONARY> dicts = new List <T_SYS_DICTIONARY>(); dicts = e.Result == null ? null : e.Result.ToList(); Application.Current.Resources.Add("SYS_DICTIONARY", dicts); } }; //TODO: 按需取出字典值 //clientPerm.GetSysDictionaryByCategoryAsync(""); } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message)); } }
private void InitEvent() { PARENT.Children.Add(loadbar); ToolBar.btnNew.Click += new RoutedEventHandler(btnNew_Click); ToolBar.btnRefresh.Click += new RoutedEventHandler(btnRefresh_Click); ToolBar.btnEdit.Click += new RoutedEventHandler(btnEdit_Click); ToolBar.btnDelete.Click += new RoutedEventHandler(btnDelete_Click); ToolBar.cbxCheckState.SelectionChanged += new SelectionChangedEventHandler(cbxCheckState_SelectionChanged); ToolBar.btnAudit.Click += new RoutedEventHandler(btnAudit_Click); ToolBar.BtnView.Click += new RoutedEventHandler(BtnView_Click); ToolBar.btnReSubmit.Visibility = Visibility.Collapsed; client = new PersonnelServiceClient(); client.EmployeeContractViewPagingCompleted += new EventHandler<EmployeeContractViewPagingCompletedEventArgs>(client_EmployeeContractViewPagingCompleted); client.EmployeeContractPagingCompleted += new EventHandler<EmployeeContractPagingCompletedEventArgs>(client_EmployeeContractPagingCompleted); // client.EmployeeDeleteCompleted += new EventHandler<EmployeeDeleteCompletedEventArgs>(client_EmployeeDeleteCompleted); client.EmployeeContractDeleteCompleted += new EventHandler<EmployeeContractDeleteCompletedEventArgs>(client_EmployeeContractDeleteCompleted); this.Loaded += new RoutedEventHandler(EmployeeContract_Loaded); PermissionServiceClient pClient = new PermissionServiceClient(); pClient.GetUserMenuPermsByUserPermissionCompleted += new EventHandler<GetUserMenuPermsByUserPermissionCompletedEventArgs>(pClient_GetUserMenuPermsByUserPermissionCompleted); pClient.GetUserMenuPermsByUserPermissionAsync("T_HR_EMPLOYEECONTRACT", SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID); }
protected void LoadDicts() { try { PermissionServiceClient cliet = new PermissionServiceClient(); cliet.GetSysDictionaryByCategoryCompleted += (o, e) => { if (e.Error != null && e.Error.Message != "") { CommonFunction.ShowErrorMessage(Utility.GetResourceStr(e.Error.Message)); } else { List <T_SYS_DICTIONARY> dicts = new List <T_SYS_DICTIONARY>(); dicts = e.Result == null ? null : e.Result.ToList(); if (Application.Current.Resources.Contains("SYS_DICTIONARY")) { Application.Current.Resources.Remove("SYS_DICTIONARY"); } Application.Current.Resources.Add("SYS_DICTIONARY", dicts); settings.Add("SYS_DICTIONARY", dicts); isDict = true; RefreshBtn(); } }; //TODO: 按需取出字典值 cliet.GetSysDictionaryByCategoryAsync(""); } catch (Exception ex) { MessageBox.Show(Utility.GetResourceStr(ex.Message)); } }
private void BtnView_Click(object sender, RoutedEventArgs e) { SMT.Saas.Tools.PermissionWS.PermissionServiceClient ps = new PermissionServiceClient(); ps.GetFlowUserInfoByRoleIDAsync("fbce7ce8-7e45-4bd9-93db-69f40d0a4d47"); if (SelectRole != null) { if (!string.IsNullOrEmpty(SelectRole.ROLEID)) { Form.SysRoleForms editForm = new SMT.SaaS.Permission.UI.Form.SysRoleForms(FormTypes.Browse, SelectRole.ROLEID); EntityBrowser browser = new EntityBrowser(editForm); browser.MinHeight = 300; browser.MinWidth = 400; browser.FormType = FormTypes.Browse; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTRECORDER"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTRECORDER"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } }
public void InitPara() { try { PARENT.Children.Add(loadbar); loadbar.Start(); DictManager.OnDictionaryLoadCompleted += new EventHandler <OnDictionaryLoadArgs>(DictManager_OnDictionaryLoadCompleted); client = new SMT.Saas.Tools.PersonnelWS.PersonnelServiceClient(); client.GetEmployeePagingCompleted += new EventHandler <GetEmployeePagingCompletedEventArgs>(client_GetEmployeePagingCompleted); //client.GetEmployeesWithOutPermissionsCompleted += new EventHandler<GetEmployeesWithOutPermissionsCompletedEventArgs>(client_GetEmployeesWithOutPermissionsCompleted); // client.GetEmployeeViewsPagingCompleted+=new EventHandler<GetEmployeeViewsPagingCompletedEventArgs>(client_GetEmployeeViewsPagingCompleted); client.GetEmployeeViewsWithOutPermissionsCompleted += new EventHandler <GetEmployeeViewsWithOutPermissionsCompletedEventArgs>(client_GetEmployeeViewsWithOutPermissionsCompleted); client.EmployeeDeleteCompleted += new EventHandler <EmployeeDeleteCompletedEventArgs>(client_EmployeeDeleteCompleted); orgClient = new SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient(); orgClient.GetCompanyActivedCompleted += new EventHandler <SMT.Saas.Tools.OrganizationWS.GetCompanyActivedCompletedEventArgs>(orgClient_GetCompanyActivedCompleted); orgClient.GetDepartmentActivedCompleted += new EventHandler <SMT.Saas.Tools.OrganizationWS.GetDepartmentActivedCompletedEventArgs>(orgClient_GetDepartmentActivedCompleted); orgClient.GetPostActivedCompleted += new EventHandler <SMT.Saas.Tools.OrganizationWS.GetPostActivedCompletedEventArgs>(orgClient_GetPostActivedCompleted); permclient = new PermissionServiceClient(); permclient.GetUserByEmployeeIDCompleted += new EventHandler <Saas.Tools.PermissionWS.GetUserByEmployeeIDCompletedEventArgs>(permclient_GetUserByEmployeeIDCompleted); permclient.getFbAdminsCompleted += new EventHandler <getFbAdminsCompletedEventArgs>(permclient_getFbAdminsCompleted); //this.Loaded += new RoutedEventHandler(Employee_Loaded); permclient.DeleteFbAdminCompleted += new EventHandler <DeleteFbAdminCompletedEventArgs>(permclient_DeleteFbAdminCompleted); } catch (Exception ex) { SMT.SAAS.Application.ExceptionManager.SendException("用户管理", "SysUserManagement", "Views/SysUserManagement", "SysUserManagement", ex); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message)); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } }
private void InitParas(string roleID) { ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysDictionaryByCategoryCompleted += new EventHandler<GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); ServiceClient.SysRoleInfoAddCompleted += new EventHandler<SysRoleInfoAddCompletedEventArgs>(SysRoleClient_SysRoleInfoAddCompleted); //ServiceClient.SysRoleInfoUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(SysRoleClient_SysRoleInfoUpdateCompleted); ServiceClient.SysRoleInfoUpdateCompleted += new EventHandler<SysRoleInfoUpdateCompletedEventArgs>(ServiceClient_SysRoleInfoUpdateCompleted); ServiceClient.GetSysRoleSingleInfoByIdCompleted += new EventHandler<GetSysRoleSingleInfoByIdCompletedEventArgs>(SysRoleClient_GetSysRoleSingleInfoByIdCompleted); if (!string.IsNullOrEmpty(roleID)) { tmpRoleId = roleID; //ServiceClient.GetSysRoleByIDAsync(roleID); } //绑定系统类型 ServiceClient.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); if (FormType == FormTypes.New) { SysRole = new T_SYS_ROLE(); this.txtCompanyName.Text = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].CompanyName) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;//公司名称 StrCompanyID = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;//公司ID this.txtDepartmentName.Text = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName;//部门名称 this.StrDepartmentID = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;//部门ID SysRole.ROLEID = Guid.NewGuid().ToString(); //GetCompanyNameByCompanyID(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID); } }
/// <summary> /// 登录验证 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void LoginButton_Click(object sender, EventArgs e) { try { PermissionServiceClient clPerm = new PermissionServiceClient(); SmtOnlinePortalTools.PermissWS.T_SYS_USER entUser = clPerm.UserLogin(UserName.Text, GetMd5Hash(MD5.Create(), Password.Text)); if (entUser == null) { ltlMsg.Text = "用户不存在或密码错误,请重新输入。"; return; } //if (UserName.Text != "xianghanyong" && Password.Text != "xianghanyong") //{ // ltlMsg.Text = "用户不存在或密码错误,请重新输入。"; // return; //} Session["LOGINUSER"] = entUser; plLogin.Visible = false; plManage.Visible = true; } catch (Exception ex) { ltlMsg.Text = "登录异常,请联系管理员。" + ex.ToString();; } }
private void InitParas(string roleMenuID) { ServiceClient = new PermissionServiceClient(); //RoleClient = new SysRoleManagementServiceClient(); ServiceClient.RoleEntityMenuAddCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_RoleEntityMenuAddCompleted); ServiceClient.RoleEntityMenuUpdateCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_RoleEntityMenuUpdateCompleted); ServiceClient.GetRoleEntityMenuByIDCompleted += new EventHandler <GetRoleEntityMenuByIDCompletedEventArgs>(ServiceClient_GetRoleEntityMenuByIDCompleted); //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); ServiceClient.GetSysRoleInfosCompleted += new EventHandler <GetSysRoleInfosCompletedEventArgs>(ServiceClient_GetSysRoleInfosCompleted); if (FormType == FormTypes.New) { RoleMenu = new T_SYS_ROLEENTITYMENU(); RoleMenu.ROLEENTITYMENUID = Guid.NewGuid().ToString(); //绑定系统类型 ServiceClient.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); } //初始化权限菜单 if (!string.IsNullOrEmpty(roleMenuID)) { ServiceClient.GetRoleEntityMenuByIDAsync(roleMenuID); } }
private void InitParas(string roleID) { ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysDictionaryByCategoryCompleted += new EventHandler <GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); ServiceClient.SysRoleInfoAddCompleted += new EventHandler <SysRoleInfoAddCompletedEventArgs>(SysRoleClient_SysRoleInfoAddCompleted); //ServiceClient.SysRoleInfoUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(SysRoleClient_SysRoleInfoUpdateCompleted); ServiceClient.SysRoleInfoUpdateCompleted += new EventHandler <SysRoleInfoUpdateCompletedEventArgs>(ServiceClient_SysRoleInfoUpdateCompleted); ServiceClient.GetSysRoleSingleInfoByIdCompleted += new EventHandler <GetSysRoleSingleInfoByIdCompletedEventArgs>(SysRoleClient_GetSysRoleSingleInfoByIdCompleted); if (!string.IsNullOrEmpty(roleID)) { tmpRoleId = roleID; //ServiceClient.GetSysRoleByIDAsync(roleID); } //绑定系统类型 ServiceClient.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); if (FormType == FormTypes.New) { SysRole = new T_SYS_ROLE(); this.txtCompanyName.Text = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].CompanyName) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].CompanyName; //公司名称 StrCompanyID = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; //公司ID this.txtDepartmentName.Text = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName; //部门名称 this.StrDepartmentID = string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID) ? "" : Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //部门ID SysRole.ROLEID = Guid.NewGuid().ToString(); //GetCompanyNameByCompanyID(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID); } }
private void InitEvent() { PARENT.Children.Add(loadbar); ToolBar.btnNew.Click += new RoutedEventHandler(btnNew_Click); ToolBar.btnRefresh.Click += new RoutedEventHandler(btnRefresh_Click); ToolBar.btnEdit.Click += new RoutedEventHandler(btnEdit_Click); ToolBar.btnDelete.Click += new RoutedEventHandler(btnDelete_Click); ToolBar.cbxCheckState.SelectionChanged += new SelectionChangedEventHandler(cbxCheckState_SelectionChanged); ToolBar.btnAudit.Click += new RoutedEventHandler(btnAudit_Click); ToolBar.BtnView.Click += new RoutedEventHandler(BtnView_Click); ToolBar.btnReSubmit.Visibility = Visibility.Collapsed; client = new PersonnelServiceClient(); client.EmployeeContractViewPagingCompleted += new EventHandler <EmployeeContractViewPagingCompletedEventArgs>(client_EmployeeContractViewPagingCompleted); client.EmployeeContractPagingCompleted += new EventHandler <EmployeeContractPagingCompletedEventArgs>(client_EmployeeContractPagingCompleted); // client.EmployeeDeleteCompleted += new EventHandler<EmployeeDeleteCompletedEventArgs>(client_EmployeeDeleteCompleted); client.EmployeeContractDeleteCompleted += new EventHandler <EmployeeContractDeleteCompletedEventArgs>(client_EmployeeContractDeleteCompleted); this.Loaded += new RoutedEventHandler(EmployeeContract_Loaded); PermissionServiceClient pClient = new PermissionServiceClient(); pClient.GetUserMenuPermsByUserPermissionCompleted += new EventHandler <GetUserMenuPermsByUserPermissionCompletedEventArgs>(pClient_GetUserMenuPermsByUserPermissionCompleted); pClient.GetUserMenuPermsByUserPermissionAsync("T_HR_EMPLOYEECONTRACT", SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID); }
private void InitParas(string CustPermID) { ServiceClient = new PermissionServiceClient(); ServiceClient.GetEntityMenuCustomPermByIDCompleted += new EventHandler <GetEntityMenuCustomPermByIDCompletedEventArgs>(ServiceClient_GetEntityMenuCustomPermByIDCompleted); //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); ServiceClient.FindSysPermissionByTypeCompleted += new EventHandler <FindSysPermissionByTypeCompletedEventArgs>(ServiceClient_FindSysPermissionByTypeCompleted); ServiceClient.EntityMenuCustomPermAddCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermAddCompleted); ServiceClient.EntityMenuCustomPermUpdateCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermUpdateCompleted); if (FormType == FormTypes.New) { CustPerm = new T_SYS_ENTITYMENUCUSTOMPERM(); CustPerm.ENTITYMENUCUSTOMPERMID = Guid.NewGuid().ToString(); } //初始化角色权限 if (!string.IsNullOrEmpty(CustPermID)) { ServiceClient.GetEntityMenuCustomPermByIDAsync(CustPermID); } else { //ServiceClient.GetSysMenuByTypeAsync(""); ServiceClient.FindSysPermissionByTypeAsync(""); } }
private void InitControlEvent() { DtGrid.CurrentCellChanged += new EventHandler <EventArgs>(DataGrid_CurrentCellChanged); ServiceClient = new PermissionServiceClient(); ServiceClient.GetRoleEntityMenuByTypeCompleted += new EventHandler <GetRoleEntityMenuByTypeCompletedEventArgs>(ServiceClient_GetRoleEntityMenuByTypeCompleted); ServiceClient.RoleEntityMenuDeleteCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_RoleEntityMenuDeleteCompleted); }
private void InitControlEvent() { ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysMenuByTypeCompleted += new EventHandler <GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); //ServiceClient.GetSysMenuInfosListByParentIDCompleted += new EventHandler<GetSysMenuInfosListByParentIDCompletedEventArgs>(ServiceClient_GetSysMenuInfosListByParentIDCompleted); //SysRoleClient.GetSysRoleInfosCompleted += new EventHandler<GetSysRoleInfosCompletedEventArgs>(SysRoleClient_GetSysRoleInfosCompleted); //SysRoleClient.UserRoleBatchAddInfosCompleted += new EventHandler<UserRoleBatchAddInfosCompletedEventArgs>(SysRoleClient_UserRoleBatchAddInfosCompleted); }
/// <summary> /// 创建一个字典加载的实例 /// </summary> public DictionaryManager() { _client = new PermissionServiceClient(); _client.GetDictionaryByCategoryArrayCompleted += new EventHandler <GetDictionaryByCategoryArrayCompletedEventArgs>(_client_GetDictionaryByCategoryArrayCompleted); permClient = new PermissionServiceClient(); permClient.GetSysDictionaryByCategoryCompleted += new EventHandler <GetSysDictionaryByCategoryCompletedEventArgs>(permClient_GetSysDictionaryByCategoryCompleted); }
private ObservableCollection<string> StrAddStaffList = new ObservableCollection<string>(); //获取员工时的ID数组 public SysUserInfoPage() { ServiceClient = new PermissionServiceClient(); PersonClient = new PersonnelServiceClient(); InitializeComponent(); ServiceClient.GetUserByIDCompleted += new EventHandler<GetUserByIDCompletedEventArgs>(ServiceClient_GetUserByIDCompleted); PersonClient.GetEmployeeDetailByIDsCompleted += new EventHandler<GetEmployeeDetailByIDsCompletedEventArgs>(personclient_GetEmployeeDetailByIDsCompleted); }
private ObservableCollection <string> StrAddStaffList = new ObservableCollection <string>(); //获取员工时的ID数组 public SysUserInfoPage() { ServiceClient = new PermissionServiceClient(); PersonClient = new PersonnelServiceClient(); InitializeComponent(); ServiceClient.GetUserByIDCompleted += new EventHandler <GetUserByIDCompletedEventArgs>(ServiceClient_GetUserByIDCompleted); PersonClient.GetEmployeeDetailByIDsCompleted += new EventHandler <GetEmployeeDetailByIDsCompletedEventArgs>(personclient_GetEmployeeDetailByIDsCompleted); }
private void InitControlEvent() { ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysMenuByTypeCompleted +=new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); //ServiceClient.GetSysMenuInfosListByParentIDCompleted += new EventHandler<GetSysMenuInfosListByParentIDCompletedEventArgs>(ServiceClient_GetSysMenuInfosListByParentIDCompleted); //SysRoleClient.GetSysRoleInfosCompleted += new EventHandler<GetSysRoleInfosCompletedEventArgs>(SysRoleClient_GetSysRoleInfosCompleted); //SysRoleClient.UserRoleBatchAddInfosCompleted += new EventHandler<UserRoleBatchAddInfosCompletedEventArgs>(SysRoleClient_UserRoleBatchAddInfosCompleted); }
//private SysRoleManagementServiceClient SysRoleClient = new SysRoleManagementServiceClient(); private void InitControlEvent() { ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysRoleInfosCompleted += new EventHandler <GetSysRoleInfosCompletedEventArgs>(SysRoleClient_GetSysRoleInfosCompleted); ServiceClient.UserRoleBatchAddInfosCompleted += new EventHandler <UserRoleBatchAddInfosCompletedEventArgs>(SysRoleClient_UserRoleBatchAddInfosCompleted); ServiceClient.GetSysUserRoleByUserCompleted += new EventHandler <GetSysUserRoleByUserCompletedEventArgs>(ServiceClient_GetSysUserRoleByUserCompleted); //ServiceClient.GetSysUserRoleByUser }
void EventRegister() { client = new SmtOAPersonOfficeClient(); permissionClient = new PermissionServiceClient(); client.AddSatisfactionAppCompleted += new EventHandler<AddSatisfactionAppCompletedEventArgs>(client_AddSatisfactionAppCompleted); client.UpdSatisfactionAppCompleted += new EventHandler<UpdSatisfactionAppCompletedEventArgs>(client_UpdSatisfactionAppCompleted); client.GetSatisfactionAppChildCompleted += new EventHandler<GetSatisfactionAppChildCompletedEventArgs>(client_GetSatisfactionAppChildCompleted); permissionClient.GetSysDictionaryByFatherIDCompleted += new EventHandler<GetSysDictionaryByFatherIDCompletedEventArgs>(permissionClient_GetSysDictionaryByFatherIDCompleted); }
//private SysRoleManagementServiceClient SysRoleClient = new SysRoleManagementServiceClient(); private void InitControlEvent() { ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysRoleInfosCompleted += new EventHandler<GetSysRoleInfosCompletedEventArgs>(SysRoleClient_GetSysRoleInfosCompleted); ServiceClient.UserRoleBatchAddInfosCompleted += new EventHandler<UserRoleBatchAddInfosCompletedEventArgs>(SysRoleClient_UserRoleBatchAddInfosCompleted); ServiceClient.GetSysUserRoleByUserCompleted += new EventHandler<GetSysUserRoleByUserCompletedEventArgs>(ServiceClient_GetSysUserRoleByUserCompleted); //ServiceClient.GetSysUserRoleByUser }
void EventRegister() { client = new SmtOAPersonOfficeClient(); permissionClient = new PermissionServiceClient(); client.AddSatisfactionAppCompleted += new EventHandler <AddSatisfactionAppCompletedEventArgs>(client_AddSatisfactionAppCompleted); client.UpdSatisfactionAppCompleted += new EventHandler <UpdSatisfactionAppCompletedEventArgs>(client_UpdSatisfactionAppCompleted); client.GetSatisfactionAppChildCompleted += new EventHandler <GetSatisfactionAppChildCompletedEventArgs>(client_GetSatisfactionAppChildCompleted); permissionClient.GetSysDictionaryByFatherIDCompleted += new EventHandler <GetSysDictionaryByFatherIDCompletedEventArgs>(permissionClient_GetSysDictionaryByFatherIDCompleted); }
string corpName = string.Empty; //公司名称 /// <summary> /// 初始化 /// </summary> private void InitParas() { PermClient = new PermissionServiceClient(); PermClient.UpdateFbAdminCompleted += new EventHandler <UpdateFbAdminCompletedEventArgs>(PermClient_UpdateFbAdminCompleted); if (empInfo != null) { string strInfo = empInfo.EMPLOYEECNAME + "-" + empInfo.POSTNAME + "-" + empInfo.DEPARTMENTNAME + "-" + empInfo.COMPANYNAME; this.tbName.Text = strInfo; } }
bool IsRoleEntityMenuChange = false;//是否对菜单进行了赋权 #endregion #region 构造函数 /// <summary> /// 构造函数 /// </summary> /// <param name="action"></param> /// <param name="StrID"></param> public UserRoleApplyForm(FormTypes action, string StrID) { InitializeComponent(); permClient = new PermissionServiceClient(); tmpRoleID = StrID; personnelClient = new PersonnelServiceClient(); operationType = action; InitEvent(); this.Loaded += new RoutedEventHandler(UserRoleApplyForm_Loaded); }
void LeftOffice_Loaded(object sender, RoutedEventArgs e) { GetEntityLogo("T_HR_LEFTOFFICE"); Utility.CbxItemBinder(ToolBar.cbxCheckState, "CHECKSTATE", Convert.ToInt32(CheckStates.All).ToString()); PermissionServiceClient pClient = new PermissionServiceClient(); pClient.GetUserMenuPermsByUserPermissionAsync("T_HR_LEFTOFFICECONFIRM", SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID); pClient.GetUserMenuPermsByUserPermissionCompleted += new EventHandler <GetUserMenuPermsByUserPermissionCompletedEventArgs>(pClient_GetUserMenuPermsByUserPermissionCompleted); }
//private static void ChecResource() //{ // if (Application.Current.Resources["FLOW_MODELDEFINE_T"] == null) // { // Utility.LoadDictss(); // } // if (!Application.Current.Resources.Contains("ResourceConveter")) // { // Application.Current.Resources.Add("ResourceConveter", new SMT.SaaS.Globalization.ResourceConveter()); // } //} /// <summary> /// 加载权限 /// </summary> /// <param name="FormName"></param> private static void CheckPermission(string FormName) { PermissionServiceClient clientPerm = new PermissionServiceClient(); clientPerm.GetUserPermissionByUserToUICompleted += new EventHandler <GetUserPermissionByUserToUICompletedEventArgs>(clientPerm_GetUserPermissionByUserToUICompleted); string strUserId = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID; //ApplicationCache.CacheMenuList clientPerm.GetUserPermissionByUserToUIAsync(strUserId); }
protected static PermissionServiceClient ServiceClient = new PermissionServiceClient();//龙康才新增 // protected PermissionServiceClient ServiceClient; //private SysRoleManagementServiceClient SysRoleClient = new SysRoleManagementServiceClient(); private void InitControlEvent() { ServiceClient = new PermissionServiceClient(); ServiceClient.SysRoleBatchDelCompleted += new EventHandler <SysRoleBatchDelCompletedEventArgs>(SysRoleClient_SysRoleBatchDelCompleted); ServiceClient.GetSysDictionaryByCategoryCompleted += new EventHandler <GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); //ServiceClient.GetSysRoleInfosPagingCompleted += new EventHandler<GetSysRoleInfosPagingCompletedEventArgs>(ServiceClient_GetSysRoleInfosPagingCompleted); ServiceClient.GetSysRoleInfosPagingByCompanyIDsCompleted += new EventHandler <GetSysRoleInfosPagingByCompanyIDsCompletedEventArgs>(ServiceClient_GetSysRoleInfosPagingByCompanyIDsCompleted); //绑定系统类型 DictManager.OnDictionaryLoadCompleted += new EventHandler <OnDictionaryLoadArgs>(DictManager_OnDictionaryLoadCompleted); }
public void GetEntityLogo(string entityCode) { //SMT.Saas.Tools.PermissionWS.PermissionServiceClient client = new SMT.Saas.Tools.PermissionWS.PermissionServiceClient(); PermissionServiceClient client = new PermissionServiceClient(); //client.GetSysMenuByEntityCodeCompleted += new EventHandler<SMT.Saas.Tools.PermissionWS.GetSysMenuByEntityCodeCompletedEventArgs>(client_GetSysMenuByEntityCodeCompleted); client.GetSysMenuByEntityCodeCompleted += new EventHandler <GetSysMenuByEntityCodeCompletedEventArgs>(client_GetSysMenuByEntityCodeCompleted); client.GetSysMenuByEntityCodeAsync(entityCode); //client.CloseAsync();//龙康才新增 //client.Abort();//龙康才新增 }
void HBLoginOut_Click(object sender, RoutedEventArgs e) { if (HtmlPage.Window.Confirm("确定退出系统吗?")) { PermissionServiceClient PermClient = new PermissionServiceClient(); PermClient.SysUserLoginRecordInfoUpdateCompleted += new EventHandler <SysUserLoginRecordInfoUpdateCompletedEventArgs>(PermClient_SysUserLoginRecordInfoUpdateCompleted); //Common.CurrentConfig.CurrentEmpploy.UserLoginRecord.ONLINESTATE = "0"; //Common.CurrentConfig.CurrentUser.Curre //PermClient.SysUserLoginRecordInfoUpdateAsync(Common.CurrentConfig.CurrentUser.CurrentEmpploy.UserLoginRecord); //PermClient.SysUserLoginRecordInfoUpdateAsync(Common.CurrentConfig.CurrentUser.UserLoginRecord); } }
void EmployeeList_sat_Loaded(object sender, RoutedEventArgs e) { _VM = new SmtOAPersonOfficeClient(); permissionClient = new PermissionServiceClient(); permissionClient.GetSysDictionaryByFatherIDCompleted += new EventHandler<GetSysDictionaryByFatherIDCompletedEventArgs>(GetSysDictionaryByFatherIDCompleted); _VM.Result_EmployeeByRequireIDCompleted += new EventHandler<Result_EmployeeByRequireIDCompletedEventArgs>(Result_EmployeeByRequireIDCompleted); _VM.Get_SSurveyCompleted += new EventHandler<Get_SSurveyCompletedEventArgs>(Get_SSurveyCompleted); //模板答案 permissionClient.GetSysDictionaryByFatherIDAsync(require.ANSWERGROUPID); //获取方案 题目,答案 _VM.Get_SSurveyAsync(require.T_OA_SATISFACTIONMASTER.SATISFACTIONMASTERID); }
void EmployeeList_sat_Loaded(object sender, RoutedEventArgs e) { _VM = new SmtOAPersonOfficeClient(); permissionClient = new PermissionServiceClient(); permissionClient.GetSysDictionaryByFatherIDCompleted += new EventHandler <GetSysDictionaryByFatherIDCompletedEventArgs>(GetSysDictionaryByFatherIDCompleted); _VM.Result_EmployeeByRequireIDCompleted += new EventHandler <Result_EmployeeByRequireIDCompletedEventArgs>(Result_EmployeeByRequireIDCompleted); _VM.Get_SSurveyCompleted += new EventHandler <Get_SSurveyCompletedEventArgs>(Get_SSurveyCompleted); //模板答案 permissionClient.GetSysDictionaryByFatherIDAsync(require.ANSWERGROUPID); //获取方案 题目,答案 _VM.Get_SSurveyAsync(require.T_OA_SATISFACTIONMASTER.SATISFACTIONMASTERID); }
public ChangePWDForm() { InitializeComponent(); lodingClinet = new MainUIWS.MainUIServicesClient(); lodingClinet.SystemLoginCompleted += new System.EventHandler<MainUIWS.SystemLoginCompletedEventArgs>(lodingClinet_SystemLoginCompleted); _toolsClient = new PermissionWS.PermissionServiceClient(); _toolsClient.SysUserInfoUpdateByUserIdandUsernameCompleted += new System.EventHandler<PermissionWS.SysUserInfoUpdateByUserIdandUsernameCompletedEventArgs>(_toolsClient_SysUserInfoUpdateByUserIdandUsernameCompleted); if (App.AppSettings.Contains("USERNAME")) txbUserName.Text = App.AppSettings["USERNAME"].ToString(); }
private void InitControlEvent() { DtGrid.CurrentCellChanged += new EventHandler <EventArgs>(DtGrid_CurrentCellChanged); Button btnFind = Utility.FindChildControl <Button>(expander, "btnFind"); btnFind.Click += new RoutedEventHandler(btnFind_Click); ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysPermissionAllCompleted += new EventHandler <GetSysPermissionAllCompletedEventArgs>(ServiceClient_GetSysPermissionAllCompleted); ServiceClient.SysPermissionDeleteCompleted += new EventHandler <SysPermissionDeleteCompletedEventArgs>(ServiceClient_SysPermissionDeleteCompleted); ServiceClient.FindSysPermissionByStrCompleted += new EventHandler <FindSysPermissionByStrCompletedEventArgs>(ServiceClient_FindSysPermissionByStrCompleted); ServiceClient.GetSysPermissionAllPagingCompleted += new EventHandler <GetSysPermissionAllPagingCompletedEventArgs>(ServiceClient_GetSysPermissionAllPagingCompleted); }
private void InitParas(string strID) { client = new PermissionServiceClient(); client.SysPermissionUpdateCompleted += new EventHandler<SysPermissionUpdateCompletedEventArgs>(client_SysPermissionUpdateCompleted); client.GetSysPermissionByIDCompleted += new EventHandler<GetSysPermissionByIDCompletedEventArgs>(client_GetSysPermissionByIDCompleted); client.GetSysDictionaryByCategoryCompleted += new EventHandler<GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); client.SysPermissionAddCompleted += new EventHandler<SysPermissionAddCompletedEventArgs>(client_SysPermissionAddCompleted); client.GetSysMenuByIDCompleted += new EventHandler<GetSysMenuByIDCompletedEventArgs>(ServiceClient_GetSysMenuByIDCompleted); if (!string.IsNullOrEmpty(strID)) { client.GetSysPermissionByIDAsync(strID); } }
protected void LoadDicts() { PermissionServiceClient cliet = new PermissionServiceClient(); cliet.GetSysDictionaryByCategoryCompleted += (o, e) => { List<T_SYS_DICTIONARY> dicts = new List<T_SYS_DICTIONARY>(); dicts = e.Result == null ? null : e.Result.ToList(); if(dicts != null) Application.Current.Resources.Add("SYS_DICTIONARY", dicts); }; //TODO: 按需取出字典值 cliet.GetSysDictionaryByCategoryAsync(""); //cliet.GetSysDictionaryByCategoryByUpdateDateAsync("",DateTime.Now); }
public void InitPara() { try { PARENT.Children.Add(loadbar); DtGrid.CurrentCellChanged += new EventHandler<EventArgs>(DtGrid_CurrentCellChanged); client = new SMT.Saas.Tools.PersonnelWS.PersonnelServiceClient(); client.GetEmployeePagingCompleted += new EventHandler<GetEmployeePagingCompletedEventArgs>(client_GetEmployeePagingCompleted); client.EmployeeDeleteCompleted += new EventHandler<EmployeeDeleteCompletedEventArgs>(client_EmployeeDeleteCompleted); orgClient = new SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient(); orgClient.GetCompanyActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetCompanyActivedCompletedEventArgs>(orgClient_GetCompanyActivedCompleted); orgClient.GetDepartmentActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetDepartmentActivedCompletedEventArgs>(orgClient_GetDepartmentActivedCompleted); orgClient.GetPostActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetPostActivedCompletedEventArgs>(orgClient_GetPostActivedCompleted); permclient = new PermissionServiceClient(); permclient.GetUserByEmployeeIDCompleted += new EventHandler<Saas.Tools.PermissionWS.GetUserByEmployeeIDCompletedEventArgs>(permclient_GetUserByEmployeeIDCompleted); this.Loaded += new RoutedEventHandler(Employee_Loaded); this.ToolBar.btnNew.Visibility = Visibility.Collapsed; //this.ToolBar.btnNew.Click += new RoutedEventHandler(btnAdd_Click); this.ToolBar.btnEdit.Click += new RoutedEventHandler(BtnAlter_Click); //this.ToolBar.btnDelete.Click += new RoutedEventHandler(btnDel_Click); this.ToolBar.btnDelete.Visibility = Visibility.Collapsed; this.ToolBar.btnRefresh.Click += new RoutedEventHandler(btnRefresh_Click); this.ToolBar.BtnView.Click += new RoutedEventHandler(BtnView_Click); this.ToolBar.retNew.Visibility = Visibility.Collapsed; this.ToolBar.btnNew.Visibility = Visibility.Collapsed; this.ToolBar.cbxCheckState.Visibility = Visibility.Collapsed; this.ToolBar.txtCheckStateName.Visibility = Visibility.Collapsed; this.ToolBar.btnDelete.Visibility = Visibility.Collapsed; this.ToolBar.btnAudit.Visibility = Visibility.Collapsed; this.ToolBar.retAudit.Visibility = Visibility.Collapsed; } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message)); } }
private void InitParas() { PARENT.Children.Remove(loadbar); PARENT.Children.Add(loadbar); loadbar.Stop(); client = new PersonnelServiceClient(); client.EmployeeEntryAddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_EmployeeEntryAddCompleted); client.EmployeeAddCompleted += new EventHandler<EmployeeAddCompletedEventArgs>(client_EmployeeAddCompleted); client.EmployeeUpdateCompleted += new EventHandler<EmployeeUpdateCompletedEventArgs>(client_EmployeeUpdateCompleted); client.AddEmployeeEntryCompleted += new EventHandler<AddEmployeeEntryCompletedEventArgs>(client_AddEmployeeEntryCompleted); perclient = new PermissionServiceClient(); perclient.SysUserInfoAddORUpdateCompleted += new EventHandler<SysUserInfoAddORUpdateCompletedEventArgs>(perclient_SysUserInfoAddORUpdateCompleted); orclient = new SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient(); orclient.GetPostNumberCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetPostNumberCompletedEventArgs>(orclient_GetPostNumberCompleted); salaryCient = new Saas.Tools.SalaryWS.SalaryServiceClient(); salaryCient.AddSalaryPasswordCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(salaryCient_AddSalaryPasswordCompleted); Configclient = new HrCommonServiceClient(); Configclient.GetAppConfigByNameCompleted += new EventHandler<GetAppConfigByNameCompletedEventArgs>(Configclient_GetAppConfigByNameCompleted); Configclient.GetAppConfigByNameAsync("isForHuNanHangXingSalary"); }
private void InitControlEvent() { ServiceClient = new PermissionServiceClient(); ServiceClient.GetSysRoleInfosCompleted += new EventHandler<GetSysRoleInfosCompletedEventArgs>(SysRoleClient_GetSysRoleInfosCompleted); ServiceClient.UserRoleBatchAddInfosCompleted += new EventHandler<UserRoleBatchAddInfosCompletedEventArgs>(SysRoleClient_UserRoleBatchAddInfosCompleted); ServiceClient.GetSysUserRoleByUserCompleted += new EventHandler<GetSysUserRoleByUserCompletedEventArgs>(ServiceClient_GetSysUserRoleByUserCompleted); personclient.GetAllPostByEmployeeIDCompleted += new EventHandler<GetAllPostByEmployeeIDCompletedEventArgs>(personclient_GetAllPostByEmployeeIDCompleted); ServiceClient.BatchAddUserRoleCompleted += new EventHandler<BatchAddUserRoleCompletedEventArgs>(ServiceClient_BatchAddUserRoleCompleted); ServiceClient.GetSysRoleInfosByCompanyIdAndDepartmentIdCompleted += new EventHandler<GetSysRoleInfosByCompanyIdAndDepartmentIdCompletedEventArgs>(ServiceClient_GetSysRoleInfosByCompanyIdAndDepartmentIdCompleted); ServiceClient.GetSysDictionaryByCategoryCompleted += new EventHandler<GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); //StrCompanyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; //txtCompany.Text = Common.CurrentLoginUserInfo.companyName; orgclient.GetCompanyByIdCompleted += new EventHandler<GetCompanyByIdCompletedEventArgs>(orgclient_GetCompanyByIdCompleted); orgclient.GetDepartmentByIdCompleted += new EventHandler<GetDepartmentByIdCompletedEventArgs>(orgclient_GetDepartmentByIdCompleted); personclient.GetAllPostByEmployeeIDAsync(tmpUser.EMPLOYEEID); ServiceClient.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); }
protected void LoadDicts() { try { PermissionServiceClient cliet = new PermissionServiceClient(); cliet.GetSysDictionaryByCategoryCompleted += (o, e) => { if (e.Error != null && e.Error.Message != "") { CommonFunction.ShowErrorMessage(Utility.GetResourceStr(e.Error.Message)); } else { List<T_SYS_DICTIONARY> dicts = new List<T_SYS_DICTIONARY>(); dicts = e.Result == null ? null : e.Result.ToList(); if (Application.Current.Resources.Contains("SYS_DICTIONARY")) { Application.Current.Resources.Remove("SYS_DICTIONARY"); } Application.Current.Resources.Add("SYS_DICTIONARY", dicts); settings.Add("SYS_DICTIONARY", dicts); isDict = true; RefreshBtn(); } }; //TODO: 按需取出字典值 cliet.GetSysDictionaryByCategoryAsync(""); } catch (Exception ex) { MessageBox.Show(Utility.GetResourceStr(ex.Message)); } }
private void GetPostLevel() { string path = "silverlightcache\\POSTLEVEL.txt"; try { var postlevel =SLCache.GetCache<List<V_Dictionary>>(path, 10); if (postlevel != null) { var ents = from a in postlevel orderby a.DICTIONARYNAME ascending select a; cboPostLevel.BindData(ents.ToList(), "DICTIONARYNAME", "DICTIONARYVALUE"); } else { PermissionServiceClient psc = new PermissionServiceClient(); System.Collections.ObjectModel.ObservableCollection<string> strs = new System.Collections.ObjectModel.ObservableCollection<string>(); strs.Add("POSTLEVEL"); // strs.Add("TYPEAPPROVAL"); psc.GetDictionaryByCategoryArrayAsync(strs); psc.GetDictionaryByCategoryArrayCompleted += (o, e) => { if (e.Error == null) { if (e.Result != null) { //System.Collections.ObjectModel.ObservableCollection<V_Dictionary> dics =e.Result; var ents = from a in e.Result orderby a.DICTIONARYNAME ascending select a; cboPostLevel.BindData(ents.ToList(), "DICTIONARYNAME", "DICTIONARYVALUE"); SLCache.SaveData<List<V_Dictionary>>(e.Result.ToList(), path); } } }; } } catch { PermissionServiceClient psc = new PermissionServiceClient(); System.Collections.ObjectModel.ObservableCollection<string> strs = new System.Collections.ObjectModel.ObservableCollection<string>(); strs.Add("POSTLEVEL"); // strs.Add("TYPEAPPROVAL"); psc.GetDictionaryByCategoryArrayAsync(strs); psc.GetDictionaryByCategoryArrayCompleted += (o, e) => { if (e.Error == null) { if (e.Result != null) { //System.Collections.ObjectModel.ObservableCollection<V_Dictionary> dics =e.Result; var ents = from a in e.Result orderby a.DICTIONARYNAME ascending select a; cboPostLevel.BindData(ents.ToList(), "DICTIONARYNAME", "DICTIONARYVALUE"); SLCache.SaveData<List<V_Dictionary>>(e.Result.ToList(), path); } } }; } }
private void InitEvent() { SoaChannel = new SmtOACommonOfficeClient(); client = new PersonnelServiceClient(); FlowDesigner = new ServiceClient();//获取模块 PermissionServiceWcf = new PermissionServiceClient(); InitModelCode += new EventHandler(ModuleDefinitionControl_InitModelCode);//获取模块 FlowDesigner.GetModelNameInfosComboxAsync(); PermissionServiceWcf.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); client.GetEmployeeDetailByIDCompleted += new EventHandler<GetEmployeeDetailByIDCompletedEventArgs>(client_GetEmployeeDetailByIDCompleted); client.GetEmployeeByIDsCompleted += new EventHandler<GetEmployeeByIDsCompletedEventArgs>(client_GetEmployeeByIDsCompleted); SoaChannel.GetAgentSetBysIdCompleted += new EventHandler<GetAgentSetBysIdCompletedEventArgs>(SoaChannel_GetAgentSetBysIdCompleted); SoaChannel.UpdateAgentSetCompleted += new EventHandler<UpdateAgentSetCompletedEventArgs>(SoaChannel_UpdateAgentSetCompleted); SoaChannel.AgentSetAddCompleted += new EventHandler<AgentSetAddCompletedEventArgs>(SoaChannel_AgentSetAddCompleted); FlowDesigner.GetModelNameInfosComboxCompleted += new EventHandler<GetModelNameInfosComboxCompletedEventArgs>(GetModelNameInfosComboxCompleted);//获取模块 PermissionServiceWcf.GetSysDictionaryByCategoryCompleted += new EventHandler<GetSysDictionaryByCategoryCompletedEventArgs>(GetSysDictionaryByCategoryCompleted); }
public DictionaryComboBox() { this.Style = (Style)Application.Current.Resources["ComboBoxStyle"]; IsShowNullProperty = DependencyProperty.Register("IsShowNull", typeof(bool), typeof(DictionaryComboBox) , new PropertyMetadata(true, new PropertyChangedCallback(DictionaryComboBox.OnIsShowNullChanged))); SelectedValueProperty = DependencyProperty.Register("SelectedValue", typeof(string), typeof(DictionaryComboBox) , new PropertyMetadata("", new PropertyChangedCallback(DictionaryComboBox.OnSelectedValuePropertyChanged))); CategoryProperty = DependencyProperty.Register("Category", typeof(string), typeof(DictionaryComboBox) , new PropertyMetadata("", new PropertyChangedCallback(DictionaryComboBox.OnCategoryPropertyChanged))); EventAttention = new AutoResetEvent(false); EventFunction = new AutoResetEvent(false); EventArray[0] = EventAttention; EventArray[1] = EventFunction; Configclient = new HrCommonServiceClient(); Configclient.GetAppConfigByNameCompleted += new EventHandler<GetAppConfigByNameCompletedEventArgs>(Configclient_GetAppConfigByNameCompleted); DictionNaryclinet = new PermissionServiceClient(); DictionNaryclinet.GetSysDictionaryByCategoryCompleted += new EventHandler<GetSysDictionaryByCategoryCompletedEventArgs>(DictionNaryclinet_GetSysDictionaryByCategoryCompleted); }
private void InitParas(string menuID) { ServiceClient = new PermissionServiceClient(); //ServiceClient.SysMenuAddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_SysMenuAddCompleted); ServiceClient.SysMenuAddCompleted += new EventHandler<SysMenuAddCompletedEventArgs>(ServiceClient_SysMenuAddCompleted); ServiceClient.SysMenuUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_SysMenuUpdateCompleted); //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted); ServiceClient.GetSysMenuByIDCompleted += new EventHandler<GetSysMenuByIDCompletedEventArgs>(ServiceClient_GetSysMenuByIDCompleted); ServiceClient.GetSysDictionaryByCategoryCompleted += new EventHandler<GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); if (FormType == FormTypes.New) { SysMenu = new T_SYS_ENTITYMENU(); SysMenu.ENTITYMENUID = Guid.NewGuid().ToString(); //绑定系统类型 ServiceClient.GetSysDictionaryByCategoryAsync("SYSTEMTYPE"); //BindParentMenu(); } if (!string.IsNullOrEmpty(menuID)) { ServiceClient.GetSysMenuByIDAsync(menuID); } }
/// <summary> /// 专用与待办里打开的情况 /// </summary> /// <param name="sendDocId"></param> public AddDistrbuteForm(string sendDocId,bool isExistDel) { InitializeComponent(); DocDistrbuteClient.GetBumfDocInfoCompleted += (o,e) => { if(e.Result!=null) { V_BumfCompanySendDoc bumfDoc=e.Result; InitialForm(bumfDoc); string LoginUserID = Common.CurrentLoginUserInfo.EmployeeID; if (bumfDoc.senddoc.ISDISTRIBUTE == "0" && isExistDel && (bumfDoc.senddoc.OWNERID == LoginUserID || bumfDoc.senddoc.CREATEUSERID==LoginUserID)) { PermissionServiceClient PermClient = new PermissionServiceClient(); PermClient.GetCustomerPermissionByUserIDAndEntityCodeCompleted += (to, te) => { if (te.Result != null) { CloseTask.Visibility = Visibility.Visible; } }; PermClient.GetCustomerPermissionByUserIDAndEntityCodeAsync(Common.CurrentLoginUserInfo.SysUserID, "T_OA_SENDDOC"); } GetCompanDocInfo(bumfDoc); } }; DocDistrbuteClient.GetBumfDocInfoAsync(sendDocId); }
private void LoadEntityList() { bool isEmpty = false; CheckEntityMenuIsNullOrEmpty(out isEmpty); if (isEmpty) { if (permClient == null) { permClient = new PermissionServiceClient(); } permClient.GetSysLeftMenuAsync("0", SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); permClient.GetSysLeftMenuCompleted += new EventHandler<GetSysLeftMenuCompletedEventArgs>(permClient_GetSysLeftMenuCompleted); } InitEntityInfoForComboBox(); }
/// <summary> /// 启动与工作流程相同类型流程,查询对应节点用户 /// </summary> /// <param name="CompanyID">公司ID</param> /// <param name="ModelCode">模块代码</param> /// <param name="FlowGUID">待审批流GUID,新增时为空或者为StartFlow</param> /// <returns></returns> public DataResult GetAppUser(OracleConnection con, string CompanyID, string ModelCode, string FlowGUID, string xml) { DataResult GetAppUserResult = new DataResult(); try { string StateName = null; if (FlowGUID == "" || FlowGUID == "StartFlow") { StateName = "StartFlow"; } else { //根据待审批流程GUID,检索待审批状态节点代码 List<FLOW_FLOWRECORDDETAIL_T> FlowRecord = FlowBLL2.GetFlowInfo(con, "", FlowGUID, "", "", "", "", "", null); if (FlowRecord == null) { GetAppUserResult.Err = "没有待处理的审核"; GetAppUserResult.UserInfo = null; return GetAppUserResult; } StateName = FlowRecord[0].STATECODE; } //根据公司ID,模块代码获取配置的流程 WorkflowInstance instance = null; LogHelper.WriteLog("根据公司ID,模块代码获取配置的流程FlowBLL2.GetFlowByModelName:OgrType='0'"); List<FLOW_MODELFLOWRELATION_T> MODELFLOWRELATION = FlowBLL2.GetFlowByModelName(con, CompanyID, "", ModelCode, "0"); if (MODELFLOWRELATION == null || MODELFLOWRELATION.Count == 0) { GetAppUserResult.Err = "没有可使用的流程"; GetAppUserResult.UserInfo = null; return GetAppUserResult; } FLOW_FLOWDEFINE_T Xoml = MODELFLOWRELATION[0].FLOW_FLOWDEFINE_T; XmlReader readerxoml, readerule; StringReader strXoml = new StringReader(Xoml.XOML); StringReader strRules = new StringReader(Xoml.RULES == null ? "" : Xoml.RULES); readerxoml = XmlReader.Create(strXoml); readerule = XmlReader.Create(strRules); WorkflowRuntime workflowRuntime = new WorkflowRuntime(); workflowRuntime.StartRuntime(); FlowEvent ExternalEvent = new FlowEvent(); ExternalDataExchangeService objService = new ExternalDataExchangeService(); workflowRuntime.AddService(objService); objService.AddService(ExternalEvent); TypeProvider typeProvider = new TypeProvider(null); workflowRuntime.AddService(typeProvider); //XmlReader readerxoml = XmlReader.Create(HttpContext.Current.Server.MapPath ("TestFlow.xml")); // instance = workflowRuntime.CreateWorkflow(readerxoml); if (Xoml.RULES == null) instance = workflowRuntime.CreateWorkflow(readerxoml); else instance = workflowRuntime.CreateWorkflow(readerxoml, readerule, null); // instance = workflowRuntime.CreateWorkflow(typeof(TestFlow)); instance.Start(); StateMachineWorkflowInstance workflowinstance = new StateMachineWorkflowInstance(workflowRuntime, instance.InstanceId); //从实例中获取定义 if (1 == 2) { System.Workflow.Activities.StateMachineWorkflowActivity smworkflow = new StateMachineWorkflowActivity(); smworkflow = workflowinstance.StateMachineWorkflow; RuleDefinitions ruleDefinitions = smworkflow.GetValue(RuleDefinitions.RuleDefinitionsProperty) as RuleDefinitions; WorkflowMarkupSerializer markupSerializer = new WorkflowMarkupSerializer(); StringBuilder xoml = new StringBuilder(); StringBuilder rule = new StringBuilder(); XmlWriter xmlWriter = XmlWriter.Create(xoml); XmlWriter ruleWriter = XmlWriter.Create(rule); markupSerializer.Serialize(xmlWriter, smworkflow); markupSerializer.Serialize(ruleWriter, ruleDefinitions); xmlWriter.Close(); ruleWriter.Close(); StringReader readxoml = new StringReader(xoml.ToString()); StringReader readrule = new StringReader(rule.ToString()); XmlReader readerxoml2 = XmlReader.Create(readxoml); XmlReader readerrule2 = XmlReader.Create(readrule); WorkflowInstance instance1 = workflowRuntime.CreateWorkflow(readerxoml2, readerrule2, null); instance1.Start(); StateMachineWorkflowInstance workflowinstance1 = new StateMachineWorkflowInstance(workflowRuntime, instance1.InstanceId); workflowinstance1.SetState(StateName); } //从实例中获取定义并启动新实例 //跳转到节点StateName workflowinstance.SetState(StateName); FlowDataType.FlowData FlowData = new FlowDataType.FlowData(); FlowData.xml = xml; // FlowData.Flow_FlowRecord_T = null; ExternalEvent.OnDoFlow(instance.InstanceId, FlowData);//激发流程引擎流转到下一状态 System.Threading.Thread.Sleep(1000); PermissionServiceClient WcfPermissionService = new PermissionServiceClient(); string CurrentStateName = workflowinstance.CurrentStateName == null ? "End" : workflowinstance.CurrentStateName; //取得当前状态 List<UserInfo> listUser = new List<UserInfo>(); if (CurrentStateName != "End") { if (CurrentStateName.Substring(0, 5) == "State") { CurrentStateName = CurrentStateName.Substring(5); } string WFCurrentStateName = new Guid(CurrentStateName).ToString("D"); T_SYS_USER[] User = WcfPermissionService.GetSysUserByRole(WFCurrentStateName); //检索本状态(角色)对应用户 if (User != null) for (int i = 0; i < User.Length; i++) { UserInfo tmp = new UserInfo(); tmp.UserID = User[i].EMPLOYEEID; tmp.UserName = User[i].EMPLOYEENAME; listUser.Add(tmp); } } else { //已经到流程结束状态 UserInfo tmp = new UserInfo(); tmp.UserID = "End"; tmp.UserName = "******"; listUser.Add(tmp); } GetAppUserResult.UserInfo = listUser.Count > 0 ? listUser : null; if (GetAppUserResult.UserInfo == null) GetAppUserResult.Err = "没有找到用户"; return GetAppUserResult; // return listUser; //return workflowinstance.CurrentStateName == null ? "End" : workflowinstance.CurrentStateName; } catch (Exception ex) { GetAppUserResult.Err = ex.Message; GetAppUserResult.UserInfo = null; return GetAppUserResult; } }
protected static PermissionServiceClient ServiceClient = new PermissionServiceClient();//龙康才新增 // protected PermissionServiceClient ServiceClient; //private SysRoleManagementServiceClient SysRoleClient = new SysRoleManagementServiceClient(); private void InitControlEvent() { ServiceClient = new PermissionServiceClient(); ServiceClient.SysRoleBatchDelCompleted += new EventHandler<SysRoleBatchDelCompletedEventArgs>(SysRoleClient_SysRoleBatchDelCompleted); ServiceClient.GetSysDictionaryByCategoryCompleted+=new EventHandler<GetSysDictionaryByCategoryCompletedEventArgs>(ServiceClient_GetSysDictionaryByCategoryCompleted); //ServiceClient.GetSysRoleInfosPagingCompleted += new EventHandler<GetSysRoleInfosPagingCompletedEventArgs>(ServiceClient_GetSysRoleInfosPagingCompleted); ServiceClient.GetSysRoleInfosPagingByCompanyIDsCompleted += new EventHandler<GetSysRoleInfosPagingByCompanyIDsCompletedEventArgs>(ServiceClient_GetSysRoleInfosPagingByCompanyIDsCompleted); //绑定系统类型 DictManager.OnDictionaryLoadCompleted += new EventHandler<OnDictionaryLoadArgs>(DictManager_OnDictionaryLoadCompleted); }
private void BtnView_Click(object sender, RoutedEventArgs e) { SMT.Saas.Tools.PermissionWS.PermissionServiceClient ps = new PermissionServiceClient(); ps.GetFlowUserInfoByRoleIDAsync("fbce7ce8-7e45-4bd9-93db-69f40d0a4d47"); if (SelectRole != null) { if (!string.IsNullOrEmpty(SelectRole.ROLEID)) { Form.SysRoleForms editForm = new SMT.SaaS.Permission.UI.Form.SysRoleForms(FormTypes.Browse, SelectRole.ROLEID); EntityBrowser browser = new EntityBrowser(editForm); browser.MinHeight = 300; browser.MinWidth = 400; browser.FormType = FormTypes.Browse; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTRECORDER"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTRECORDER"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } }
public void InitPara() { try { PARENT.Children.Add(loadbar); loadbar.Start(); DictManager.OnDictionaryLoadCompleted += new EventHandler<OnDictionaryLoadArgs>(DictManager_OnDictionaryLoadCompleted); client = new SMT.Saas.Tools.PersonnelWS.PersonnelServiceClient(); client.GetEmployeePagingCompleted += new EventHandler<GetEmployeePagingCompletedEventArgs>(client_GetEmployeePagingCompleted); //client.GetEmployeesWithOutPermissionsCompleted += new EventHandler<GetEmployeesWithOutPermissionsCompletedEventArgs>(client_GetEmployeesWithOutPermissionsCompleted); client.GetEmployeeViewsPagingCompleted += new EventHandler<GetEmployeeViewsPagingCompletedEventArgs>(client_GetEmployeeViewsPagingCompleted); client.EmployeeDeleteCompleted += new EventHandler<EmployeeDeleteCompletedEventArgs>(client_EmployeeDeleteCompleted); //client.GetEmployeeViewsActivedPagingCompleted += new EventHandler<GetEmployeeViewsActivedPagingCompletedEventArgs>(client_GetEmployeeViewsActivedPagingCompleted); permclient = new PermissionServiceClient(); permclient.GetUserByEmployeeIDCompleted += new EventHandler<Saas.Tools.PermissionWS.GetUserByEmployeeIDCompletedEventArgs>(permclient_GetUserByEmployeeIDCompleted); //this.Loaded += new RoutedEventHandler(Employee_Loaded); } catch (Exception ex) { SMT.SAAS.Application.ExceptionManager.SendException("用户管理", "SysUserManagement", "Views/SysUserManagement", "SysUserManagement", ex); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message)); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } }
/// <summary> /// 根据传回的XML,添加出差申请信息 /// </summary>====暂不使用=== /// <param name="xele"></param> //public string TravelmanagementAddFromEngine(string strXml) //{ // //bool SaveLock = true;//奇怪的问题,下面的运行导致乱序,此乃无法解决的暂缓之道<==坑爹,没用 // try // { // string strEmployeeID = string.Empty; // string strOwnerID = string.Empty; // string strOwnerPostID = string.Empty; // string strOwnerDepartmentID = string.Empty; // string strOwnerCompanyID = string.Empty; // string strClaimsWereName = string.Empty; // string strCheckState = string.Empty; // string strTEL = string.Empty; // string strBusinesStripId = string.Empty; // StringReader strRdr = new StringReader(strXml); // XmlReader xr = XmlReader.Create(strRdr); // while (xr.Read()) // { // if (xr.NodeType == XmlNodeType.Element) // { // string elementName = xr.Name; // if (elementName == "Paras" || elementName == "System") // { // while (xr.Read()) // { // string type = xr.NodeType.ToString(); // #region // if (xr["Name"] != null) // { // if (xr["Name"].ToUpper() == "OWNERPOSTID") // { // strOwnerPostID = xr["Value"]; // } // if (xr["Name"].ToUpper() == "OWNERID") // { // strOwnerID = xr["Value"]; // } // if (xr["Name"].ToUpper() == "OWNERDEPARTMENTID") // { // strOwnerDepartmentID = xr["Value"]; // } // if (xr["Name"].ToUpper() == "OWNERCOMPANYID") // { // strOwnerCompanyID = xr["Value"]; // } // if (xr["Name"].ToUpper() == "BUSINESSTRIPID") // { // strBusinesStripId = xr["Value"]; // } // } // #endregion // } // } // } // } // string ff = strBusinesStripId; // //Byte[] b = System.Text.UTF8Encoding.UTF8.GetBytes(strXml); // //XElement xele = XElement.Load(System.Xml.XmlReader.Create(new MemoryStream(b))); // //var eGFunc = from c in xele.Descendants("Para") // // select c; // //if (eGFunc.Count() == 0) // //{ // // return ""; // //} // //Tracer.Debug("TravelmanagementAdd+++++333333333333333333333333333"); // //#region // ////foreach (var q in eGFunc) // //var tempXml = eGFunc.ToArray(); // //for (int j = 0; j < eGFunc.Count();j++ ) // //{ // // var q = tempXml[j]; // // string strName = q.Attribute("Name").Value; // // switch (strName) // // { // // case "CREATEUSERID": // // strEmployeeID = q.Attribute("Value").Value; // // break; // // case "OWNERID": // // strOwnerID = q.Attribute("Value").Value; // // break; // // case "OWNERPOSTID": // // strOwnerPostID = q.Attribute("Value").Value; // // break; // // case "OWNERDEPARTMENTID": // // strOwnerDepartmentID = q.Attribute("Value").Value; // // break; // // case "OWNERCOMPANYID": // // strOwnerCompanyID = q.Attribute("Value").Value; // // break; // // case "CLAIMSWERENAME": // // strClaimsWereName = q.Attribute("Value").Value; // // break; // // case "CHECKSTATE": // // strCheckState = q.Attribute("Value").Value; // // break; // // case "TEL": // // strTEL = q.Attribute("Value").Value; // // break; // // case "BUSINESSTRIPID": // // strBusinesStripId = q.Attribute("Value").Value; // // break; // // } // //} // //#endregion // //Tracer.Debug("TravelmanagementAdd+++++++++++++777777777777777777777777777777"); // //SmtOAPersonOffice doc = new SmtOAPersonOffice(); // //string employeeid = strEmployeeID.Replace("{", "").Replace("}", ""); // //Tracer.Debug("TravelmanagementAdd+++++++++++++11118888" + strBusinesStripId); // T_OA_BUSINESSTRIP buip = doc.GetTravelmanagementById(strBusinesStripId); // //Tracer.Debug("TravelmanagementAdd+++++++++++++8888"+buip.OWNERID); // T_OA_TRAVELREIMBURSEMENT entity = new T_OA_TRAVELREIMBURSEMENT(); // //Tracer.Debug("We got businessid id " + buip.BUSINESSTRIPID); // entity.TRAVELREIMBURSEMENTID = Guid.NewGuid().ToString(); // Tracer.Debug("We got reimbursement id " + entity.TRAVELREIMBURSEMENTID); // entity.T_OA_BUSINESSTRIP = buip; // entity.T_OA_BUSINESSTRIP.BUSINESSTRIPID = buip.BUSINESSTRIPID; // entity.CLAIMSWERE = buip.OWNERID; // entity.CLAIMSWERENAME = buip.OWNERNAME; // entity.REIMBURSEMENTTIME = DateTime.Now; // entity.CHECKSTATE = "0"; // entity.TEL = buip.TEL; // entity.CREATEDATE = buip.UPDATEDATE; // entity.OWNERID = buip.OWNERID; // entity.OWNERNAME = buip.OWNERNAME; // entity.OWNERPOSTID = buip.OWNERPOSTID; // entity.OWNERDEPARTMENTID = buip.OWNERDEPARTMENTID; // entity.OWNERCOMPANYID = buip.OWNERCOMPANYID; // entity.CREATEUSERID = buip.CREATEUSERID; // entity.CREATEUSERNAME = buip.CREATEUSERNAME; // entity.CREATEPOSTID = buip.CREATEPOSTID; // entity.CREATEDEPARTMENTID = buip.CREATEDEPARTMENTID; // entity.CREATECOMPANYID = buip.CREATECOMPANYID; // //Tracer.Debug("TravelmanagementAdd+++++++++++++GGGGGGGGGGGGGGGGGGGGGGGGGGGGG"); // //添加子表数据 // emp = cinet.GetEmployeeDetailViewByID(entity.OWNERID);//根据员工ID查询出岗位级别 // postLevel = emp.EMPLOYEEPOSTS.Where(s => s.POSTID == buip.OWNERPOSTID).FirstOrDefault().POSTLEVEL.ToString();//获取出差人的岗位级别 // companyId = emp.EMPLOYEEPOSTS.Where(s => s.CompanyID == buip.OWNERCOMPANYID).FirstOrDefault().CompanyID.ToString();//获取出差人的所属公司 // //Tracer.Debug("TravelmanagementAdd+++++++++++++zzzzzzzzzzzzzzzzzzzzzzzzG"); // T_OA_TRAVELSOLUTIONS travelsolutions = doc.GetTravelSolutionByCompanyID(entity.OWNERCOMPANYID, ref PlaneObj, ref StandardObj);//出差方案 // if (travelsolutions != null) // { // solutionID = travelsolutions.TRAVELSOLUTIONSID;//出差方案ID // } // List<T_OA_BUSINESSTRIPDETAIL> TravelDetail = doc.GetBusinesstripDetail(strBusinesStripId); // List<T_OA_REIMBURSEMENTDETAIL> TrDetail = new List<T_OA_REIMBURSEMENTDETAIL>();//出差报销子表 // List<string> cityscode = new List<string>(); // double BusinessDays = 0; // int i = 0; // double total = 0; // //Tracer.Debug("TravelmanagementAdd+++++++++++++EEEEEEEEEEEEEEEEEEEEE"); // #region // //foreach (var detail in TravelDetail) // for (int j = 0; j < TravelDetail.Count(); j++) // { // var detail = TravelDetail[i]; // i++; // double toodays = 0; // //计算本次出差的时间 // List<string> list = new List<string> // { // detail.BUSINESSDAYS // }; // if (detail.BUSINESSDAYS != null) // { // double totalHours = System.Convert.ToDouble(list[0]); // BusinessDays += totalHours;//总天数 // toodays = totalHours;//单条数据的天数 // } // double tresult = toodays;//计算本次出差的总天数 // T_OA_REIMBURSEMENTDETAIL TrListInfo = new T_OA_REIMBURSEMENTDETAIL(); // TrListInfo.REIMBURSEMENTDETAILID = Guid.NewGuid().ToString(); // TrListInfo.STARTDATE = detail.STARTDATE;//开始时间 // TrListInfo.ENDDATE = detail.ENDDATE;//结束时间 // TrListInfo.BUSINESSDAYS = detail.BUSINESSDAYS;//出差天数 // TrListInfo.DEPCITY = detail.DEPCITY;//出发城市 // TrListInfo.DESTCITY = detail.DESTCITY;//目标城市 // TrListInfo.PRIVATEAFFAIR = detail.PRIVATEAFFAIR;//是否私事 // TrListInfo.GOOUTTOMEET = detail.GOOUTTOMEET;//外出开会 // TrListInfo.COMPANYCAR = detail.COMPANYCAR;//公司派车 // TrListInfo.TYPEOFTRAVELTOOLS = detail.TYPEOFTRAVELTOOLS;//交通工具类型 // TrListInfo.TAKETHETOOLLEVEL = detail.TAKETHETOOLLEVEL;//交通工具级别 // TrListInfo.CREATEDATE = Convert.ToDateTime(buip.UPDATEDATE);//创建时间 // TrListInfo.CREATEUSERNAME = buip.CREATEUSERNAME;//创建人 // cityscode.Add(TrListInfo.DESTCITY); // T_OA_AREAALLOWANCE entareaallowance = new T_OA_AREAALLOWANCE(); // string cityValue = cityscode[i - 1];//目标城市值 // entareaallowance = GetAllowanceByCityValue(cityValue); // #region 根据本次出差的总天数,根据天数获取相应的补贴 // if (travelsolutions != null) // { // if (tresult <= int.Parse(travelsolutions.MINIMUMINTERVALDAYS))//本次出差总时间小于等于设定天数的报销标准 // { // if (entareaallowance != null) // { // if (detail.BUSINESSDAYS != null) // { // if (detail.PRIVATEAFFAIR == "1")//如果是私事不予报销 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0;//交通补贴 // } // else if (detail.GOOUTTOMEET == "1" || detail.COMPANYCAR == "1")//如果是开会或者是公司派车,交通费没有 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // else // { // if (int.Parse(postLevel) > 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // if (entareaallowance.TRANSPORTATIONSUBSIDIES != null) // { // TrListInfo.TRANSPORTATIONSUBSIDIES = decimal.Parse((Convert.ToDouble(entareaallowance.TRANSPORTATIONSUBSIDIES) * toodays).ToString()); // } // } // else // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // } // } // if (detail.BUSINESSDAYS != null) // { // if (detail.PRIVATEAFFAIR == "1")//餐费补贴 // { // TrListInfo.MEALSUBSIDIES = 0; // } // else if (detail.GOOUTTOMEET == "1")//如果是开会 // { // TrListInfo.MEALSUBSIDIES = 0; // } // else // { // if (int.Parse(postLevel) > 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // TrListInfo.MEALSUBSIDIES = decimal.Parse((Convert.ToDouble(entareaallowance.MEALSUBSIDIES) * toodays).ToString()); // } // else // { // TrListInfo.MEALSUBSIDIES = 0; // } // } // } // } // } // else // { // if (int.Parse(postLevel) <= 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // TrListInfo.MEALSUBSIDIES = 0; // } // } // } // #endregion // #region 如果出差天数大于设定的最大天数,按驻外标准获取补贴 // if (travelsolutions != null) // { // if (tresult > int.Parse(travelsolutions.MAXIMUMRANGEDAYS)) // { // if (entareaallowance != null) // { // double DbTranceport = Convert.ToDouble(entareaallowance.TRANSPORTATIONSUBSIDIES); // double DbMeal = Convert.ToDouble(entareaallowance.MEALSUBSIDIES); // double tfSubsidies = Convert.ToDouble(entareaallowance.TRANSPORTATIONSUBSIDIES) * (Convert.ToDouble(travelsolutions.INTERVALRATIO) / 100); // double mealSubsidies = Convert.ToDouble(entareaallowance.MEALSUBSIDIES) * (Convert.ToDouble(travelsolutions.INTERVALRATIO) / 100); // if (detail.BUSINESSDAYS != null) // { // if (detail.PRIVATEAFFAIR == "1")//如果是私事不予报销 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // else if (detail.GOOUTTOMEET == "1" || detail.COMPANYCAR == "1")//如果是开会或者是公司派车,交通费没有 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // else // { // if (int.Parse(postLevel) > 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // double minmoney = Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS) * DbTranceport; // double middlemoney = (Convert.ToDouble(travelsolutions.MAXIMUMRANGEDAYS) - Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS)) * tfSubsidies; // double lastmoney = (tresult - Convert.ToDouble(travelsolutions.MAXIMUMRANGEDAYS)) * Convert.ToDouble(entareaallowance.OVERSEASSUBSIDIES); // TrListInfo.TRANSPORTATIONSUBSIDIES = decimal.Parse((minmoney + middlemoney + lastmoney).ToString()); // } // else // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // } // } // if (detail.BUSINESSDAYS != null) // { // if (detail.PRIVATEAFFAIR == "1")//如果是私事不予报销 // { // TrListInfo.MEALSUBSIDIES = 0; // } // else if (detail.GOOUTTOMEET == "1")//如果是开会 // { // TrListInfo.MEALSUBSIDIES = 0; // } // else // { // if (int.Parse(postLevel) > 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // double minmoney = Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS) * DbMeal; // double middlemoney = (Convert.ToDouble(travelsolutions.MAXIMUMRANGEDAYS) - Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS)) * mealSubsidies; // double lastmoney = (tresult - Convert.ToDouble(travelsolutions.MAXIMUMRANGEDAYS)) * Convert.ToDouble(entareaallowance.OVERSEASSUBSIDIES); // TrListInfo.MEALSUBSIDIES = decimal.Parse((minmoney + middlemoney + lastmoney).ToString()); // } // else // { // TrListInfo.MEALSUBSIDIES = 0; // } // } // } // } // } // else // { // if (int.Parse(postLevel) <= 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // TrListInfo.MEALSUBSIDIES = 0; // } // } // } // #endregion // #region 如果出差时间大于设定的最小天数并且小于设定的最大天数的报销标准 // if (travelsolutions != null) // { // if (tresult >= Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS) && tresult <= Convert.ToDouble(travelsolutions.MAXIMUMRANGEDAYS)) // { // if (entareaallowance != null) // { // double DbTranceport = Convert.ToDouble(entareaallowance.TRANSPORTATIONSUBSIDIES); // double DbMeal = Convert.ToDouble(entareaallowance.MEALSUBSIDIES); // double tfSubsidies = Convert.ToDouble(entareaallowance.TRANSPORTATIONSUBSIDIES) * (Convert.ToDouble(travelsolutions.INTERVALRATIO) / 100); // double mealSubsidies = Convert.ToDouble(entareaallowance.MEALSUBSIDIES) * (Convert.ToDouble(travelsolutions.INTERVALRATIO) / 100); // if (detail.BUSINESSDAYS != null) // { // if (detail.PRIVATEAFFAIR == "1")//如果是私事不予报销 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // else if (detail.GOOUTTOMEET == "1" || detail.COMPANYCAR == "1")//如果是开会或者是公司派车,交通费没有 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // else // { // if (int.Parse(postLevel) > 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // double minmoney = Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS) * DbTranceport; // double middlemoney = (tresult - Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS)) * tfSubsidies; // TrListInfo.TRANSPORTATIONSUBSIDIES = decimal.Parse((minmoney + middlemoney).ToString()); // } // else // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // } // } // } // if (detail.BUSINESSDAYS != null) // { // if (detail.PRIVATEAFFAIR == "1")//如果是私事不予报销 // { // TrListInfo.MEALSUBSIDIES = 0; // } // else if (detail.GOOUTTOMEET == "1")//如果是开会 // { // TrListInfo.MEALSUBSIDIES = 0; // } // else // { // if (int.Parse(postLevel) > 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // //最小区间段金额 // double minmoney = Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS) * DbMeal; // //中间区间段金额 // double middlemoney = (tresult - Convert.ToDouble(travelsolutions.MINIMUMINTERVALDAYS)) * mealSubsidies; // TrListInfo.MEALSUBSIDIES = decimal.Parse((minmoney + middlemoney).ToString()); // } // else // { // TrListInfo.MEALSUBSIDIES = 0; // } // } // } // } // } // else // { // if (int.Parse(postLevel) <= 8)//当前用户的岗位级别小于副部长及以上级别的补贴标准 // { // TrListInfo.TRANSPORTATIONSUBSIDIES = 0; // TrListInfo.MEALSUBSIDIES = 0; // } // } // } // total += Convert.ToDouble(TrListInfo.TRANSPORTATIONSUBSIDIES + TrListInfo.MEALSUBSIDIES); // entity.THETOTALCOST = decimal.Parse(total.ToString());//差旅费用总和 // entity.REIMBURSEMENTOFCOSTS = decimal.Parse(total.ToString());//报销费用总和 // #endregion // TrDetail.Add(TrListInfo); // } // #endregion // Tracer.Debug("TravelmanagementAdd+++++++++++++WWWWWWWWWWWW"); // string result = BusinessDays.ToString(); //计算本次出差的总时间,超过24小时天数加1 // entity.COMPUTINGTIME = result;//总时间 // //if (SaveLock) // //{ // // Tracer.Debug("测试保存-" + entity.TRAVELREIMBURSEMENTID); // // doc.TravelReimbursementAdd(entity, TrDetail); // // SaveLock = false; // //} // Tracer.Debug("测试保存outter-" + entity.TRAVELREIMBURSEMENTID); // //AddTravelreimbursementOnce(entity, TrDetail); // //BLLCommonServices.EngineConfigWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient(); // //EngineWS.CustomUserMsg[] user = new EngineWS.CustomUserMsg[1]; // //user[0] = new EngineWS.CustomUserMsg() { UserID = entity.OWNERID, FormID = entity.TRAVELREIMBURSEMENTID }; // //Dictionary<string, string> dic = new Dictionary<string, string>(); // //dic.Add("BUSINESSTRIPID", buip.BUSINESSTRIPID); // //Client.ApplicationMsgTrigger(user, "OA", "T_OA_TRAVELREIMBURSEMENT", Utility.ObjListToXml<T_OA_TRAVELREIMBURSEMENT>(entity, dic, "OA", null), EngineWS.MsgType.Task); // return entity.TRAVELREIMBURSEMENTID; // } // catch (Exception e) // { // string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]"; // Tracer.Debug(abc); // return abc; // } //} #endregion //#region 根据传回的XML,添加出差报告信息 ///// <summary> ///// 根据传回的XML,添加出差报告信息 ///// </summary> ///// <param name="xele"></param> //private static string MissionReportsAdd(IEnumerable<XElement> eGFunc) //{ // try // { // if (eGFunc.Count() == 0) // { // return ""; // } // string strEmployeeID = string.Empty; // string strOwnerID = string.Empty; // string strOwnerPostID = string.Empty; // string strOwnerDepartmentID = string.Empty; // string strOwnerCompanyID = string.Empty; // string strContent = string.Empty; // string strCheckState = string.Empty; // string strOwnerName = string.Empty; // string strTel = string.Empty; // string strBusinesStripId = string.Empty; // foreach (var q in eGFunc) // { // string strName = q.Attribute("Name").Value; // switch (strName) // { // case "CREATEUSERID": // strEmployeeID = q.Attribute("Value").Value; // break; // case "OWNERID": // strOwnerID = q.Attribute("Value").Value; // break; // case "OWNERPOSTID": // strOwnerPostID = q.Attribute("Value").Value; // break; // case "OWNERDEPARTMENTID": // strOwnerDepartmentID = q.Attribute("Value").Value; // break; // case "OWNERCOMPANYID": // strOwnerCompanyID = q.Attribute("Value").Value; // break; // case "CONTENT": // strContent = q.Attribute("Value").Value; // break; // case "CHECKSTATE": // strCheckState = q.Attribute("Value").Value; // break; // case "OWNERNAME": // strOwnerName = q.Attribute("Value").Value; // break; // case "TEL": // strTel = q.Attribute("Value").Value; // break; // case "BUSINESSTRIPID": // strBusinesStripId = q.Attribute("Value").Value; // break; // } // } // SmtOAPersonOffice doc = new SmtOAPersonOffice(); // string employeeid = strEmployeeID.Replace("{", "").Replace("}", ""); // T_OA_BUSINESSTRIP buip = doc.GetTravelmanagementById(strBusinesStripId); // T_OA_BUSINESSREPORT entity = new T_OA_BUSINESSREPORT(); // entity.BUSINESSREPORTID = Guid.NewGuid().ToString(); // entity.T_OA_BUSINESSTRIP = buip; // entity.T_OA_BUSINESSTRIP.BUSINESSTRIPID = buip.BUSINESSTRIPID; // entity.CHECKSTATE = "0"; // entity.CREATEDATE = buip.UPDATEDATE; // entity.OWNERID = buip.OWNERID; // entity.OWNERNAME = buip.OWNERNAME; // entity.OWNERPOSTID = buip.OWNERPOSTID; // entity.OWNERDEPARTMENTID = buip.OWNERDEPARTMENTID; // entity.OWNERCOMPANYID = buip.OWNERCOMPANYID; // entity.CREATEUSERID = buip.CREATEUSERID; // entity.CREATEUSERNAME = buip.CREATEUSERNAME; // entity.CREATEPOSTID = buip.CREATEPOSTID; // entity.CREATEDEPARTMENTID = buip.CREATEDEPARTMENTID; // entity.CREATECOMPANYID = buip.CREATECOMPANYID; // //entity.CONTENT = buip.CONTENT; // entity.TEL = buip.TEL; // //添加子表数据 // List<T_OA_BUSINESSTRIPDETAIL> TravelDetail = doc.GetBusinesstripDetail(strBusinesStripId); // List<T_OA_BUSINESSREPORTDETAIL> ReportDetail = new List<T_OA_BUSINESSREPORTDETAIL>();//出差报告从表 // T_OA_TRAVELSOLUTIONS travelsolutions = doc.GetTravelSolutionByCompanyID(entity.OWNERCOMPANYID, ref PlaneObj, ref StandardObj);//出差方案 // foreach (var detail in TravelDetail) // { // T_OA_BUSINESSREPORTDETAIL RepotDetailInfo = new T_OA_BUSINESSREPORTDETAIL(); // RepotDetailInfo.BUSINESSREPORTDETAILID = Guid.NewGuid().ToString(); // RepotDetailInfo.DEPCITY = detail.DEPCITY;//出发城市 // RepotDetailInfo.DESTCITY = detail.DESTCITY;//到达城市 // RepotDetailInfo.STARTDATE = detail.STARTDATE;//出发时间 // RepotDetailInfo.ENDDATE = detail.ENDDATE;//到达时间 // RepotDetailInfo.PRIVATEAFFAIR = detail.PRIVATEAFFAIR;//是否私事 // RepotDetailInfo.GOOUTTOMEET = detail.GOOUTTOMEET;//是否是开会 // RepotDetailInfo.COMPANYCAR = detail.COMPANYCAR;//公司派车 // RepotDetailInfo.TYPEOFTRAVELTOOLS = detail.TYPEOFTRAVELTOOLS;//交通工具类型 // RepotDetailInfo.TAKETHETOOLLEVEL = detail.TAKETHETOOLLEVEL;//交通工具级别 // ReportDetail.Add(RepotDetailInfo); // } // doc.MissionReportsAdd(entity, ReportDetail); // BLLCommonServices.EngineConfigWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient(); // EngineWS.CustomUserMsg[] user = new EngineWS.CustomUserMsg[1]; // user[0] = new EngineWS.CustomUserMsg() { UserID = entity.OWNERID, FormID = entity.BUSINESSREPORTID }; // Dictionary<string, string> dic = new Dictionary<string, string>(); // dic.Add("BUSINESSTRIPID", buip.BUSINESSTRIPID); // Client.ApplicationMsgTrigger(user, "OA", "T_OA_BUSINESSREPORT", Utility.ObjListToXml<T_OA_BUSINESSREPORT>(entity, dic, "OA", null), EngineWS.MsgType.Task); // return entity.BUSINESSREPORTID; // } // catch (Exception e) // { // string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]"; // Tracer.Debug(abc); // return abc; // } //} //#endregion #region 城市值转换 private static string GetCityName(string cityvalue) { try { CityName.PermissionServiceClient PS = new PermissionServiceClient(); List<T_SYS_DICTIONARY> ListDnary = PS.GetSysDictionaryByCategory("CITY").ToList(); var ents = from a in ListDnary where a.DICTIONARYVALUE == Convert.ToDecimal(cityvalue) select new { DICTIONARYNAME = a.DICTIONARYNAME, DICTIONARYVALUE = a.DICTIONARYVALUE }; return ents.Count() > 0 ? ents.FirstOrDefault().DICTIONARYNAME : string.Empty; } catch { return string.Empty; } }
private static string AddApprovalInfo(IEnumerable<XElement> eGFunc) { try { string StrResult = string.Empty; if (eGFunc.Count() == 0) { return StrResult; } string strEmployeeID = string.Empty; string strOwnerID = string.Empty; string strOwnerPostID = string.Empty; string strOwnerDepartmentID = string.Empty; string strOwnerCompanyID = string.Empty; foreach (var q in eGFunc) { string strName = q.Attribute("Name").Value; switch (strName) { case "CREATEUSERID": strEmployeeID = q.Attribute("Value").Value; break; case "OWNERID": strOwnerID = q.Attribute("Value").Value; break; case "OWNERPOSTID": strOwnerPostID = q.Attribute("Value").Value; break; case "OWNERDEPARTMENTID": strOwnerDepartmentID = q.Attribute("Value").Value; break; case "OWNERCOMPANYID": strOwnerCompanyID = q.Attribute("Value").Value; break; } } SmtOAPersonOffice person = new SmtOAPersonOffice(); PermissionServiceClient client = new PermissionServiceClient(); string employeeid = strEmployeeID.Replace("{", "").Replace("}", ""); T_OA_APPROVALINFO entity = new T_OA_APPROVALINFO(); entity.APPROVALID = Guid.NewGuid().ToString(); List<string> liststr = new List<string>(); liststr = person.GetApprovalTypeByCompanyandDepartmentid(strOwnerCompanyID, strOwnerDepartmentID); if (liststr.Count() > 0) entity.TYPEAPPROVAL = liststr[0]; else StrResult = ""; entity.APPROVALCODE = "BPJ" + DateTime.Now.ToString("yyyyMMdd"); entity.CREATEDATE = DateTime.Now; entity.OWNERID = strOwnerID; entity.OWNERPOSTID = strOwnerPostID; entity.OWNERDEPARTMENTID = strOwnerDepartmentID; entity.OWNERCOMPANYID = strOwnerCompanyID; entity.CREATEUSERID = strOwnerID; entity.CREATEPOSTID = strOwnerPostID; entity.CREATEDEPARTMENTID = strOwnerDepartmentID; entity.CREATECOMPANYID = strOwnerCompanyID; int i = person.AddApporval(entity, ref StrResult); if (i > 0) { StrResult = entity.APPROVALID; } return StrResult; } catch (Exception e) { string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]"; Tracer.Debug(abc); return abc; } }
public void InitPara() { try { PARENT.Children.Add(loadbar); loadbar.Start(); DictManager.OnDictionaryLoadCompleted += new EventHandler<OnDictionaryLoadArgs>(DictManager_OnDictionaryLoadCompleted); client = new SMT.Saas.Tools.PersonnelWS.PersonnelServiceClient(); client.GetEmployeePagingCompleted += new EventHandler<GetEmployeePagingCompletedEventArgs>(client_GetEmployeePagingCompleted); //client.GetEmployeesWithOutPermissionsCompleted += new EventHandler<GetEmployeesWithOutPermissionsCompletedEventArgs>(client_GetEmployeesWithOutPermissionsCompleted); // client.GetEmployeeViewsPagingCompleted+=new EventHandler<GetEmployeeViewsPagingCompletedEventArgs>(client_GetEmployeeViewsPagingCompleted); client.GetEmployeeViewsWithOutPermissionsCompleted += new EventHandler<GetEmployeeViewsWithOutPermissionsCompletedEventArgs>(client_GetEmployeeViewsWithOutPermissionsCompleted); client.EmployeeDeleteCompleted += new EventHandler<EmployeeDeleteCompletedEventArgs>(client_EmployeeDeleteCompleted); orgClient = new SMT.Saas.Tools.OrganizationWS.OrganizationServiceClient(); orgClient.GetCompanyActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetCompanyActivedCompletedEventArgs>(orgClient_GetCompanyActivedCompleted); orgClient.GetDepartmentActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetDepartmentActivedCompletedEventArgs>(orgClient_GetDepartmentActivedCompleted); orgClient.GetPostActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetPostActivedCompletedEventArgs>(orgClient_GetPostActivedCompleted); permclient = new PermissionServiceClient(); permclient.GetUserByEmployeeIDCompleted += new EventHandler<Saas.Tools.PermissionWS.GetUserByEmployeeIDCompletedEventArgs>(permclient_GetUserByEmployeeIDCompleted); permclient.getFbAdminsCompleted += new EventHandler<getFbAdminsCompletedEventArgs>(permclient_getFbAdminsCompleted); //this.Loaded += new RoutedEventHandler(Employee_Loaded); permclient.DeleteFbAdminCompleted += new EventHandler<DeleteFbAdminCompletedEventArgs>(permclient_DeleteFbAdminCompleted); } catch (Exception ex) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } }