public JsonResult NorthtowerdaycalList(string startDate = "", string endDate = "", int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null) { try { try { NorthTowerdaycal _Model = new NorthTowerdaycal(); _Model.StartDate = startDate; _Model.EndDate = endDate; DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetNorthtowerdaycalRecord, _Model); List<NorthTowerdaycal> ItemList = null; ItemList = new List<NorthTowerdaycal>(); 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 NorthTowerdaycal() { EMPID = dr["EMPID"].ToString(), ENAME = dr["ENAME"].ToString(), Designation = dr["Designation"].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["NTR"] = 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 NTDaycalExcel(string startDate = "", string endDate = "") { // DataTable dt = -- > get your data NorthTowerdaycal _Model = new NorthTowerdaycal(); _Model.StartDate = startDate; _Model.EndDate = endDate; DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetNorthtowerdaycalRecord, _Model); ERP.Utility.Excelimport.ExcelFileResult actionResult = new ERP.Utility.Excelimport.ExcelFileResult(dt) { FileDownloadName = "NTDaycalExcel.xls" }; return actionResult; }
public ActionResult Northtowerdaycal() { NorthTowerdaycal Model = new NorthTowerdaycal(); Model.StartDate = DateTime.Today.ToString("dd/MM/yyyy"); Model.EndDate = DateTime.Today.Date.ToString("dd/MM/yyyy"); return View(Model); }