public ActionResult Index()
        {
            if (Session["MerchantUserId"] != null)
            {
                string pathval     = Server.MapPath("~/Test CERT/myprivatekey.pfx");
                string keyPath_Val = Server.MapPath("~/Test CERT/myprivatekey.pfx");
                //sessionId = ssl.SessionNo;
                ssl.CERTNo = "399D169D3A72AE32D370242EF0FAE5BA5C026421";

                string param = _BalancestrRequest("349690", "351905", "351906", SessionNo);
                ssl.message  = ssl.Sign_With_PFX(param, keyPath_Val, "rahul123");
                ssl.htmlText = ssl.CallCryptoAPI(ssl.message, URL_PATH);

                initpage();
                var db           = new DBContext();
                var availablebal = db.TBL_MASTER_MEMBER.Where(x => x.MEM_ID == CurrentMerchant.MEM_ID).FirstOrDefault();
                if (availablebal != null)
                {
                    if (availablebal.BALANCE > 0)
                    {
                        ViewBag.AvailableBalance = availablebal.BALANCE;
                    }
                    else
                    {
                        ViewBag.AvailableBalance = 0;
                    }
                }
                else
                {
                    ViewBag.AvailableBalance = 0;
                }
                List <string>          val    = new List <string>();
                MerchantBaseController objval = new MerchantBaseController();
                val = objval.GetTreeMember(CurrentMerchant.MEM_ID);
                foreach (var listinfo in val)
                {
                    string[] userinfo  = listinfo.Split(',');
                    string   UserID    = userinfo[0];
                    string   UserIdVal = Decrypt.DecryptMe(UserID);
                    string   UserName  = userinfo[1];
                }
                return(View());
            }
            else
            {
                FormsAuthentication.SignOut();
                Session["MerchantUserId"]   = null;
                Session["MerchantUserName"] = null;
                Session.Clear();
                Session.Remove("MerchantUserId");
                Session.Remove("MerchantUserName");
                //return RedirectToAction("Index", "Login", new { area = "" });
                return(RedirectToAction("Index", "Login", new { area = "" }));
            }
        }
Beispiel #2
0
        // GET: Merchant/MerchantDashboard
        public ActionResult Index()
        {
            if (Session["MerchantUserId"] != null)
            {
                //Ezypay_Recharge_APIDetails objvalq = new Ezypay_Recharge_APIDetails();
                //string valueapi = objvalq.GetResponseAPI();
                //string MobileRechargeAPI = objvalq.GetMobileRechargeResponseAPI();
                //Ezypay_Recharge_APIDetails objvalq = new Ezypay_Recharge_APIDetails();
                ////string valueapi = Ezypay_Recharge_APIDetails.GetResponseAPI();
                ////string DMRAPI = DMR_API_EXECUTE.CreateDMRSender("9903116214", "Rahul");
                //string MobileRechargeAPI = Ezypay_Recharge_APIDetails.GetMobileRechargeResponseAPI();
                initpage();
                var db = new DBContext();

                var availableAmt = db.TBL_ACCOUNTS.Where(x => x.MEM_ID == CurrentMerchant.MEM_ID).OrderByDescending(z => z.TRANSACTION_DATE).FirstOrDefault();
                if (availableAmt != null)
                {
                    ViewBag.RetailerAvailableAmt = availableAmt.OPENING;
                }
                else
                {
                    ViewBag.RetailerAvailableAmt = "0";
                }


                var availablebal = db.TBL_MASTER_MEMBER.Where(x => x.MEM_ID == CurrentMerchant.MEM_ID).FirstOrDefault();
                if (availablebal != null)
                {
                    if (availablebal.BALANCE > 0)
                    {
                        ViewBag.AvailableBalance = availablebal.BALANCE;
                    }
                    else
                    {
                        ViewBag.AvailableBalance = 0;
                    }
                }
                else
                {
                    ViewBag.AvailableBalance = 0;
                }

                var walletamount = db.TBL_ACCOUNTS.Where(x => x.MEM_ID == CurrentMerchant.MEM_ID).OrderByDescending(z => z.TRANSACTION_TIME).FirstOrDefault();
                if (walletamount != null)
                {
                    ViewBag.openingAmt = walletamount.OPENING;
                    ViewBag.closingAmt = walletamount.CLOSING;
                }
                else
                {
                    ViewBag.openingAmt = "0";
                    ViewBag.closingAmt = "0";
                }

                List <string>          val    = new List <string>();
                MerchantBaseController objval = new MerchantBaseController();
                val = objval.GetTreeMember(CurrentMerchant.MEM_ID);
                foreach (var listinfo in val)
                {
                    string[] userinfo  = listinfo.Split(',');
                    string   UserID    = userinfo[0];
                    string   UserIdVal = Decrypt.DecryptMe(UserID);
                    string   UserName  = userinfo[1];
                }
                return(View());
            }
            else
            {
                return(RedirectToAction("Index", "MerchantLogin", new { area = "Merchant" }));
            }
        }