Пример #1
0
        public ActionResult AttendanceLeaveReport()
        {
            AttendanceReportsDTO     result     = new AttendanceReportsDTO();
            IEnumerable <OfficeDTOs> officelist = _officeServices.GetOfficeAllData();
            List <int> nepaliyears = _reportServices.GetYearList();

            List <SelectListItem> sl  = new List <SelectListItem>();
            List <SelectListItem> yrs = new List <SelectListItem>();
            List <SelectListItem> Mth = _reportServices.NepaliMonthList();

            foreach (int str in nepaliyears)
            {
                yrs.Add(new SelectListItem
                {
                    Text  = str.ToString(),
                    Value = str.ToString()
                });
            }
            foreach (OfficeDTOs str in officelist)
            {
                sl.Add(new SelectListItem
                {
                    Text  = str.OfficeName,
                    Value = str.OfficeId.ToString()
                });
            }

            result.BranchSelectList = sl;
            result.MonthList        = Mth;
            result.YearList         = yrs;
            return(View(result));
        }
Пример #2
0
        public ActionResult RecommenderList(AttendanceRequestsListViewModel att)
        {
            att.startdate = Convert.ToDateTime(NepEngDate.NepToEng(att.startdateNP));
            att.enddate   = Convert.ToDateTime(NepEngDate.NepToEng(att.enddateNP));

            ViewBag.startdate = att.startdateNP;
            ViewBag.enddate   = att.enddateNP;

            int id = ViewBag.Empcode;

            ViewBag.emplist         = _employeeServices.GetEmployeeList(id);
            ViewBag.OfficeList      = _officeServices.GetOfficeAllData();
            ViewBag.officeid        = att.OfficeId;
            ViewBag.code            = att.EmpCodes;
            ViewBag.approvestatus   = att.ApproverStatus;
            ViewBag.recommendstatus = att.RecommendSatus;
            ViewBag.id = id;
            IEnumerable <AttendanceRequestsListViewModel> lst = _attendanceDailyServices.GetrequestAttendanceListByParms(att.OfficeId, att.EmpCodes, att.startdate, att.enddate, id, null, att.RecommendSatus, att.ApproverStatus).ToList();

            return(View(lst));
        }
