// GET: AttendaceDetails public ActionResult Index(int id) { if (!ViewBag.AllowView) { ViewBag.Error = "You are not Authorize to view or update attendance details"; return(PartialView("_partialviewNotFound")); } try { ViewBag.usercode = id; var item = _attendanceDailyServices.GetAttendanceByRangeAndID(id, null, null); var list = _employeeServices.GetEmployeeDetails(id); ViewBag.Department = list.Department; ViewBag.Name = list.Name; ViewBag.office = list.OfficeName; ViewBag.Desg = list.Designation; ViewBag.EmployeeType = list.Group; ViewBag.Shift = list.Shift; ViewBag.level = list.Level; ViewBag.image = list.PhotoName; ViewBag.Empcode = list.Code; ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(ViewBag.Empcode); return(View("../Employee/AttendanceDetails/Index", item)); } catch (Exception Ex) { ViewBag.Error = "No Data found or No employee found with this employeeCode"; return(View("../Employee/AttendanceDetails/Index")); } }
public ActionResult Index(int id) { ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); EmployeeFamilyInformation Record = new EmployeeFamilyInformation(); Record.EmployeeFamilyList = new List <EmployeeFamilyDTO>(); Record.EmployeeFamilyList = _EmployeeFamilyService.GetEmployeeByEmpCode(id); Record.EmpId = id; return(View("../Employee/Family/Index", Record)); }
public ActionResult Index(int id, string Sdate, string Enddate) { if (!ViewBag.AllowView) { ViewBag.Error = "You are not Authorize to view or update attendance details"; return(PartialView("_partialviewNotFound")); } try { if (String.IsNullOrEmpty(Sdate) && String.IsNullOrEmpty(Enddate)) { var list = _employeeServices.GetEmployeeDetails(id); UpdateAttendanceSearchModel uds = new UpdateAttendanceSearchModel(); uds.AttendanceList = _attendanceDailyServices.GetAttendanceByRangeAndID(id, null, null); uds.Name = list.Name; uds.Empcode = list.Code; uds.Branch = list.OfficeName; uds.Department = list.Department; uds.Designation = list.Designation; uds.Shift = list.Shift; uds.Group = list.Group; uds.Level = list.Level; ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); return(View(uds)); } else { var list = _employeeServices.GetEmployeeDetails(id); UpdateAttendanceSearchModel uds = new UpdateAttendanceSearchModel(); DateTime Stsrtdate, Edate; Stsrtdate = Convert.ToDateTime(Sdate); Edate = Convert.ToDateTime(Enddate); uds.AttendanceList = _attendanceDailyServices.GetAttendanceByRangeAndID(id, Stsrtdate, Edate); uds.Name = list.Name; uds.SearchStartdate = Sdate; uds.SeacrchEnddate = Enddate; uds.Empcode = list.Code; uds.Branch = list.OfficeName; uds.Department = list.Department; uds.Designation = list.Designation; uds.Shift = list.Shift; uds.Group = list.Group; uds.Level = list.Level; ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); return(View(uds)); } } catch (Exception Ex) { ViewBag.Error = "No Data found or No employee found with this employeeCode"; return(View()); } }
public ActionResult Index(int Id) { ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(Id); ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(Id); List <EmployeeAddressDTO> Record = _employeeService.GetAddressesofEmployeeById(Id); return(View("../Employee/Address/Index", Record)); }
//[Route("employees/document/{empcode}")] public ActionResult Index(int id) { try { ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); EmployeeDocumentInformation Record = new EmployeeDocumentInformation(); Record.EmployeeDocumentList = new List <EmployeeDocumentDTO>(); Record.EmployeeDocumentList = _employeeDocumentService.GetEmployeeByEmpCode(id); Record.EmpId = id; return(View("../Employee/Document/Index", Record)); } catch (Exception ex) { return(null); } }
public ActionResult EducationList(int id) { if (!ViewBag.AllowView) { ViewBag.Error = "You are not Authorize to use this Page"; return(PartialView("_partialviewNotFound")); } ViewBag.EmployeeDetail = _empDetails.GetEmployeeDetails(id); ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); // ViewBag.EmployeeTraining = _empTraining.GetAllTrainingById(id); IEnumerable <EmpEducationDTO> list = _empEducationService.GetAllEducationById(id); return(View("../Employee/Education/EducationList", list)); }
public ActionResult IndividualLeaveBalance(int Empcode) { LeaveBalanceIndividual lbvm = new LeaveBalanceIndividual(); lbvm.EmpDetail = _employeeServices.GetEmployeeDetails(Empcode); List <int> neapaliyear = _reportServices.GetYearList(); List <SelectListItem> year = new List <SelectListItem>(); LeaveYearDTO active_year = _leaveServices.GetActiveYear(); foreach (int str in neapaliyear) { year.Add(new SelectListItem { Text = str.ToString(), Value = str.ToString() }); } lbvm.Currentyear = active_year.YearId; lbvm.YearList = year; ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(Empcode); ViewBag.EmployeeDetail = lbvm.EmpDetail; return(View(lbvm)); }
public ActionResult EmployeePrize(int id) { if (!ViewBag.AllowView) { ViewBag.Error = "You are not Authorize to use this Page"; return(PartialView("_partialviewNotFound")); } IEnumerable <EmployeePrizeDTO> data = _empPrizeService.GetAllPrizeOfEmployee(id); ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(id); ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); return(View("../Employee/EmployeePrize/Index", data)); }
//[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); ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(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() }); } var EmployeesList = _employeeService.GetEmployeeSelectList(); 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; }
public ActionResult Index(int Empcode) { int LoginEmpCode = Convert.ToInt32(Session["EmpCode"]); int isAccessAllow = _employeeService.GetIsProfileViewable(Empcode, LoginEmpCode); if (isAccessAllow == 0) { ViewBag.Error = "You do not have permission to view profile of employee code : " + Empcode; return(PartialView("_partialviewNotFound")); } try { ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(Empcode); EmployeeDetailsViewModel reEmp = _employeeService.GetEmployeeDetails(Empcode); EmployeeEditViewModel Details = _employeeService.GetEmployeeByID(Empcode); IEnumerable <EmployeeFamilyViewModel> Familydetails = _employeeService.GetEmployeeFamilyByID(Empcode); IEnumerable <EmployeePrizeDTO> res = _empPrizeService.GetAllPrizeOfEmployee(Empcode); IEnumerable <EmployeeSkillViewModel> skill = _employeeService.GetEmployeeSkillsByID(Empcode); IEnumerable <EmployeeDocumentViewModel> document = _employeeService.GetEmployeeDocumentsByID(Empcode); EmployeeDetailAdminViewModel EmpDetails = new EmployeeDetailAdminViewModel(); EmpDetails.EmpDetails = reEmp; EmpDetails.OtherDetails = Details; EmpDetails.Familydetails = Familydetails; EmpDetails.Prize = res; EmpDetails.Skill = skill; EmpDetails.Documents = document; //get current history id EmployeeJobHistoryDTO jobhistoryCurrent = new EmployeeJobHistoryDTO(); EmployeeJobHistoryDTO jobhistoryAppoint = new EmployeeJobHistoryDTO(); int currentHistoryId = _jobhistory.GetJobHistoryOfEmployeeWIthCondition(Empcode, "current"); if (currentHistoryId > 0) { jobhistoryCurrent = _jobhistory.GetJobHistoryById(currentHistoryId); } else { jobhistoryCurrent = null; } //get appointment history id int appointHistoryId = _jobhistory.GetJobHistoryOfEmployeeWIthCondition(Empcode, "appoint");; if (appointHistoryId > 0) { jobhistoryAppoint = _jobhistory.GetJobHistoryById(appointHistoryId); } else { jobhistoryAppoint = null; } EmpDetails.EmployeeCurrentJobHistory = jobhistoryCurrent; EmpDetails.EmployeeAppointJobHistory = jobhistoryAppoint; return(View(EmpDetails)); } catch (Exception Exception) { throw new Exception(Exception.ToString()); } }