예제 #1
0
 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;
 }
예제 #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;
 }
예제 #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);
     }
 }
예제 #4
0
 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);
     }
 }
예제 #5
0
        /// <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);
        }