Exemple #1
0
        public PartialViewResult IndexGrid()
        {
            var db                = new DBContext();
            var remitterid        = Session["MerchantDMRId"].ToString();
            var remtterMob        = db.TBL_DMR_REMITTER_INFORMATION.FirstOrDefault(x => x.RemitterID == remitterid);
            var PaymentValidation = MoneyTransferAPI.RemitterDetails(remtterMob.MobileNo);

            if (PaymentValidation.statuscode == "TXN")
            {
                var limit           = PaymentValidation.data.remitter_limit[0];
                var limitTotal      = limit.limit.total;
                var beneficiarylist = PaymentValidation.data.beneficiary;
                foreach (var listitem in beneficiarylist)
                {
                    string beneid   = listitem.id.Value;
                    var    benelist = db.TBL_REMITTER_BENEFICIARY_INFO.Where(x => x.BeneficiaryID == beneid).FirstOrDefault();
                    if (benelist != null)
                    {
                        benelist.Bank            = listitem.bank.Value;
                        db.Entry(benelist).State = System.Data.Entity.EntityState.Modified;
                        db.SaveChanges();
                    }
                }
            }
            //var bankdetails = db.TBL_SETTINGS_BANK_DETAILS.Where(x => x.ISDELETED == 0  && x.MEM_ID==MemberCurrentUser.MEM_ID).ToList();
            var bankdetails = db.TBL_REMITTER_BENEFICIARY_INFO.Where(x => x.IsActive == 0 && x.RemitterID == remitterid).ToList();

            return(PartialView("IndexGrid", bankdetails));
        }
