public JsonResult SickLeaveApprove() { //Creating List List <SickLeaveapprove> ObjEmp = new List <SickLeaveapprove>(); var data = _TimeSheetApprovalMethod.getSickLeave(); if (data.Count > 0) { foreach (var details in data) { SickLeaveapprove datamodel = new SickLeaveapprove(); datamodel.Id = details.Id; datamodel.StartDate = Convert.ToDateTime(details.StartDate); datamodel.EndDate = Convert.ToDateTime(details.EndDate); datamodel.Duration = Convert.ToDecimal(details.DurationDays); //Commented for yagnik datamodel.SelfCertificationRequired = details.SelfCertificationFormRequired; datamodel.InterviewRequired = details.BackToWorkInterviewRequired; datamodel.Type = details.Type; datamodel.DoctorConsulted = details.DoctorConsulted; datamodel.IssueAtWork = details.IssueAtWork; ObjEmp.Add(datamodel); } } //return list as Json return(Json(ObjEmp, JsonRequestBehavior.AllowGet)); }
public ActionResult SickLeaveApprove(int EmpID) { List <SickLeaveapprove> ObjEmp = new List <SickLeaveapprove>(); var data = _TimeSheetApprovalMethod.getAllSickLeaveApprovalList(EmpID); var tottalSick = _TimeSheetApprovalMethod.countTottalSickDaysIntheYear(EmpID); var brandFactorPoint = _employeeMethod.GetBradFordFactorCount(EmpID); if (data.Count > 0) { foreach (var details in data) { SickLeaveapprove datamodal = new SickLeaveapprove(); datamodal.Id = details.Id; datamodal.StartDate = Convert.ToDateTime(details.StartDate); datamodal.EndDate = Convert.ToDateTime(details.EndDate); datamodal.Duration = Convert.ToDecimal(details.DurationDays); datamodal.Type = details.Type; datamodal.Status = details.ApprovalStatus; datamodal.IssueAtWork = details.IssueAtWork; datamodal.DoctorConsulted = details.DoctorConsulted; datamodal.InterviewRequired = details.BackToWorkInterviewRequired; datamodal.SelfCertificationRequired = details.SelfCertificationFormRequired; datamodal.FileName = details.FileName; TempData["SickEmpName"] = details.Name; TempData["SickEmpId"] = details.EmployeeId; TempData["TotalSick"] = tottalSick; TempData["Brandforspoint"] = brandFactorPoint; ObjEmp.Add(datamodal); } } return(PartialView("_partialSickLeaveApproval", ObjEmp)); }