// GET: Client/Home
        // GET: Admin/Home
        public ActionResult Index()
        {
            string UserId = Session["UserId"].ToString();

            //Start Search balance from userid
            Session["Balance"] = _walletUser.UserInfo(UserId).Balance.ToString();
            //Ends
            var lst = _services.GetServicesList(UserId).MapObjects <ServicesModel>();
            List <ServicesModel> servicesModels = new List <ServicesModel>();

            foreach (var item in lst)
            {
                ServicesModel model = new ServicesModel();
                model.ProductId       = item.ProductId.EncryptParameter();
                model.ProductLogo     = item.ProductLogo;
                model.ProductLabel    = item.ProductLabel;
                model.ProductCategory = item.ProductCategory;
                model.ClientPmtUrl    = string.IsNullOrEmpty(item.ProductUrl) ? item.ClientPmtUrl : item.ProductUrl;
                model.CommissionValue = item.CommissionValue;
                model.CommissionType  = item.CommissionType;
                model.Company         = item.Company;
                model.Status          = item.Status.Trim();//== "Y" ? "checked" : "";
                servicesModels.Add(model);
            }
            return(View(servicesModels));
            //return View();
        }
Exemple #2
0
        public ActionResult RequestCard(CardModel cardModels)
        {
            int   ReqAmount = 0;
            float AvaBalnce = 0;

            cardModels.Balance = Session["Balance"].ToString();
            //CardModel cardModel = new CardModel();
            var cardType = _card.GetCardType();

            foreach (var item in cardType.Where(kvp => kvp.Value.ToUpper() == "VIRTUAL CARD").ToList())
            {
                cardType.Remove(item.Key);
            }
            cardModels.CardTypeList = ApplicationUtilities.SetDDLValue(cardType as Dictionary <string, string>, "", "--Card Type--");

            if (int.TryParse(cardModels.Amount, out ReqAmount))
            {
                if (ReqAmount < 100) //|| ReqAmount>1000
                {
                    ModelState.AddModelError("Amount", "Amount should be at least RS. 100");
                    return(View(cardModels));
                }
            }
            else
            {
                ModelState.AddModelError("Amount", "Invalid Requested amount.");
                return(View(cardModels));
            }
            if (float.TryParse(cardModels.Balance, out AvaBalnce))
            {
                if (ReqAmount > AvaBalnce)
                {
                    ModelState.AddModelError("Amount", "Requested amount greater then balance");
                    return(View(cardModels));
                }
            }
            cardModels.UserId   = Session["UserId"].ToString();
            cardModels.AgentId  = Session["AgentId"].ToString();
            cardModels.UserName = Session["UserName"].ToString();
            //cardModels.UserName = Session["FullName"].ToString();
            WalletUserInfo walletUser = _walletUserBusiness.UserInfo(cardModels.UserId);

            cardModels.Email      = walletUser.Email;
            cardModels.MobileNo   = walletUser.MobileNo;
            cardModels.ActionUser = cardModels.UserName;
            cardModels.CreatedIp  = ApplicationUtilities.GetIP();
            CardCommon cardCommon = cardModels.MapObject <CardCommon>();
            //CommonDbResponse dbResponse = _card.CardApproval(cardCommon);
            CommonDbResponse dbResponse = _card.RequestCard(cardCommon);

            if (dbResponse.Code == 0)
            {
                //dbResponse.SetMessageInTempData(this, "Index");
                return(RedirectToAction("Index"));
            }
            dbResponse.SetMessageInTempData(this, "Index");
            return(View(cardModels));
        }
Exemple #3
0
        public ActionResult Profile()
        {
            #region FileLocation

            string FileLocation;
            string usertype = Session["UserType"].ToString();
            if (usertype.ToLower() == "distributor")
            {
                FileLocation = "/Content/userupload/Distributor/kyc/";
            }
            else if (usertype.ToLower() == "sub-distributor")
            {
                FileLocation = "/Content/userupload/SubDistributor/kyc/";
            }
            else if (usertype.ToLower() == "walletuser")
            {
                FileLocation = "/Content/userupload/Walletuser/kyc/";
            }
            else if (usertype.ToLower() == "merchant")
            {
                FileLocation = "/Content/userupload/Merchant/kyc/";
            }
            else if (usertype.ToLower() == "agent")
            {
                FileLocation = "/Content/userupload/Agent/kyc/";
            }
            else if (usertype.ToLower() == "sub-agent")
            {
                FileLocation = "/Content/userupload/SubAgent/kyc/";
            }
            else
            {
                FileLocation = "/Content/userupload/";
            }
            #endregion
            string         UserId     = Session["UserName"].ToString();
            WalletUserInfo walletUser = _walletUserBusiness.UserInfo(UserId);
            return(View(walletUser));
        }
Exemple #4
0
        // GET: Admin/Card
        public ActionResult Index(string UserId = "", string AgentId = "")
        {
            var userID = UserId.DecryptParameter();

            if (string.IsNullOrEmpty(UserId))
            {
                return(RedirectToAction("", "Home", new { area = "Admin" }));
            }
            var cardCommonList = _card.GetCardList(userID);
            var UserInfo       = _walletUserBusiness.UserInfo(userID);

            ViewBag.UserName       = UserInfo.UserName;
            ViewBag.FullName       = UserInfo.FullName;
            Session["CardForUser"] = UserInfo.UserName;

            //Actions
            foreach (var item in cardCommonList)
            {
                item.Action = StaticData.GetActions("UserCard", item.UserId.EncryptParameter(), this, "", "", item.CardNo.EncryptParameter(), item.Status, item.AgentId.EncryptParameter(), item.CardType);
                #region Status
                if (item.Status.ToUpper().Equals("YES") || item.Status.ToUpper().Equals("Y"))
                {
                    item.Status = "<span class='badge badge-success'>Enabled</span>";
                }
                if (item.Status.ToUpper().Equals("NO") || item.Status.ToUpper().Equals("N"))
                {
                    item.Status = "<span class='badge badge-danger'>Disabled</span>";
                }
                #endregion
                #region CardType
                if (item.CardType.Equals("1"))
                {
                    item.CardType = "<span class='badge badge-success'>Virtual</span>";
                }
                else if (item.CardType.Equals("2"))
                {
                    item.CardType = "<span class='badge badge-success'>Gift</span>";
                }
                else if (item.CardType.Equals("3"))
                {
                    item.CardType = "<span class='badge badge-success'>Discount</span>";
                }
                else if (item.CardType.Equals("4"))
                {
                    item.CardType = "<span class='badge badge-success'>Prepaid</span>";
                }
                else
                {
                    item.CardType = "<span class='badge badge-success'>Others</span>";
                }
                #endregion
            }
            //Column Creator
            IDictionary <string, string> param = new Dictionary <string, string>();
            param.Add("FullName", "Name");
            param.Add("MobileNo", "Mobile Number");
            param.Add("Email", "Email");
            param.Add("CardType", "Card type");
            param.Add("CardNo", "Card No.");
            param.Add("IssueDate", "Issue Date");
            param.Add("ExpiryDate", "Expiry Date");
            param.Add("Status", "Status");
            param.Add("Action", "Action");
            ProjectGrid.column = param;
            //Ends
            //Add New
            var grid = ProjectGrid.MakeGrid(cardCommonList, "", "", 0, true, "", "", "Home", "Card", "/Admin/Card", "/Admin/Card/AddCard?UserId=" + UserId + "&AgentId=" + AgentId);
            ViewData["grid"] = grid;
            if (cardCommonList.Count() == 0)
            {
                ViewBag.EmptyMessage = "True";
            }
            return(View());
        }