public async Task <ActionResult> WebMerchTxnSearch(jQueryDataTableParamModel Params, TxnSearchModel Model, bool isDownload)
        {
            TxnSearchMaint _Maint    = new TxnSearchMaint();
            var            _filtered = new List <MerchPostedTxnSearch>();

            var list = (await TransactionSearchService.GetMerchTransactionSearch(Model.BusnLocation, Model.MerchAcctNo, Model.SelectedMerchTxnCd, Model.MerchFromDate, Model.MerchToDate, Model.SelectedTxnCategory)).merchPostedTxnSearches;

            if (!string.IsNullOrEmpty(Params.sSearch))
            {
                Params.sSearch = Params.sSearch.ToLower();
            }
            if (!isDownload)
            {
                _filtered = list.Skip(Params.iDisplayStart).Take(Params.iDisplayLength).ToList();
                return(Json(new
                {
                    sEcho = Params.sEcho,
                    iTotalRecords = list.Count(),
                    iTotalDisplayRecords = list.Count(),
                    aaData = _filtered.Select(x => new object[] { null, x.SelectedDealer, x.TermBatch, x.TxnDate, x.cardNo, x.TxnDesp, x.TxnAmt, x.TermId,
                                                                  x.AuthNo, x.AuthCardNo, x.PrcsDate, x.TxnId, x.ProductDescp, x.ProductQty, x.ProductAmt, x.VATAmt, x.BaseAmt, x.VATCd, x.VATRate, })
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var title    = "Transaction search | Merchant";
                var toExport = new List <string[]>();
                var Header   = list.First().ExcelHeader;
                foreach (var item in list)
                {
                    toExport.Add(item.ExcelBody());
                }
                var ExcelPkg = Common.CommonHelpers.CreateExcel(Header, toExport, title);
                return(File(ExcelPkg.GetAsByteArray(), "application/vnd.ms-excel", title + ".xlsx"));
            }
        }