public JsonResult MonthlyReport(string year, string month)
        {
            string[] value = User.Identity.Name.Split('|');

            ML.OFW.Contracts.Models.billsPayModel.MonthlyBillsPayReport smodel = new OFW.Contracts.Models.billsPayModel.MonthlyBillsPayReport();
            smodel.accountNo = value[1].Trim();
            smodel.UserName  = value[0].Trim();
            smodel.month     = Convert.ToInt32(month);
            smodel.year      = Convert.ToInt32(year);

            ML.OFW.Services.OFW service = new OFW.Services.OFW();

            var respVal = service.MonthlySendoutBillsPayReport(smodel);

            var model = new IenumerableReportResult();

            if (respVal.respCode != "0")
            {
                model.monthlyReport = respVal.listTransactions;
                int hasData = model.monthlyReport.Count();

                var model1 = new ReportsViewModel();
                model1.PrintBy         = respVal.printBy;
                model1.Date            = respVal.date;
                model1.runDate         = respVal.runDate;
                model1.TotalCount      = respVal.totalCount.ToString();
                model1.TotalCommission = String.Format("{0:#,##0.00}", Convert.ToDecimal(respVal.totalCommission));
                model1.TotalAmount     = String.Format("{0:#,##0.00}", Convert.ToDecimal(respVal.totalPrincipal));

                if (hasData > 0)
                {
                    return(Json(new
                    {
                        status = true,
                        respCode = "1",
                        msg = respVal.respMsg,
                        transDate = respVal.runDate,
                        printBy = respVal.printBy,
                        Date = respVal.date,
                        hasRecord = hasData,
                        otherData = model1,
                        monthlyReport = RenderPartialViewToString("_reportMonthly", model),
                    }, JsonRequestBehavior.AllowGet));
                }
                return(Json(new
                {
                    status = true,
                    respCode = "0",
                    msg = respVal.respMsg,
                    hasRecord = hasData
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                status = false,
                respCode = "0",
                msg = respVal.respMsg,
            }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult MonthlyCancellationReport(string year, string month)
        {
            string[] value = User.Identity.Name.Split('|');

            ML.OFW.Contracts.Models.billsPayModel.MonthlyBillsPayReport smodel = new OFW.Contracts.Models.billsPayModel.MonthlyBillsPayReport();
            smodel.accountNo = value[1].Trim();
            smodel.UserName  = value[0].Trim();
            smodel.month     = Convert.ToInt32(month);
            smodel.year      = Convert.ToInt32(year);

            ML.OFW.Services.OFW service = new OFW.Services.OFW();

            var respVal = service.MonthlyCancelBillsPayReport(smodel);

            var model = new IenumerableReportResult();

            if (respVal.respCode != "0")
            {
                model.monthlyReport = respVal.listTransactions;
                int hasData = model.monthlyReport.Count();

                if (hasData > 0)
                {
                    return(Json(new
                    {
                        status = true,
                        respCode = "1",
                        msg = respVal.respMsg,
                        transDate = respVal.runDate,
                        printBy = respVal.printBy,
                        Date = respVal.date,
                        hasRecord = hasData,
                        monthlyReport = RenderPartialViewToString("_reportMonthly", model),
                    }, JsonRequestBehavior.AllowGet));
                }
                return(Json(new
                {
                    status = true,
                    respCode = "0",
                    msg = respVal.respMsg,
                    hasRecord = hasData
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                status = false,
                respCode = "0",
                msg = respVal.respMsg,
            }, JsonRequestBehavior.AllowGet));
        }