public JsonResult GetAll(int ddrange, string fromdate, string todate, int ddData, int ddUserType, string search)
        {
            List <ENT.FundReport> lstEntity = new List <ENT.FundReport>();
            //jQuery DataTables Param
            var draw = Request.Form.GetValues("draw").FirstOrDefault();
            //Find paging info
            var start  = Request.Form.GetValues("start").FirstOrDefault();
            var length = Request.Form.GetValues("length").FirstOrDefault();
            //Find order columns info
            var sortColumn    = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][data]").FirstOrDefault();
            var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();

            int pageSize = length != null?Convert.ToInt32(length) : 0;

            int skip = start != null?Convert.ToInt16(start) : 1;

            skip = (skip / pageSize) + 1;
            COM.TTPagination.isPageing = true;
            COM.TTPagination.PageSize  = pageSize;
            COM.TTPagination.PageNo    = Convert.ToInt64(skip);

            lstEntity = new BAL.FundReport().GetAllSearch(ddrange, fromdate.GetDate(), todate.GetDate(), ddData, ddUserType, search, User.GetUserlevel(), Guid.Parse(User.Identity.GetUserId()));

            return(Json(new
            {
                draw = draw,
                recordsTotal = lstEntity.Count(),
                recordsFiltered = COM.TTPagination.RecordCount,
                data = lstEntity
            }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public HttpResponseMessage FundTransferReport(GetFundTransferReportModal modal)
        {
            GlobalVarible.Clear();
            List <ENT.FundReportApiView> lstEntity = new List <ENT.FundReportApiView>();

            try
            {
                //Find paging info
                var start  = modal.PageStart;
                var length = modal.PageSize;

                int pageSize = length != 0 ? length : 0;
                int skip     = start != 0 ? start : 1;
                skip = (skip / pageSize) + 1;

                COM.TTPagination.isPageing = true;
                COM.TTPagination.PageSize  = pageSize;
                COM.TTPagination.PageNo    = Convert.ToInt64(skip);

                using (BAL.FundReport objBal = new BAL.FundReport())
                {
                    if (modal.ddrange == 1)
                    {
                        lstEntity = objBal.GetAllSearchApi(modal.ddrange, modal.fromdate.GetDate(), modal.todate.GetDate(), modal.ddData, modal.search, User.GetUserlevel(), _LOGINUSERID);
                    }
                    else
                    {
                        lstEntity = objBal.GetAllSearchApi(modal.ddrange, DateTime.Now, DateTime.Now, modal.ddData, modal.search, User.GetUserlevel(), _LOGINUSERID);
                    }
                }

                GlobalVarible.AddMessage("Fund report get successfully.");
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity, COM.TTPagination.RecordCount }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }