Ejemplo n.º 1
0
 public ActionResult ApproverList()
 {
     try
     {
         int id   = ViewBag.Empcode;
         int role = ViewBag.EmpRoleId;
         ViewBag.emplist    = _employeeServices.GetEmployeeList(id);
         ViewBag.OfficeList = _officeServices.GetOfficeListByEmpRole(role);
         IEnumerable <AttendanceRequestsListViewModel> lst = _attendanceDailyServices.GetRequestAttendanceList(null, id, null, null, 2).ToList();
         return(View(lst));
     }
     catch (Exception Ex)
     {
         ViewBag.error = Ex.Message;
         return(View());
     }
 }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to view or update attendance request details";
                return(PartialView("_partialviewNotFound"));
            }


            int roleid  = ViewBag.EmpRoleId;
            int EmpCode = Convert.ToInt32(Session["EmpCode"]);

            ViewBag.emplist    = _employeeServices.GetEmployeeList(Convert.ToInt32(EmpCode));
            ViewBag.OfficeList = _officeServices.GetOfficeListByEmpRole(roleid);
            IEnumerable <AttendanceRequestsListViewModel> lst = _attendanceDailyServices.GetRequestAttendanceList(null, null, null, null, null).ToList();

            return(View(lst));
        }
Ejemplo n.º 3
0
        public ActionResult Index(EmployeeSearchViewModel searchModel, string sortOrder, string currentFilter, string searchString, int?page, string pageSize)
        {
            ViewBag.CurrentSort  = sortOrder;
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date";
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }

            ViewBag.CurrentFilter = searchString;
            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to use this Page";
                return(PartialView("_partialviewNotFound"));
            }
            if (ViewBag.AllowView == true)
            {
                ViewBag.Test = searchModel.OfficeId;
                ViewBag.dllOfficeTypeList  = _officeTypeServices.GetOfficeListByEmpRole(Convert.ToInt32(ViewBag.EmpRoleId));
                ViewBag.dllDepartmentList  = _departmentServices.GetDepartmentlist();
                ViewBag.dllDesginationList = _designationServices.GetDesignationList().ToList();
                ViewBag.ddlGroupList       = _groupServices.GetGroupList();
                ViewBag.ddlBgGroupList     = _bgGroupService.GetBusinessGroupByEmpRoleId(Convert.ToInt32(ViewBag.EmpRoleId));

                ViewBag.dllLevelList   = _levelServices.GetLevellist();
                ViewBag.dllRankList    = _rankServices.GetRankList();
                ViewBag.dllShiftList   = _shiftService.GetShiftsLIst();
                ViewBag.dllSectionList = _sectionServices.GetSectionList();
                ViewBag.dllJobTypeList = _jobTypeservices.GetJobTypeList();

                ViewBag.SearchEmpCode = searchModel.EmpCode;
                ViewBag.EmpName       = searchModel.EmpName;
                ViewBag.BgId          = searchModel.BgId;
                ViewBag.OfficeId      = searchModel.OfficeId;
                ViewBag.DesgId        = searchModel.DesgId;
                ViewBag.DeptId        = searchModel.DeptId;
                ViewBag.GroupId       = searchModel.GroupId;

                ViewBag.LevelId   = searchModel.LevelId;
                ViewBag.RankId    = searchModel.RankId;
                ViewBag.ShiftId   = searchModel.ShiftId;
                ViewBag.SectionId = searchModel.SectionId;
                ViewBag.JobTypeId = searchModel.JobTypeId;


                int roleId  = Convert.ToInt32(ViewBag.EmpRoleId);
                var emplist = _employeeService.
                              SearchEmployees(searchModel.EmpCode, searchModel.EmpName, searchModel.OfficeId,
                                              searchModel.DeptId, searchModel.DesgId, searchModel.GroupId, searchModel.BgId, roleId);

                if (searchModel.LevelId > 0)
                {
                    emplist = emplist.Where(a => a.EmpLevelId == searchModel.LevelId).ToList();
                }
                if (searchModel.RankId > 0)
                {
                    emplist = emplist.Where(a => a.EmpRankId == searchModel.RankId).ToList();
                }
                if (searchModel.ShiftId > 0)
                {
                    emplist = emplist.Where(a => a.EmpShiftId == searchModel.ShiftId).ToList();
                }
                if (searchModel.SectionId > 0)
                {
                    emplist = emplist.Where(a => a.EmpSectionId == searchModel.SectionId).ToList();
                }
                if (searchModel.JobTypeId > 0)
                {
                    emplist = emplist.Where(a => a.EmpJobTypeId == searchModel.JobTypeId).ToList();
                }
                int pageSizes = 20;

                int pageNumber = 1;

                return(View(emplist.ToPagedList(pageNumber, pageSizes)));
            }
            else
            {
                return(View());
            }
        }