Esempio n. 1
0
        private string getFilterEmployee(EmployeeCriteria employeeCriteria, string x)
        {
            var qs = string.Empty;

            if (employeeCriteria == null)
            {
                return(string.Empty);
            }
            if (!string.IsNullOrEmpty(employeeCriteria.FirstName))
            {
                qs += "FirstName:" + employeeCriteria.FirstName + ";";
            }
            if (!string.IsNullOrEmpty(employeeCriteria.LastName))
            {
                qs += "LastName:" + employeeCriteria.LastName + ";";
            }
            if (!string.IsNullOrEmpty(employeeCriteria.EmployeeNo))
            {
                qs += "EmployeeNo:" + employeeCriteria.EmployeeNo + ";";
            }
            if (employeeCriteria.UnitId != 0)
            {
                qs += "UnitId:" + employeeCriteria.UnitId + ";";
            }
            if (employeeCriteria.JobPositionId != 0)
            {
                qs += "JobPositionId:" + employeeCriteria.JobPositionId + ";";
            }
            if (string.IsNullOrEmpty(qs))
            {
                return(x + "Filter=''");
            }
            return(x + "Filter=" + qs);
        }
Esempio n. 2
0
 private void init()
 {
     DisplayName          = "مديريت تاييد كننده هاي واحد ";
     employeeCriteria     = new EmployeeCriteria();
     Employees            = new PagedSortableCollectionView <EmployeeDTOWithActions>();
     SelectedVerifier     = new UnitVerifierDTO();
     Employees.OnRefresh += (s, args) => getAllEmployee();
 }
Esempio n. 3
0
 private void init()
 {
     employeeCriteria         = new EmployeeCriteria();
     Inquirers                = new PagedSortableCollectionView <EmployeeDTOWithActions>();
     SelectedCustomInquirer   = new InquiryUnitDTO();
     UnitInPeriodUnitIndexDto = new UnitInPeriodUnitIndexDTO();
     Inquirers.OnRefresh     += (s, args) => getSubjectsInquirers();
 }
Esempio n. 4
0
 void init()
 {
     DisplayName          = "محاسبه عملکرد کارکنان در دوره";
     Employees            = new PagedSortableCollectionView <EmployeeDTOWithActions>();
     CalculationEmployees = new ObservableCollection <EmployeeDTOWithActions>();
     policyList           = new List <PolicyDescriptionDTO>();
     EmployeeCriteria     = new EmployeeCriteria();
     Employees.OnRefresh += (s, args) => getEmployees(null);
     AllResultSelected    = false;
 }
        // GET: Employee
        public ActionResult Index(Guid?roleId = null)
        {
            var criteria = new EmployeeCriteria {
                RoleId = roleId ?? Guid.Empty
            };
            var specification = new EmployeeSpecification(criteria);
            var employees     = _employeeReposiory.Find(specification);

            List <EmployeeVM> listofEmployeeVM = new List <EmployeeVM>();

            foreach (var employee in employees)
            {
                listofEmployeeVM.Add(EmployeeVM.GetDTO(employee));
            }

            return(View(listofEmployeeVM));
        }
Esempio n. 6
0
 void init()
 {
     period    = new PeriodDTO();
     Employees = new PagedSortableCollectionView <EmployeeDTOWithActions>()
     {
         PageSize = 20
     };
     Employees.OnRefresh += (s, args) => Load(period);
     DisplayName          = EmployeeMgtAppLocalizedResources.EmployeeListPageTitle + " " + "دوره";
     EmployeeCriteria     = new EmployeeCriteria();
     EmployeeCommands     = new List <DataGridCommandViewModel>
     {
         CommandHelper.GetControlCommands(this, appController, new List <int> {
             (int)ActionType.AddEmployee
         }).FirstOrDefault()
     };
 }
 void init()
 {
     period            = new PeriodDTO();
     managerEmployeeNo = String.Empty;
     Employees         = new PagedSortableCollectionView <EmployeeDTOWithActions>()
     {
         PageSize = 20
     };
     Employees.OnRefresh += (s, args) => Load(managerEmployeeNo, period);
     DisplayName          = "ليست همكاران زير مجموعه";
     EmployeeCriteria     = new EmployeeCriteria();
     EmployeeCommands     = new List <DataGridCommandViewModel>
     {
         CommandHelper.GetControlCommands(this, appController, new List <int> {
             (int)ActionType.ChangeEmployeePoint
         }).FirstOrDefault()
     };
 }
