public JsonResult WelformdaycalList(string startDate = "", string endDate = "", int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null) { try { try { WelformdaycalEntity _Model = new WelformdaycalEntity(); _Model.StartDate = startDate; _Model.EndDate = endDate; DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetWelformdaycalRecord, _Model); List<WelformdaycalEntity> ItemList = null; ItemList = new List<WelformdaycalEntity>(); int iCount = 0; int offset = 0; offset = jtStartIndex / jtPageSize; foreach (DataRow dr in dt.Rows) { if (iCount >= jtStartIndex && iCount < (jtPageSize * (offset + 1))) { ItemList.Add(new WelformdaycalEntity() { EMPID = dr["EMPID"].ToString(), ENAME = dr["ENAME"].ToString(), SECTION = dr["SECTION"].ToString(), JDate = dr["JDate"].ToString(), Status = dr["Status"].ToString(), TTDay = dr["TTDay"].ToString(), Holiday = dr["Holiday"].ToString(), Present = dr["Present"].ToString(), Absent = dr["Absent"].ToString(), CL = dr["CL"].ToString(), SL = dr["SL"].ToString(), ML = dr["ML"].ToString(), EL = dr["EL"].ToString(), }); } iCount += 1; } var RecordCount = dt.Rows.Count; var Record = ItemList; Session["Welform"] = ItemList; return Json(new { Result = "OK", Records = Record, TotalRecordCount = RecordCount }); } catch (Exception ex) { return Json(new { Result = "ERROR", Message = ex.Message }); } } catch (Exception ex) { return Json(new { Result = "ERROR", Message = ex.Message }); } }
public ActionResult Welformdaycal() { WelformdaycalEntity Model = new WelformdaycalEntity(); Model.StartDate = DateTime.Today.ToString("dd/MM/yyyy"); Model.EndDate = DateTime.Today.Date.ToString("dd/MM/yyyy"); return View(Model); }