public ActionResult OtherLeaveApprove(int EmpID) { //Creating List List <OtherLeaveapprove> ObjEmp = new List <OtherLeaveapprove>(); var data = _TimeSheetApprovalMethod.getOtherLeave(EmpID); if (data.Count > 0) { foreach (var details in data) { OtherLeaveapprove datamodel = new OtherLeaveapprove(); datamodel.Id = details.Id; datamodel.EmployeeId = details.EmployeeId; datamodel.StartDate = details.StartDate; datamodel.EndDate = details.EndDate; datamodel.Duration = Convert.ToDecimal(details.Duration); datamodel.Reason = details.Reason; datamodel.Name = details.Name; TempData["OthWName"] = details.Name; TempData["OthWId"] = details.EmployeeId; datamodel.FileName = details.FileName; datamodel.totalOtherLeave = calculateOtherLeave(EmpID); ObjEmp.Add(datamodel); } } //return list as Json return(PartialView("_partialOtherLeaveApproval", ObjEmp)); }
public ActionResult UpdateOtherLeaveReject(string ID, int EmpId) { //List<TimeSheetApprovalViewModel> ObjEmp = new List<TimeSheetApprovalViewModel>(); _TimeSheetApprovalMethod.UpdateOtherLeaveRejectStatus(ID); // return Json("sucess", JsonRequestBehavior.AllowGet); List <OtherLeaveapprove> ObjEmp = new List <OtherLeaveapprove>(); var data = _TimeSheetApprovalMethod.getOtherLeave(EmpId); if (data.Count > 0) { foreach (var details in data) { OtherLeaveapprove datamodel = new OtherLeaveapprove(); datamodel.Id = details.Id; datamodel.EmployeeId = details.EmployeeId; datamodel.StartDate = details.StartDate; datamodel.EndDate = details.EndDate; datamodel.Duration = Convert.ToDecimal(details.Duration); datamodel.Reason = details.Reason; datamodel.Name = details.Name; TempData["OthWName"] = details.Name; TempData["OthWId"] = details.EmployeeId; datamodel.FileName = details.FileName; datamodel.totalOtherLeave = calculateOtherLeave(EmpId); ObjEmp.Add(datamodel); } } //return list as Json return(PartialView("_partialOtherLeaveApproval", ObjEmp)); }
public JsonResult OtherLeaveApprove(int EmpID) { //Creating List List <OtherLeaveapprove> ObjEmp = new List <OtherLeaveapprove>(); var data = _TimeSheetApprovalMethod.getOtherLeave(EmpID); if (data.Count > 0) { foreach (var details in data) { OtherLeaveapprove datamodel = new OtherLeaveapprove(); datamodel.Id = details.Id; datamodel.EmployeeId = details.EmployeeId; datamodel.StartDate = details.StartDate; datamodel.EndDate = details.EndDate; datamodel.Duration = Convert.ToDecimal(details.Duration); datamodel.Reason = details.Reason; datamodel.Name = details.Name; ObjEmp.Add(datamodel); } } //return list as Json return(Json(ObjEmp, JsonRequestBehavior.AllowGet)); }