public ActionResult ScheduleApproval(int EmpID) { //Creating List List <ScheduleApproval> ObjEmp = new List <ScheduleApproval>(); var data = _TimeSheetApprovalMethod.getScheduleApprovalList(EmpID); if (data.Count > 0) { foreach (var details in data) { ScheduleApproval datamodel = new ScheduleApproval(); datamodel.Id = details.Id; datamodel.EmployeeId = details.EmployeeId; datamodel.StartDate = details.StartDate; datamodel.EndDate = details.EndDate; datamodel.Duration = Convert.ToDecimal(details.duration); datamodel.Name = details.Name; datamodel.Hours = details.Hours; datamodel.Project = Convert.ToString(details.Project); datamodel.Customer = details.Customer; datamodel.Asset = details.AssetName; datamodel.Status = details.Status; TempData["ScheWName"] = details.Name; TempData["ScheWId"] = details.EmployeeId; ObjEmp.Add(datamodel); } } //return list as Json return(PartialView("_partialSchedulingApproval", ObjEmp)); }
public JsonResult ScheduleApproval(int EmpID) { //Creating List List <ScheduleApproval> ObjEmp = new List <ScheduleApproval>(); var data = _TimeSheetApprovalMethod.getScheduleApprovalList(EmpID); if (data.Count > 0) { foreach (var details in data) { ScheduleApproval datamodel = new ScheduleApproval(); datamodel.Id = details.Id; datamodel.EmployeeId = details.EmployeeId; datamodel.StartDate = details.StartDate; datamodel.EndDate = details.EndDate; datamodel.Duration = Convert.ToDecimal(details.duration); datamodel.Name = details.Name; datamodel.Hours = details.Hours; datamodel.Project = Convert.ToString(details.Project); datamodel.Customer = details.Customer; datamodel.Asset = details.AssetName; datamodel.Status = details.Status; ObjEmp.Add(datamodel); } } //return list as Json return(Json(ObjEmp, JsonRequestBehavior.AllowGet)); }