Esempio n. 8
0
        public ActionResult Login(LoginVM loginVM)
        {
            if (ModelState.IsValid)
            {
                var employeeCriteria = new EmployeeCriteria {
                    EmailId = loginVM.Username, Password = loginVM.Password
                };
                var employeeSpecification = new EmployeeSpecification(employeeCriteria);
                var employee = _employeeRepository.Find(employeeSpecification).FirstOrDefault();

                if (employee == null)
                {
                    ModelState.AddModelError("", "Invalid Username and Password");
                }
                else
                {
                    FormsAuthentication.SetAuthCookie(loginVM.Username, loginVM.RememberMe);
                    if (loginVM.RememberMe)
                    {
                        Response.Cookies["Username"].Value   = loginVM.Username;
                        Response.Cookies["Password"].Value   = loginVM.Password;
                        Response.Cookies["Username"].Expires = DateTime.UtcNow.AddMonths(12);
                        Response.Cookies["Password"].Expires = DateTime.UtcNow.AddMonths(12);
                    }
                    else
                    {
                        Response.Cookies["Username"].Expires = DateTime.UtcNow.AddMinutes(-1);
                        Response.Cookies["Password"].Expires = DateTime.UtcNow.AddMinutes(-1);
                    }

                    var criteria = new MenuRoleMapCriteria {
                        RoleId = employee.Role.Id, IsActive = true
                    };
                    var specification = new MenuRoleMapSpecification(criteria);
                    var menus         = _menuRoleMapRepository.Find(specification).OrderBy(x => x.Menu.Order).ToList();

                    List <MenuVM> listOfMenu = new List <MenuVM>();

                    foreach (var menu in menus)
                    {
                        if (menu.Menu.IsParent)
                        {
                            var submenus = menus.Where(x => x.Menu.MainMenu != null && x.Menu.MainMenu.Id.Equals(menu.Menu.Id)).Select(x => x.Menu).ToList();
                            if (submenus.Count() != 0)
                            {
                                var mainMenuVM = MenuVM.GetDTO(menu.Menu);
                                foreach (var submenu in submenus)
                                {
                                    mainMenuVM.SubMenuList.Add(MenuVM.GetDTO(submenu));
                                }
                                listOfMenu.Add(mainMenuVM);
                            }
                        }
                        else if (!menu.Menu.IsParent && menu.Menu.MainMenu == null)
                        {
                            listOfMenu.Add(MenuVM.GetDTO(menu.Menu));
                        }
                        else
                        {
                            continue;
                        }
                    }
                    Session["MenuMaster"] = listOfMenu;
                    return(RedirectToAction("Index", "Home"));
                }
            }
            return(View(loginVM));
        }
Esempio n. 9
0
        public void GetAllEmployeeNo(Action <List <string>, Exception> action, long periodId, EmployeeCriteria employeeCriteria)
        {
            var url = string.Format(baseAddress + makeApiAdress(periodId) +
                                    getFilterEmployee(employeeCriteria, "?"));

            WebClientHelper.Get(new Uri(url, PMSClientConfig.UriKind), action, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }
Esempio n. 10
0
        public void GetSubordinatesEmployees(Action <PageResultDTO <EmployeeDTOWithActions>, Exception> action, string managerEmployeeNo, long periodId, EmployeeCriteria employeeCriteria,
                                             int pageSize, int pageIndex)
        {
            var url = string.Format(baseAddress + makeApiAdress(periodId) + "?verifierEmployeeNo=" + managerEmployeeNo + "&PageSize=" + pageSize + "&PageIndex=" + pageIndex +
                                    getFilterEmployee(employeeCriteria, "&"));

            WebClientHelper.Get(new Uri(url, PMSClientConfig.UriKind), action, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }