public JsonResult JsonForHandson() { List <StaffWorkHoursInfo> list = new List <StaffWorkHoursInfo>(); for (int i = -4; i < 4; i++) { list.AddRange(DomainAdapter.getWorkHoursForAll(DateTime.Now.AddDays(i * -7))); } string[][] res = listFormater(list); return(Json(res, JsonRequestBehavior.AllowGet)); }
public JsonResult WorkHoursForDay(string day, string type) { DateTime dt = DateTime.Parse(day); switch (type) { case "last": var res = DomainAdapter.getWorkHoursForAll(dt.AddDays(-7)); return(Json(res, JsonRequestBehavior.AllowGet)); case "next": res = DomainAdapter.getWorkHoursForAll(dt.AddDays(7)); return(Json(res, JsonRequestBehavior.AllowGet)); default: return(Json("")); } }