public async Task <ActionResult> GetExemptionReport(int draw, int start, int length, string reportdate)
        {
            //string search = Request.QueryString["search[value]"];
            //int sortColumn = -1;
            //string sortDirection = "asc";
            //if (length == -1)
            //{
            //    length = TOTAL_ROWS;
            //}

            //// note: we only sort one column at a time
            //if (Request.QueryString["order[0][column]"] != null)
            //{
            //    sortColumn = int.Parse(Request.QueryString["order[0][column]"]);
            //}
            //if (Request.QueryString["order[0][dir]"] != null)
            //{
            //    sortDirection = Request.QueryString["order[0][dir]"];
            //}
            DataTableData dataTableData = new DataTableData();

            try
            {
                start++;
                DateTime report_date;
                //DateTime end_date;
                var stSuc = DateTime.TryParse(GetDate(reportdate), out report_date);
                //var adSuc = DateTime.TryParse(GetDate(todate), out end_date);
                if (!stSuc)
                {
                    dataTableData.draw = draw;

                    //dataTableData.recordsTotal = 0; //  TOTAL_ROWS;
                    // int recordsFiltered = 0;
                    dataTableData.data = new List <Rpt_Exemption>();  //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                    // dataTableData.recordsFiltered = 0;
                }
                else
                {
                    dataTableData.draw = draw;
                    //var cnt = await _repo.GetLoginAttemptTotalCountAsync(report_date);
                    var data = await _repo.GetExemptionReportAsync(report_date, start, length);

                    //dataTableData.recordsTotal = cnt; //  TOTAL_ROWS;
                    // int recordsFiltered = 0;
                    dataTableData.data = data;  //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                    //dataTableData.recordsFiltered = data.Count; // recordsFiltered;
                }
            }
            catch (Exception ex)
            {
                dataTableData.draw = draw;

                dataTableData.recordsTotal = 0;                             //  TOTAL_ROWS;
                                                                            // int recordsFiltered = 0;
                dataTableData.data            = new List <Rpt_Exemption>(); //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                dataTableData.recordsFiltered = 0;
            }
            return(Json(dataTableData, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AjaxGetJsonData(int draw, int start, int length, string fromdate, string todate)
        {
            string search = Request.QueryString["search[value]"];
            //string from__date = Request.QueryString["data[fromdate]"];
            //string to__date = Request.QueryString["data[todate]"];
            int    sortColumn    = -1;
            string sortDirection = "asc";

            if (length == -1)
            {
                length = TOTAL_ROWS;
            }

            // note: we only sort one column at a time
            if (Request.QueryString["order[0][column]"] != null)
            {
                sortColumn = int.Parse(Request.QueryString["order[0][column]"]);
            }
            if (Request.QueryString["order[0][dir]"] != null)
            {
                sortDirection = Request.QueryString["order[0][dir]"];
            }

            DataTableData dataTableData = new DataTableData();

            dataTableData.draw         = draw;
            dataTableData.recordsTotal = TOTAL_ROWS;
            int recordsFiltered = 0;

            dataTableData.data            = FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
            dataTableData.recordsFiltered = recordsFiltered;

            return(Json(dataTableData, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> GetLoginUser(int draw, int start, int length)
        {
            //string search = Request.QueryString["search[value]"];
            //int sortColumn = -1;
            //string sortDirection = "asc";
            //if (length == -1)
            //{
            //    length = TOTAL_ROWS;
            //}

            //// note: we only sort one column at a time
            //if (Request.QueryString["order[0][column]"] != null)
            //{
            //    sortColumn = int.Parse(Request.QueryString["order[0][column]"]);
            //}
            //if (Request.QueryString["order[0][dir]"] != null)
            //{
            //    sortDirection = Request.QueryString["order[0][dir]"];
            //}
            DataTableData dataTableData = new DataTableData();

            try
            {
                start++;
                //DateTime start_date;
                // DateTime end_date;

                dataTableData.draw = draw;
                //var cnt = await _repo.GetRptAuditTotalCountAsync(institutionId, start_date, end_date, userid);
                var data = await _repo.GetLoginUserAsync(start, length);

                dataTableData.recordsTotal = data.Count;    //  TOTAL_ROWS;
                // int recordsFiltered = 0;
                dataTableData.data            = data;       //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                dataTableData.recordsFiltered = data.Count; // recordsFiltered;
            }
            catch (Exception ex)
            {
                dataTableData.draw = draw;

                dataTableData.recordsTotal = 0;                             //  TOTAL_ROWS;
                                                                            // int recordsFiltered = 0;
                dataTableData.data            = new List <Rpt_LoginUser>(); //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                dataTableData.recordsFiltered = 0;
            }
            return(Json(dataTableData, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> GetSettlementEnquiry(int draw, int start, int length, SettlementEnquiryObj obj)
        {
            DataTableData dataTableData = new DataTableData();

            try
            {
                start++;
                // DateTime start_date;
                // DateTime end_date;
                //var stSuc = DateTime.TryParse(GetDate(obj.fromDate), out start_date);
                //var adSuc = DateTime.TryParse(GetDate(obj.toDate), out end_date);
                //if (!stSuc || !adSuc)
                //{
                //    dataTableData.draw = draw;

                //    dataTableData.recordsTotal = 0; //  TOTAL_ROWS;
                //                                    // int recordsFiltered = 0;
                //    dataTableData.data = new List<SettlementEnquiryObj>();  //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                //    dataTableData.recordsFiltered = 0;
                //}
                //else
                //{
                dataTableData.draw = draw;
                var data = await _repo2.GetSettlementEnquiryAsync(obj);

                //dataTableData.recordsTotal = cnt; //  TOTAL_ROWS;
                //int recordsFiltered = 0;
                dataTableData.data            = data;       //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                dataTableData.recordsFiltered = data.Count; // recordsFiltered;
                // }
            }
            catch (Exception ex)
            {
                dataTableData.draw = draw;

                dataTableData.recordsTotal = 0;                                   //  TOTAL_ROWS;
                                                                                  // int recordsFiltered = 0;
                dataTableData.data            = new List <SM_SETTLEMENTDETAIL>(); //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                dataTableData.recordsFiltered = 0;
            }
            return(Json(dataTableData, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> GetNapsEnquiry(int draw, int start, int length, string fromdate, string todate, string batchid)
        {
            //string search = Request.QueryString["search[value]"];
            //int sortColumn = -1;
            //string sortDirection = "asc";
            //if (length == -1)
            //{
            //    length = TOTAL_ROWS;
            //}

            //// note: we only sort one column at a time
            //if (Request.QueryString["order[0][column]"] != null)
            //{
            //    sortColumn = int.Parse(Request.QueryString["order[0][column]"]);
            //}
            //if (Request.QueryString["order[0][dir]"] != null)
            //{
            //    sortDirection = Request.QueryString["order[0][dir]"];
            //}
            DataTableData dataTableData = new DataTableData();

            try
            {
                start++;
                DateTime start_date;
                DateTime end_date;
                var      stSuc = DateTime.TryParse(GetDate(fromdate), out start_date);
                var      adSuc = DateTime.TryParse(GetDate(todate), out end_date);
                if (!stSuc || !adSuc)
                {
                    dataTableData.draw = draw;

                    dataTableData.recordsTotal = 0;                       //  TOTAL_ROWS;
                                                                          // int recordsFiltered = 0;
                    dataTableData.data            = new List <NapsObj>(); //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                    dataTableData.recordsFiltered = 0;
                }
                else
                {
                    dataTableData.draw = draw;
                    batchid            = string.IsNullOrEmpty(batchid.Trim()) ? null : batchid.Trim();
                    var recP = await _repo.GetNapsEnquiryCountAsync(start_date, end_date, batchid);

                    var cnt  = recP;
                    var data = await _repo.GetNapsEnquiryAsync(start_date, end_date, batchid);

                    dataTableData.recordsTotal = cnt;           //  TOTAL_ROWS;
                                                                // int recordsFiltered = 0;
                    dataTableData.data            = data;       //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                    dataTableData.recordsFiltered = data.Count; // recordsFiltered;
                }
            }
            catch (Exception ex)
            {
                dataTableData.draw = draw;

                dataTableData.recordsTotal = 0;                         //  TOTAL_ROWS;
                                                                        // int recordsFiltered = 0;
                dataTableData.data            = new List <Rpt_Audit>(); //FilterData(ref recordsFiltered, start, length, search, sortColumn, sortDirection);
                dataTableData.recordsFiltered = 0;
            }
            return(Json(dataTableData, JsonRequestBehavior.AllowGet));
        }