public UserRoleCreateForm(IRightsUploadServicePrx _rightsUploadService, IRightsQueryServicePrx _rightsQueryService)
 {
     InitializeComponent();
     this._rightsUploadService = _rightsUploadService;
     this._rightsQueryService  = _rightsQueryService;
     roleManager = new RightManagerBase <Role>(_rightsUploadService, _rightsQueryService, new RoleClient(_rightsUploadService, _rightsQueryService));
     roleManager.ExceptionAction = ExceptionAction;
 }
Exemple #2
0
 public UserEditForm(IRightsUploadServicePrx _rightsUploadService, IRightsQueryServicePrx _rightsQueryService)
 {
     InitializeComponent();
     this._rightsUploadService        = _rightsUploadService;
     this._rightsQueryService         = _rightsQueryService;
     employeeManager                  = new RightManagerBase <Employee>(_rightsUploadService, _rightsQueryService, new EmployeeClient(_rightsUploadService, _rightsQueryService));
     employeeManager.ExceptionAction  = ExceptionAction;
     empltoroleClient                 = new EmpltoroleClient(_rightsUploadService, _rightsQueryService);
     empltoroleClient.ExceptionAction = ExceptionAction;
 }
Exemple #3
0
 public static void GetListByParam(this RightManagerBase <Role> roleManager, string rolename)
 {
     try
     {
         IList <Role> roleList;
         ((RoleClient)roleManager.RightsClient).GetListByParam(rolename, out roleList);
         roleManager.BindingList = new System.ComponentModel.BindingList <Role>(roleList.ToList());
     }
     catch (Exception ex)
     {
         roleManager.ExceptionAction(ex);
     }
 }
 public static void GetEmployeeListByParam(this RightManagerBase <Employee> employeeManager, string username, string usercode, string Departmentname)
 {
     try
     {
         IList <Employee> employeeList;
         ((EmployeeClient)employeeManager.RightsClient).GetListByParam(username, usercode, Departmentname, out employeeList);
         employeeManager.BindingList = new BindingList <Employee>(employeeList.ToList());
     }
     catch (Exception ex)
     {
         employeeManager.ExceptionAction(ex);
     }
 }
        /// <summary>
        /// 检查是否员工编号重复

        /// </summary>
        /// <param name="emplcode"></param>
        /// <returns></returns>
        public static bool IsUnique(this RightManagerBase <Employee> employeeManager, string usercode)
        {
            if (usercode == null)
            {
                return(true);
            }
            int count = employeeManager.BindingList.Count(m => m.Emplcode == usercode.Trim());

            if (count > 0)
            {
                return(false);
            }
            return(true);
        }