Exemple #2
0
        private IGrid <TBL_REMITTER_BENEFICIARY_INFO> CreateExportableGrid()
        {
            try
            {
                var db                = new DBContext();
                var remitterid        = Session["MerchantDMRId"].ToString();
                var remtterMob        = db.TBL_DMR_REMITTER_INFORMATION.FirstOrDefault(x => x.RemitterID == remitterid);
                var PaymentValidation = MoneyTransferAPI.RemitterDetails(remtterMob.MobileNo);
                if (PaymentValidation.statuscode == "TXN")
                {
                    var limit           = PaymentValidation.data.remitter_limit[0];
                    var limitTotal      = limit.limit.total;
                    var beneficiarylist = PaymentValidation.data.beneficiary;
                    foreach (var listitem in beneficiarylist)
                    {
                        string beneid   = listitem.id.Value;
                        var    benelist = db.TBL_REMITTER_BENEFICIARY_INFO.Where(x => x.BeneficiaryID == beneid).FirstOrDefault();
                        if (benelist != null)
                        {
                            benelist.Bank            = listitem.bank.Value;
                            db.Entry(benelist).State = System.Data.Entity.EntityState.Modified;
                            db.SaveChanges();
                        }
                    }
                }
                //var bankdetails = db.TBL_SETTINGS_BANK_DETAILS.Where(x => x.ISDELETED == 0  && x.MEM_ID==MemberCurrentUser.MEM_ID).ToList();
                var bankdetails = db.TBL_REMITTER_BENEFICIARY_INFO.Where(x => x.IsActive == 0 && x.RemitterID == remitterid).ToList();

                IGrid <TBL_REMITTER_BENEFICIARY_INFO> grid = new Grid <TBL_REMITTER_BENEFICIARY_INFO>(bankdetails);
                grid.ViewContext = new ViewContext {
                    HttpContext = HttpContext
                };
                grid.Query = Request.QueryString;
                grid.Columns.Add(model => model.BeneficiaryID).Titled("BENEFICIARY ID").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.Bank).Titled("BANK").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.IFSC).Titled("IFSC").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.Mobile).Titled("MOBILE").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.BeneficiaryName).Titled("BENEFICIARY NAME").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.ID).Titled("").Encoded(false).Filterable(false).Sortable(false)
                .RenderedAs(model => "<a href='javascript:void(0)' class='btn btn-danger btn-xs' onclick='DeActivateBeneficiary(" + model.ID + ");return 0;'>DELETE</a>");
                grid.Pager = new GridPager <TBL_REMITTER_BENEFICIARY_INFO>(grid);
                grid.Processors.Add(grid.Pager);
                grid.Pager.RowsPerPage = 6;

                //foreach (IGridColumn column in grid.Columns)
                //{
                //    column.Filter.IsEnabled = true;
                //    column.Sort.IsEnabled = true;
                //}

                return(grid);
            }
            catch (Exception ex)
            {
                Logger.Error("Controller:-  MerchantDMRDashboard(Merchant), method:- CreateExportableGrid(POST) Line No:- 421", ex);
                throw ex;
            }
        }
        private IGrid <DMR_Bank_List> DisplayDMRBankList()
        {
            try
            {
                var db = new DBContext();
                //var remitterid = Session["MerchantDMRId"].ToString();
                var    remitterid                = "123456879";
                string accountNo                 = "7278526668";
                var    PaymentValidation         = MoneyTransferAPI.RemitterDetails(accountNo);
                List <DMR_Bank_List> objbanklist = new List <DMR_Bank_List>();
                if (PaymentValidation.data.beneficiary != null)
                {
                    foreach (var banklist in PaymentValidation.data.beneficiary)
                    {
                        DMR_Bank_List objval = new DMR_Bank_List()
                        {
                            ID             = banklist.id,
                            Name           = banklist.name,
                            BANK_IIN       = banklist.account,
                            BANK_Sort_Name = banklist.mobile,
                            BANK_Name      = banklist.bank,
                            BRANCK_Ifsc    = banklist.ifsc,
                            IS_Down        = banklist.imps
                        };
                        objbanklist.Add(objval);
                    }
                }
                var DMRTransaction = objbanklist.ToList();

                //var DMRTransaction = db.TBL_DMR_FUND_TRANSFER_DETAILS.Where(x => x.REMITTER_ID == remitterid).ToList();
                ////var bankdetails = db.TBL_SETTINGS_BANK_DETAILS.Where(x => x.ISDELETED == 0  && x.MEM_ID==MemberCurrentUser.MEM_ID).ToList();
                //var bankdetails = db.TBL_REMITTER_BENEFICIARY_INFO.Where(x => x.IsActive == 0 && x.RemitterID == remitterid).ToList();

                IGrid <DMR_Bank_List> grid = new Grid <DMR_Bank_List>(DMRTransaction);
                grid.ViewContext = new ViewContext {
                    HttpContext = HttpContext
                };
                grid.Query = Request.QueryString;
                grid.Columns.Add(model => model.ID).Titled("ID").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.Name).Titled("NAME").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.BANK_IIN).Titled("ACCOUNT").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.BANK_Name).Titled("Bank Name").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.BANK_Sort_Name).Titled("Bank Sort").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.BRANCK_Ifsc).Titled("IFSC").Filterable(true).Sortable(true);
                grid.Columns.Add(model => model.IS_Down).Titled("IMPS").Filterable(true).Sortable(true);

                //grid.Columns.Add(model => model.ID).Titled("").Encoded(false).Filterable(false).Sortable(false)
                //    .RenderedAs(model => "<a href='javascript:void(0)' class='btn btn-denger btn-xs' onclick='DeActivateBeneficiary(" + model.ID + ");return 0;'>DELETE</a>");
                grid.Pager = new GridPager <DMR_Bank_List>(grid);
                grid.Processors.Add(grid.Pager);
                grid.Pager.RowsPerPage = 6;

                //foreach (IGridColumn column in grid.Columns)
                //{
                //    column.Filter.IsEnabled = true;
                //    column.Sort.IsEnabled = true;
                //}

                return(grid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        public async Task <ActionResult> Index(DMRLoginViewModel User, string ReturnURL = "")
        {
            try
            {
                const string agentId = "2";
                //string OperatorName = Request.Form["OperatorName"];
                //string operatorId = Request.Form["OperatorId"];
                var db = new DBContext();
                var checkloginStatus = await db.TBL_DMR_REMITTER_INFORMATION.Where(x => x.MobileNo == User.MobileNo).FirstOrDefaultAsync();

                if (checkloginStatus.UpdateStatus == 0)
                {
                    var PaymentValidation = MoneyTransferAPI.RemitterDetails(User.MobileNo, "");
                    if (PaymentValidation.statuscode == "TXN")
                    {
                        checkloginStatus.Address         = PaymentValidation.data.remitter.address;
                        checkloginStatus.City            = PaymentValidation.data.remitter.city;
                        checkloginStatus.State           = PaymentValidation.data.remitter.state;
                        checkloginStatus.State           = PaymentValidation.data.remitter.state;
                        checkloginStatus.KYCStatus       = PaymentValidation.data.remitter.kycstatus;
                        checkloginStatus.ConsumedLimited = Convert.ToDecimal(PaymentValidation.data.remitter.consumedlimit);
                        checkloginStatus.RemainingLimit  = Convert.ToDecimal(PaymentValidation.data.remitter.remaininglimit);
                        var limit      = PaymentValidation.data.remitter_limit[0];
                        var limitTotal = limit.limit.total;
                        checkloginStatus.Total           = Convert.ToDecimal(limitTotal);
                        checkloginStatus.KYCDocs         = PaymentValidation.data.remitter.kycdocs;
                        checkloginStatus.Perm_txn_limit  = Convert.ToDecimal(PaymentValidation.data.remitter.perm_txn_limit);
                        checkloginStatus.UpdateStatus    = 1;
                        db.Entry(checkloginStatus).State = System.Data.Entity.EntityState.Modified;
                        await db.SaveChangesAsync();

                        var beneficiarylist = PaymentValidation.data.beneficiary;
                        foreach (var listitem in beneficiarylist)
                        {
                            string beneid   = listitem.id.Value;
                            var    benelist = await db.TBL_REMITTER_BENEFICIARY_INFO.Where(x => x.BeneficiaryID == beneid).FirstOrDefaultAsync();

                            benelist.Bank            = listitem.bank.Value;
                            db.Entry(benelist).State = System.Data.Entity.EntityState.Modified;
                            await db.SaveChangesAsync();
                        }
                        var ipat_id = PaymentValidation.data.remitter.id;

                        Session["MerchantDMRId"] = ipat_id.Value;
                        return(RedirectToAction("DMRInformation", "MerchantDMRDashboard", new { area = "Merchant" }));
                    }
                    else
                    {
                        //return Json(PaymentValidation);
                        ViewBag.Message = "Invalid Credential or Access Denied";
                        return(View());
                    }
                }
                else
                {
                    Session["MerchantDMRId"] = checkloginStatus.RemitterID;
                    return(RedirectToAction("DMRInformation", "MerchantDMRDashboard", new { area = "Merchant" }));
                }
            }
            catch (Exception ex)
            {
                //throw ex;
                ViewBag.Message = "Invalid Credential or Access Denied";
                Logger.Error("Controller:-  MerchantDMRLogin(Merchant), method:- Index(POST) Line No:- 133", ex);
                return(View());
            }
            return(View());
        }