public JsonResult NorthtowerDeptList(string startDate = "", string endDate = "", string DeptName = "", int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null)
 {
     try
     {
         try
         {
             EmployeewiseEntity _Model = new EmployeewiseEntity();
             _Model.DeptName = DeptName;
             _Model.StartDate = startDate;
             _Model.EndDate = endDate;
             DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetNTDeptRecord, _Model);
             List<EmployeewiseEntity> ItemList = null;
             ItemList = new List<EmployeewiseEntity>();
             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 EmployeewiseEntity()
                     {
                         PDate = dr["PDate"].ToString(),
                         EMPID = dr["EMPID"].ToString(),
                         EName = dr["EName"].ToString(),
                         Designation = dr["Designation"].ToString(),
                         DeptName = dr["DeptName"].ToString(),
                         Intime = dr["Intime"].ToString(),
                         Outtime = dr["Outtime"].ToString(),
                         Status = dr["Status"].ToString(),
                     });
                 }
                 iCount += 1;
             }
             var RecordCount = dt.Rows.Count;
             var Record = ItemList;
             Session["NTDept"] = 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 NorthtowerDept()
 {
     EmployeewiseEntity iDEPTWise = new EmployeewiseEntity();
     ViewData["DeptName"] = GetAllDepatementListItem();
     iDEPTWise.StartDate = DateTime.Today.Date.ToString("dd/MM/yyyy");
     iDEPTWise.EndDate = DateTime.Today.Date.ToString("dd/MM/yyyy");
     return View("NorthtowerDept", iDEPTWise);
 }
        public ActionResult EmployeeWise()
        {
            EmployeewiseEntity iEMPWise = new EmployeewiseEntity();
            ViewData["EMPID"] = GetAllEmployeewiseListItem();
            //iEMPWise.EMPID = frm["DropDown"];                   *Pass value as Parameter: EmployeeWise(string Empid, FormCollection frm)
            //iEMPWise.EMPID = Request["DropDown"];
            //iEMPWise.EMPID = ID;
            iEMPWise.StartDate = DateTime.Today.Date.ToString("dd/MM/yyyy");
            iEMPWise.EndDate = DateTime.Today.Date.ToString("dd/MM/yyyy");

            return View("EmployeeWise", iEMPWise);
        }
 //public ActionResult NTEMPExcelReport(string EX1 = "", string EX2 = "", string EX3 = "")
 //{
 //    EmployeewiseEntity _Model = new EmployeewiseEntity();
 //    _Model.StartDate = EX1;
 //    _Model.EndDate = EX2;
 //    _Model.EMPID = EX3;
 //    DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetEmployeewiseRecord, _Model);
 //    StringBuilder sb = new StringBuilder();
 //    sb.Append("<table border='" + "2px" + "'b>");
 //    //write column headings
 //    sb.Append("<tr>");
 //    foreach (System.Data.DataColumn dc in dt.Columns)
 //    {
 //        sb.Append("<td><b><font face=Arial size=2>" + dc.ColumnName + "</font></b></td>");
 //    }
 //    sb.Append("</tr>");
 //    foreach (System.Data.DataRow dr in dt.Rows)
 //    {
 //        sb.Append("<tr>");
 //        foreach (System.Data.DataColumn dc in dt.Columns)
 //        {
 //            sb.Append("<td><font face=Arial size=" + "14px" + ">" + dr[dc].ToString() + "</font></td>");
 //        }
 //        sb.Append("</tr>");
 //    }
 //    sb.Append("</table>");
 //    //this.Response.AddHeader("Content-Disposition", "Employees.xls");
 //    this.Response.ContentType = "application/vnd.ms-excel";
 //    byte[] buffer = System.Text.Encoding.UTF8.GetBytes(sb.ToString());
 //    return File(buffer, "application/vnd.ms-excel", "NorthTower.xls");
 //}
 public ActionResult NTEMPExcelReport(string EX1 = "", string EX2 = "", string EX3 = "")
 {
     EmployeewiseEntity _Model = new EmployeewiseEntity();
     _Model.StartDate = EX1;
     _Model.EndDate = EX2;
     _Model.EMPID = EX3;
     DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetEmployeewiseRecord, _Model);
     ERP.Utility.Excelimport.ExcelFileResult actionResult = new ERP.Utility.Excelimport.ExcelFileResult(dt) { FileDownloadName = "NTEmployeeWise.xls" };
     return actionResult;
 }
        public ActionResult EmployeeWiserptExcel()
        {
            EmployeewiseEntity obj;

            ReportClass rptH = new ReportClass();
            ArrayList al = new ArrayList();
            rptH.FileName = Server.MapPath("/Reports/EmployeeWiserpt.rpt");
            rptH.Load();

            List<EmployeewiseEntity> ItemList = (List<EmployeewiseEntity>)Session["EMPWISE"];

            foreach (EmployeewiseEntity dr in ItemList)
            {
                obj = new EmployeewiseEntity();

                obj.PDate = dr.PDate;
                obj.EMPID = dr.EMPID;
                obj.EName = dr.EName;
                obj.Designation = dr.Designation;
                obj.DeptName = dr.DeptName;
                obj.Intime = dr.Intime;
                obj.Outtime = dr.Outtime;
                obj.Status = dr.Status;
                al.Add(obj);
            }

            rptH.SetDataSource(al);
            MemoryStream stream = (MemoryStream)rptH.ExportToStream(ExportFormatType.Excel);   //For Excel File
            return File(stream, "application/octet-stream", "NorthTower.xls");    //For Excel with File Name
        }