Пример #3
0
        //[Route("training/{id}")]
        //public ActionResult EmployeeTraining(int id)
        //{
        //    if (!ViewBag.AllowView)
        //    {
        //        ViewBag.Error = "You are not Authorize to use this Page";
        //        return PartialView("_partialviewNotFound");
        //    }
        //    IEnumerable<EmployeeTrainingDTO> res = _employeeTrainingService.GetAllTrainingOfEmployee(id);
        //    ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(id);
        //    ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id);
        //    return View("../Employee/Training/Index", res);
        //}

        //[Route("training/{id}/create")]
        //public ActionResult EmployeeTrainingCreate(int id)
        //{
        //    if (!ViewBag.AllowCreate)
        //    {
        //        ViewBag.Error = "You are not Authorize to use this Page";
        //        return PartialView("_partialviewNotFound");
        //    }
        //    ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(id);
        //    ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id);
        //    IEnumerable<SelectListItem> CountryList = _countryService.GetCountryList();
        //    ViewBag.countryList = CountryList;
        //    EmployeeTrainingDTO Record = new EmployeeTrainingDTO();
        //    EmployeeDTO EmployeeRecord = _employeeService.GetEmployeeDTOById(id);
        //    Record.CurrentRank = EmployeeRecord.EmpRankId;
        //    Record.CurrentDesignation = EmployeeRecord.EmpDesgId;
        //    Record.CurrentOffice = EmployeeRecord.EmpOfficeId;
        //    Record.AssignedByList = _employeeService.GetEmployeeSelectList();
        //    Record.SponsorshipList = _employeeService.GetSponsorshipList();
        //    Record.NationalInternationalList = _employeeService.GetNationInternationalList();
        //    return View("../Employee/Training/Create", Record);
        //}

        //[Route("training/{id}/create")]
        //[HttpPost]
        //public ActionResult EmployeeTrainingCreate(int id, EmployeeTrainingDTO data)
        //{
        //    data.AssignedByList = _employeeService.GetEmployeeSelectList();
        //    data.SponsorshipList = _employeeService.GetSponsorshipList();
        //    data.NationalInternationalList = _employeeService.GetNationInternationalList();
        //    if (!ViewBag.AllowCreate)
        //    {
        //        ViewBag.Error = "You are not Authorize to use this Page";
        //        return PartialView("_partialviewNotFound");
        //    }
        //    ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(id);
        //    ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id);
        //    IEnumerable<SelectListItem> CountryList = _countryService.GetCountryList();
        //    ViewBag.countryList = CountryList;
        //    try
        //    {
        //        if (ModelState.IsValid)
        //        {
        //            data.EmpCode = id;
        //            _employeeTrainingService.InsertEmployeeTraining(data);
        //            TempData["Success"] = "Employee created successfully.";
        //            return RedirectToAction("EmployeeTraining", id);
        //        }
        //        else
        //        {
        //            ViewBag.Error = "Form validation error";
        //            return View("../Employee/Training/Create", data);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        ViewBag.Error = ex.Message;
        //        return View("../Employee/Training/Create", data);
        //    }
        //}

        //[Route("training/{empCode}/TrainingEdit/{trainingId}")]
        //public ActionResult EmployeeTrainingEdit(int empCode, int trainingId)
        //{
        //    if (!ViewBag.AllowEdit)
        //    {
        //        ViewBag.Error = "You are not Authorize to use this Page";
        //        return PartialView("_partialviewNotFound");
        //    }
        //    ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(empCode);
        //    ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(empCode);
        //    IEnumerable<SelectListItem> CountryList = _countryService.GetCountryList();
        //    ViewBag.countryList = CountryList;
        //    EmployeeTrainingDTO res = _employeeTrainingService.GetTrainingById(trainingId);
        //    res.AssignedByList = _employeeService.GetEmployeeSelectList();
        //    res.SponsorshipList = _employeeService.GetSponsorshipList();
        //    res.NationalInternationalList = _employeeService.GetNationInternationalList();
        //    return View("../Employee/Training/Edit", res);
        //}

        //[Route("training/{empCode}/TrainingEdit/{trainingId}")]
        //[HttpPost]
        //public ActionResult EmployeeTrainingEdit(int empCode, int trainingId, EmployeeTrainingDTO data)
        //{
        //    if (!ViewBag.AllowEdit)
        //    {
        //        ViewBag.Error = "You are not Authorize to use this Page";
        //        return PartialView("_partialviewNotFound");
        //    }
        //    ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(empCode);
        //    ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(empCode);

        //    IEnumerable<SelectListItem> CountryList = _countryService.GetCountryList();
        //    ViewBag.countryList = CountryList;
        //    try
        //    {
        //        data.EmpCode = empCode;
        //        data.TrainingDays = (data.TrainingEndDate - data.TrainingStartDate).Value.Days;
        //        data.TrainingYear = data.TrainingStartDate.Value.Year;
        //        int res = _employeeTrainingService.UpdateTraining(data);
        //        if (res > 0)
        //            return RedirectToAction("EmployeeTraining", new { id = empCode });
        //        else
        //        {
        //            ViewBag.Error = "Couldn't update";
        //            return View("../Employee/Training/Edit");
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        ViewBag.Error = ex.Message;
        //        return View("../Employee/Training/Edit", data);
        //    }

        //}

        //[Route("training/{empCode}/TrainingDelete/{id}")]
        //public ActionResult EmployeeTrainingDelete(int empCode, int id)
        //{
        //    if (!ViewBag.AllowDelete)
        //    {
        //        ViewBag.Error = "You are not Authorize to use this Page";
        //        return PartialView("_partialviewNotFound");
        //    }
        //    _employeeTrainingService.DeleteTrainingById(id);
        //    return RedirectToAction("EmployeeTraining", new { id = empCode });
        //}
        #endregion
        #region EmpTraining



        public void ListOfDatas(int empCode)
        {
            ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(empCode);
            ViewBag.SideBar        = _moduleService.AdminEmployeeDetailsMenu(empCode);

            foreach (var row in _officeService.GetOfficeAllData())
            {
                OfficeList.Add(new SelectListItem
                {
                    Text  = row.OfficeName,
                    Value = row.OfficeId.ToString()
                });
            }



            foreach (var row in _designationService.GetDesignationList())
            {
                DesignationList.Add(new SelectListItem
                {
                    Text  = row.DsgName,
                    Value = row.DsgId.ToString()
                });
            }

            foreach (var row in _rankService.GetRankList())
            {
                RankList.Add(new SelectListItem
                {
                    Text  = row.RankName.ToString(),
                    Value = row.RankId.ToString()
                });
            }


            ViewBag.officeList = OfficeList;

            ViewBag.designationList = DesignationList;
            ViewBag.rankList        = RankList;
        }
        public void ListOfDatas(int empCode)
        {
            ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(empCode);
            List <SelectListItem> OfficeList = new List <SelectListItem>();

            foreach (var row in _officeService.GetOfficeAllData())
            {
                OfficeList.Add(new SelectListItem
                {
                    Text  = row.OfficeName,
                    Value = row.OfficeId.ToString()
                });
            }
            List <SelectListItem> DepartmentList = new List <SelectListItem>();

            foreach (var row in _departmentServices.GetDepartmentlist())
            {
                DepartmentList.Add(new SelectListItem
                {
                    Text  = row.DeptName,
                    Value = row.DeptId.ToString()
                });
            }
            List <SelectListItem> SectionList = new List <SelectListItem>();

            foreach (var row in _sectionServices.GetSectionList())
            {
                SectionList.Add(new SelectListItem
                {
                    Text  = row.SectionName,
                    Value = row.SectionId.ToString()
                });
            }
            List <SelectListItem> DesignationList = new List <SelectListItem>();

            foreach (var row in _designationServices.GetDesignationList())
            {
                DesignationList.Add(new SelectListItem
                {
                    Text  = row.DsgName,
                    Value = row.DsgId.ToString()
                });
            }
            List <SelectListItem> RankList = new List <SelectListItem>();

            foreach (var row in _rankServices.GetRankList())
            {
                RankList.Add(new SelectListItem
                {
                    Text  = row.RankName.ToString(),
                    Value = row.RankId.ToString()
                });
            }
            List <SelectListItem> LevelList = new List <SelectListItem>();

            foreach (var row in _levelServices.GetLevellist())
            {
                LevelList.Add(new SelectListItem
                {
                    Text  = row.LevelName,
                    Value = row.LevelId.ToString()
                });
            }
            List <SelectListItem> BusinessGroupList = new List <SelectListItem>();

            foreach (var row in _bgGroupService.GetBusinessGroupList())
            {
                BusinessGroupList.Add(new SelectListItem
                {
                    Text  = row.BgName,
                    Value = row.BgId.ToString()
                });
            }
            List <SelectListItem> ShiftList = new List <SelectListItem>();

            foreach (var row in _shiftService.GetShiftsLIst())
            {
                ShiftList.Add(new SelectListItem
                {
                    Text  = row.ShiftName,
                    Value = row.ShiftId.ToString()
                });
            }
            List <SelectListItem> RemoteList = new List <SelectListItem>();

            foreach (var row in _remoteService.GetRemoteList())
            {
                RemoteList.Add(new SelectListItem
                {
                    Text  = row.RemoteAreaName,
                    Value = row.RemoteId.ToString()
                });
            }
            List <SelectListItem> JobTypeList = new List <SelectListItem>();

            foreach (var row in _jobTypeservices.GetJobTypeList())
            {
                JobTypeList.Add(new SelectListItem
                {
                    Text  = row.JobTypeName,
                    Value = row.JobtypeId.ToString()
                });
            }
            List <SelectListItem> ServiceEventList = new List <SelectListItem>();

            foreach (var row in _serviceEventService.GetServiceEventList())
            {
                ServiceEventList.Add(new SelectListItem
                {
                    Text  = row.ServiceEventGroupName,
                    Value = row.ServiceEventId.ToString()
                });
            }
            List <SelectListItem> EmployeesList = new List <SelectListItem>();

            foreach (var row in _employeeService.GetEmployeeList(2))
            {
                EmployeesList.Add(new SelectListItem
                {
                    Text  = row.EmpName,
                    Value = row.EmpCode.ToString()
                });
            }
            ViewBag.officeList        = OfficeList;
            ViewBag.departmentList    = DepartmentList;
            ViewBag.sectionList       = SectionList;
            ViewBag.designationList   = DesignationList;
            ViewBag.rankList          = RankList;
            ViewBag.levelList         = LevelList;
            ViewBag.businessGroupList = BusinessGroupList;
            ViewBag.shiftList         = ShiftList;
            ViewBag.remoteList        = RemoteList;
            ViewBag.jobTypeList       = JobTypeList;
            ViewBag.serviceEventList  = ServiceEventList;
            ViewBag.employeeList      = EmployeesList;
        }