public ActionResult ManageAgentCommissionCategory(CommissionCategoryModel CCM)
        {
            if (ModelState.IsValid)
            {
                CommissionCategoryCommon CCC = new CommissionCategoryCommon();

                if (!string.IsNullOrEmpty(CCM.CategoryId))
                {
                    CCC.CategoryId = CCM.CategoryId.DecryptParameter();
                    if (string.IsNullOrEmpty(CCC.CategoryId))
                    {
                        return(RedirectToAction("Category"));
                    }
                }
                CCC.CategoryId   = CCM.CategoryId.DecryptParameter();
                CCC.CategoryName = CCM.CategoryName;
                CCC.IpAddress    = ApplicationUtilities.GetIP();
                CCC.ActionUser   = Session["username"].ToString();
                CCC.AgentId      = ApplicationUtilities.GetSessionValue("agentid").ToString();
                CommonDbResponse dbresp = comm.ManageAgentCommissionCategory(CCC);


                if (dbresp.Code == 0)
                {
                    this.ShowPopup((int)dbresp.Code, dbresp.Message);
                    return(RedirectToAction("Category"));
                }
            }
            this.ShowPopup(1, "Error");
            return(View());
        }
 public void AddBalance(WalletUserInfoModel walletUserModel)
 {
     ModelState.Remove("FullName");
     ModelState.Remove("Email");
     ModelState.Remove("MobileNo");
     if (ModelState.IsValid)
     {
         WalletUserInfo walletUser = new WalletUserInfo();
         walletUser.AgentId = Session["AddAgentId"].ToString();
         //walletUser.FullName = Session["AddFullName"].ToString();
         Session.Remove("AddAgentId");
         walletUser.BalanceToAdd = walletUserModel.BalanceToAdd;
         walletUser.Remarks      = walletUserModel.Remarks;
         walletUser.ActionUser   = Session["UserName"].ToString();
         walletUser.ActionIP     = ApplicationUtilities.GetIP();
         //HttpContext httpCtx = HttpContext.Current;
         //walletUser.ActionBrowser = httpCtx.Request.Headers["User-Agent"];
         CommonDbResponse dbresp = _CustomerManagement.InsertBalance(walletUser);
         if (dbresp.ErrorCode == 0)
         {
             this.ShowPopup(0, "Succesfully Added amount: " + walletUser.BalanceToAdd);
             return;
         }
         dbresp.SetMessageInTempData(this, "Index");
     }
     else
     {
         this.ShowPopup(1, "Amount Not Added");
     }
 }
Esempio n. 3
0
        public ActionResult EditSearchUser(UserCommon model)
        {
            ViewBag.Roles = ApplicationUtilities.SetDDLValue(LoadDropdownList("ManageUser") as Dictionary <string, string>, model.RoleId, "--Select Role--");

            //model.Roles = LoadDropdownList("ManageUser") as List<SelectListItem>;
            string userId = "";

            userId = model.UserID;
            if (!string.IsNullOrEmpty(model.UserID))
            {
                if (string.IsNullOrEmpty(model.UserID.DecryptParameter()))
                {
                    return(RedirectToAction("SearchUser"));
                }

                model.UserID = userId.DecryptParameter();
            }
            ModelStateValidation(String.IsNullOrEmpty(userId) ? "Insert" : "Update");
            if (ModelState.IsValid)
            {
                model.ActionUser = Session["username"].ToString();
                model.IpAddress  = ApplicationUtilities.GetIP();
                //model.CreatedPlatform = ApplicationUtilities.
                CommonDbResponse resp = buss.ManageUser(model);
                resp.SetMessageInTempData(this);
                if (resp.Code == 0)
                {
                    return(RedirectToAction("SearchUser"));
                }
            }
            model.UserID = userId;
            return(View(model));
        }
Esempio n. 4
0
        public ActionResult Manage(AppVersionControlModel AVM)
        {
            ViewBag.platform = ApplicationUtilities.SetDDLValue(LoadDropdownList("platform"), "", "--Select Application Platform--");
            if (ModelState.IsValid)
            {
                if (AVM.IsMajorUpdate.ToUpper() != "Y")
                {
                    AVM.IsMajorUpdate = "N";
                }
                if (AVM.IsMinorUpdate.ToUpper() != "Y")
                {
                    AVM.IsMinorUpdate = "N";
                }
                if (AVM.IsMinorUpdate.ToUpper() == "N" && AVM.IsMajorUpdate.ToUpper() == "N")
                {
                    ModelState.AddModelError("IsMajorUpdate", "Invalid Parameter");

                    return(View(AVM));
                }
                AppVersionControlCommon AVC = new AppVersionControlCommon();
                AVC            = AVM.MapObject <AppVersionControlCommon>();
                AVC.ActionUser = ApplicationUtilities.GetSessionValue("username").ToString();
                AVC.IpAddress  = ApplicationUtilities.GetIP();
                var dbresp = buss.ManageAppVersion(AVC);
                if (dbresp.Code == 0)
                {
                    this.ShowPopup(0, "Successfully Inserted");
                    return(RedirectToAction("Index"));
                }
            }
            this.ShowPopup(1, "Error");
            return(View(AVM));
        }
Esempio n. 5
0
        public JsonResult ResetPassword(string userid, string merchantid)
        {
            var    data       = new CommonDbResponse();
            bool   valid      = true;
            string userId     = userid.DecryptParameter();
            string MerchantId = merchantid.DecryptParameter();

            if (String.IsNullOrEmpty(userId))
            {
                data = new CommonDbResponse {
                    Code = ResponseCode.Failed, Message = "Failed to Reset Password"
                };
                valid = false;
            }
            MerchantCommon model = new MerchantCommon();

            model.MerchantID = MerchantId;
            model.UserID     = userId;
            model.ActionUser = ApplicationUtilities.GetSessionValue("username").ToString();
            model.IpAddress  = ApplicationUtilities.GetIP();
            if (valid)
            {
                data = _merchant.ResetPassword(model);
                //if (data.ErrorCode == 0)
                //{
                //    data.Message = "Successfully Changed User";
                //}
            }

            data.SetMessageInTempData(this);
            return(Json(data));
        }
        public ActionResult ManageGatewayCommission(GatewayProductModel GaPM)
        {
            GatewayProductCommon gc = new GatewayProductCommon();

            ViewBag.servicelist     = ApplicationUtilities.SetDDLValue(ICB.sproc_get_dropdown_list("servicelist", GaPM.GatewayId.DecryptParameter()), GaPM.ProductId, "Select Service");
            GaPM.CommissionTypeList = LoadDropdownList("commissiontype") as List <SelectListItem>;
            gc.ActionUser           = Session["username"].ToString();
            gc.IpAddress            = ApplicationUtilities.GetIP();
            ViewBag.CommissionType  = LoadDropdownList("commissiontype") as List <SelectListItem>;

            gc.ProductId       = GaPM.ProductId;
            gc.GatewayId       = GaPM.GatewayId.DecryptParameter();
            gc.CommissionType  = GaPM.CommissionType;
            gc.CommissionValue = GaPM.CommissionValue;
            gc.IsProduct       = GaPM.IsProduct.DecryptParameter();
            if (gc.CommissionType.ToUpper() == "P" && (gc.CommissionValue > 100 || gc.CommissionValue < 0))
            {
                this.ShowPopup(1, "Error");
                return(View(GaPM));
            }
            CommonDbResponse dbresp = buss.ManageGatewayProductCommission(gc);

            if (dbresp.Code == 0)
            {
                this.ShowPopup(0, dbresp.Message);
                return(RedirectToAction("GatewayProductList", new { GatewayID = GaPM.GatewayId }));
            }
            this.ShowPopup(1, dbresp.Message);
            return(View(GaPM));
        }
Esempio n. 7
0
        public ActionResult ManagemerchantUsers(MerchantUserModel DMM)
        {
            MerchantUserCommon DMC = new MerchantUserCommon();

            DMC = DMM.MapObject <MerchantUserCommon>();
            if (!string.IsNullOrEmpty(DMC.UserId))
            {
                ModelState.Remove("Password");
                ModelState.Remove("ConfirmPassword");
                ModelState.Remove("username");
            }
            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(DMC.UserId))
                {
                    DMC.UserId = DMC.UserId.DecryptParameter();
                }
                if (!string.IsNullOrEmpty(DMC.MerchantId))
                {
                    DMC.MerchantId = DMC.MerchantId.DecryptParameter();
                }
                DMC.ActionUser = ApplicationUtilities.GetSessionValue("username").ToString();
                DMC.IpAddress  = ApplicationUtilities.GetIP();
                CommonDbResponse dbresp = _merchant.ManageUser(DMC);
                if (dbresp.Code == shared.Models.ResponseCode.Success)
                {
                    this.ShowPopup(0, "Save Succesfully");
                    return(RedirectToAction("ViewMerchantUser", new { merchantid = DMC.MerchantId.EncryptParameter() }));
                }
                DMC.Msg = dbresp.Message;
            }
            this.ShowPopup(1, "Save unsuccessful!" + DMC.Msg);
            return(View(DMM));
        }
        public ActionResult ManageCommissionCategoryProduct(ClientCommissionCategoryDetailModel CMC)
        {
            ViewBag.productlist = ApplicationUtilities.SetDDLValue(ICB.sproc_get_dropdown_list("servicelist"), CMC.ProductId, "Select Product");
            // ViewBag.CommissionPercentType = ApplicationUtilities.SetDDLValue(ICB.sproc_get_dropdown_list("031"), CMC.CommissionPercentType, "Select Percent Type");
            ViewBag.CommissionPercentTypeList = ApplicationUtilities.SetDDLValue(ICB.sproc_get_dropdown_list("031"), CMC.CommissionPercentType, "Select Percent Type");
            ViewBag.CommissionTypeList        = LoadDropdownList("commissiontype") as List <SelectListItem>;
            if (ModelState.IsValid)
            {
                ClientCommissionCategoryDetailCommon CDC = new ClientCommissionCategoryDetailCommon();

                CDC.CommissionDetailId    = CMC.CommissionDetailId.DecryptParameter();
                CDC.ProductId             = CMC.ProductId;
                CDC.CommissionCategoryId  = CMC.CommissionCategoryId.DecryptParameter();
                CDC.CommissionType        = CMC.CommissionType;
                CDC.CommissionPercentType = CMC.CommissionPercentType;
                CDC.CommissionValue       = CMC.CommissionValue;
                CDC.IpAddress             = ApplicationUtilities.GetIP();
                CDC.ActionUser            = Session["username"].ToString();
                if ((CDC.CommissionType != "F" && float.Parse(CDC.CommissionValue) > 100) || (float.Parse(CDC.CommissionValue) < 0))
                {
                    this.ShowPopup(1, "Commission Value Mismatch");
                    return(View(CMC));
                }
                CommonDbResponse dbres = comm.ManageCommissionCategoryProduct(CDC);
                if (dbres.Code == 0)
                {
                    this.ShowPopup(0, dbres.Message);
                    return(RedirectToAction("CommissionProductList", new { categoryid = CMC.CommissionCategoryId }));
                }
                CMC.Msg = dbres.Message;
            }
            this.ShowPopup(1, "Error" + CMC.Msg);
            return(View(CMC));
        }
        public void ManageGatewayBalance(GatewayBalanceModel model)
        {
            if (ModelState.IsValid)
            {
                GatewayBalanceCommon common = new GatewayBalanceCommon();
                common.Gatewayid      = model.Gatewayid.DecryptParameter();
                common.BalanceToBeAdd = Math.Abs(model.BalanceToBeAdd);
                common.ActionUser     = Session["UserName"].ToString();
                common.IpAddress      = ApplicationUtilities.GetIP();
                common.Remarks        = model.Remarks;
                CommonDbResponse dbresp = buss.updatebalance(common);

                if (dbresp.Code == 0)
                {
                    this.ShowPopup(0, "Succesfully Added");
                    return;
                    //dbresp.SetMessageInTempData(this);
                    //return ("1");
                    //       return RedirectToAction("Detail");
                }
            }
            else
            {
                this.ShowPopup(1, "Amount Not Added");
            }
        }
Esempio n. 10
0
        public JsonResult DeleteUser(string UserName)
        {
            if (!String.IsNullOrEmpty(UserName))
            {
                UserName = UserName.DecryptParameter();
                if (string.IsNullOrEmpty(UserName))
                {
                    return(Json(new CommonDbResponse {
                        Code = shared.Models.ResponseCode.Failed, Message = "Invalid User."
                    }));
                }
                string ActionUser = Session["UserName"].ToString();
                string IpAddress  = ApplicationUtilities.GetIP();
                //string BrowserInfo = ApplicationUtilities.GetBrowserInfo();
                var DbResponse = buss.DeleteAdminUser(new shared.Models.UserCommon {
                    UserName = UserName, ActionUser = ActionUser, IpAddress = IpAddress
                });

                if (DbResponse.Code == ResponseCode.Success)
                {
                    DbResponse.Message = "Successfully deleted User";
                    //this.ShowPopup(0, "Successfully deleted User");
                    //return Json(DbResponse);
                }
                DbResponse.SetMessageInTempData(this);
                return(Json(new CommonDbResponse()
                {
                    Code = DbResponse.Code, Message = DbResponse.Message
                }));
            }
            return(Json(new CommonDbResponse {
                Code = shared.Models.ResponseCode.Failed, Message = "Invalid User."
            }));
        }
        public JsonResult EnableCommissionCategory(string ID)
        {
            if (!string.IsNullOrEmpty(ID))
            {
                CommissionCategoryCommon CCC = new CommissionCategoryCommon();
                CCC.CategoryId = ID.DecryptParameter();
                CCC.IpAddress  = ApplicationUtilities.GetIP();
                CCC.ActionUser = Session["username"].ToString();
                if (string.IsNullOrEmpty(CCC.CategoryId))
                {
                    return(Json(new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid Category."
                    }));
                }
                CommonDbResponse dbresp = comm.block_unblockCategory(CCC, "Y");

                if (dbresp.ErrorCode == 0)
                {
                    dbresp.Message = "Successfully Un-Blocked Category";
                    dbresp.SetMessageInTempData(this);
                }
                return(Json(dbresp));
            }
            return(Json(new CommonDbResponse {
                ErrorCode = 1, Message = "Invalid Category."
            }));
        }
Esempio n. 12
0
        public ActionResult NwscBillInquiry(NwscBillInquiryModel nwsc)
        {
            NwscBillInquiryCommon nbc = nwsc.MapObject <NwscBillInquiryCommon>();

            ViewBag.branchlist = ApplicationUtilities.SetDDLValue(Denomination("34"), "", "--Select Office--");
            var productdetails = GetNWSCproductDetails();

            nwsc.ProductLogo = productdetails.ProductLogo;


            nbc.IpAddress = ApplicationUtilities.GetIP();
            nbc.UserId    = ApplicationUtilities.GetSessionValue("userid").ToString();

            var inquiry = _nwsc.GetNwscBill(nbc);
            NwscBillInquiryResponseModel nwspbillresp = new NwscBillInquiryResponseModel();

            if (inquiry.GatewayName.ToUpper() == "PRABHUPAY")
            {
                if (inquiry.Code == shared.Models.ResponseCode.Success)
                {
                    var obj = Newtonsoft.Json.JsonConvert.SerializeObject(inquiry.Data);
                    var prabhupayinqresp = Newtonsoft.Json.JsonConvert.DeserializeObject <PrabhuPayNwscBillInquiryResponseModel>(obj);
                    nwspbillresp.CustomerId         = prabhupayinqresp.CustomerId;
                    nwspbillresp.CustomerName       = prabhupayinqresp.CustomerName;
                    nwspbillresp.Area               = prabhupayinqresp.Area;
                    nwspbillresp.Lagat              = prabhupayinqresp.Lagat;
                    nwspbillresp.OfficeCode         = prabhupayinqresp.OfficeCode;
                    nwspbillresp.Office             = prabhupayinqresp.Office;
                    nwspbillresp.TotalDueAmount     = prabhupayinqresp.TotalDueAmount;
                    nwspbillresp.TotalServiceCharge = prabhupayinqresp.TotalServiceCharge;
                    List <NwscBillInquiryDetailModel> lst = new List <NwscBillInquiryDetailModel>();
                    foreach (var item in prabhupayinqresp.BillDetail)
                    {
                        NwscBillInquiryDetailModel bill = new NwscBillInquiryDetailModel()
                        {
                            BillFrom       = item.BillFrom,
                            BillTo         = item.BillTo,
                            BillAmount     = item.BillAmount,
                            FineAmount     = item.FineAmount,
                            MeterRent      = item.MeterRent,
                            DiscountAmount = item.DiscountAmount,
                            PayableAmount  = item.PayableAmount,
                        };
                        lst.Add(bill);
                    }
                    nwspbillresp.BillDetail       = lst;
                    nwspbillresp.EncryptedContent = (prabhupayinqresp.TotalDueAmount + prabhupayinqresp.TotalServiceCharge + prabhupayinqresp.CustomerId + prabhupayinqresp.OfficeCode).EncryptParameter();
                    return(View("NwscBillPayment", nwspbillresp));
                }
                else
                {
                    this.ShowPopup(1, inquiry.Message);
                    return(View(nwsc));
                }
            }
            this.ShowPopup(1, "Service Unavaliable");
            return(View(nwsc));
        }
Esempio n. 13
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));
        }
        public ActionResult ReceivePaymentNotification(string MerchantTxnId, string GatewayTxnId)
        {
            //check MerchantTxnId in our db first
            var dbRes = _iLoad.CheckTrnasactionExistence(MerchantTxnId, GatewayTxnId);

            if (dbRes.Code == ResponseCode.Success)
            {
                string apiusername  = ApplicationUtilities.GetAppConfigValue("apiusername");
                string apipasssword = ApplicationUtilities.GetAppConfigValue("apipasssword");
                string apisecretkey = ApplicationUtilities.GetAppConfigValue("apisecretkey");
                string merchantname = ApplicationUtilities.GetAppConfigValue("merchantname");
                string merchantid   = ApplicationUtilities.GetAppConfigValue("merchantid");
                try
                {
                    MiddleServiceRequest serviceCall = new MiddleServiceRequest("cgpay", apiusername, apipasssword, apisecretkey);
                    var resp = serviceCall.GetTransactionDetail(merchantid, merchantname, MerchantTxnId);

                    if (resp.code == "0")
                    {
                        var transactionModel       = ApplicationUtilities.MapObject <CheckTransactionResponse>(resp.data);
                        LoadBalanceCommon lBalance = new LoadBalanceCommon()
                        {
                            pmt_gateway_id     = "",
                            pmt_gateway_txn_id = GatewayTxnId,
                            gateway_status     = transactionModel.Status,
                            gateway_process_id = "",
                            action_user        = "******",
                            action_ip          = ApplicationUtilities.GetIP(),
                            bank_name          = transactionModel.Institution,
                            payment_mode       = transactionModel.Instrument,
                            pmt_txn_id         = MerchantTxnId,
                            amount             = transactionModel.Amount,
                            service_charge     = transactionModel.ServiceCharge
                        };
                        _iLoad.UpdateTransaction(lBalance);
                    }
                }
                catch (Exception ex)
                {
                    string msg = ex.Message;
                    throw;
                }
            }
            Response.Write("Received");
            Response.End();
            return(View());



            // then check if transaction is already updated by merchanttxnid and gatewaytxnid



            //if transaction exists or already received or txn not found
            //return "Received";
            //
        }
Esempio n. 15
0
        /*  public async System.Threading.Tasks.Task<JsonResult> CheckDenomination(string , string ctrl)
         * {
         *    string productid = "0";
         *    ctrl = ctrl.DecryptParameter().ToUpper();
         *    Dictionary<string, string> Denomitation = new Dictionary<string, string>();
         *
         *
         *    if (MobileNo.Substring(0, 3) == "980" || MobileNo.Substring(0, 3) == "981" || MobileNo.Substring(0, 3) == "982" || (ConfigurationManager.AppSettings["phase"] != null && (ConfigurationManager.AppSettings["phase"].ToString().ToUpper() == "DEVELOPMENT" || ConfigurationManager.AppSettings["phase"].ToString().ToUpper() == "LOCAL") && MobileNo.Substring(0, 3) == "880") && ctrl == "NCELL")//NCELL
         *    {
         *        productid = "2";
         *    }
         *    else if ((MobileNo.Substring(0, 3) == "984" || MobileNo.Substring(0, 3) == "986") && ctrl == "NTPRE")//ntc prepaid
         *    {
         *        productid = "1";
         *    }
         *    else if ((MobileNo.Substring(0, 3) == "974" || MobileNo.Substring(0, 3) == "976") && ctrl == "NTCDMAPRE")//ntc cdma
         *    {
         *        productid = "9";
         *    }
         *    else if ((MobileNo.Substring(0, 3) == "985") && ctrl == "NTPOST")//ntc postpaid
         *    {
         *        productid = "14";
         *    }
         *    else if ((MobileNo.Substring(0, 3) == "975") && ctrl == "NTCDMAPOST") //CDMA Postpaid
         *    {
         *        productid = "10";
         *    }
         *    else if ((MobileNo.Substring(0, 3) == "988" || MobileNo.Substring(0, 3) == "961" || MobileNo.Substring(0, 3) == "962") && ctrl == "SMARTCELL")//smartcell
         *    {
         *        productid = "4";
         *    }
         *    else if ((MobileNo.Substring(0, 3) == "972") && ctrl == "UTL")//UTL
         *    {
         *        productid = "3";
         *
         *    }
         *    else
         *    {
         *        productid = "0";
         *        return Json(new { Denomitation }, JsonRequestBehavior.AllowGet);
         *    }
         *    Dictionary<string, string> dictonary = new Dictionary<string, string>();
         *    dictonary.Add("Subscriberno", MobileNo);
         *    Denomitation = getdenominationlist(productid, dictonary);
         *
         *    return Json(new { Denomitation }, JsonRequestBehavior.AllowGet);
         * }
         */
        public Dictionary <string, string> getdenominationlist(string extra1, Dictionary <string, string> dictionary = null)
        {
            string UserId    = ApplicationUtilities.GetSessionValue("userid").ToString();
            string IpAddress = ApplicationUtilities.GetIP().ToString();

            dictionary.Add("UserId", UserId);
            dictionary.Add("IpAddress", IpAddress);
            return(_ICB.Denomination(extra1, dictionary));
        }
        public ActionResult balanceTransfer(WalletBalanceModel walletBalance)
        {
            Dictionary <string, string> PurposeList = _walletUser.GetProposeList();

            walletBalance.PurposeList = ApplicationUtilities.SetDDLValue(PurposeList, "", "--Propose--");

            if ((Convert.ToDecimal(walletBalance.Amount) > 1000 || Convert.ToDecimal(walletBalance.Amount) < 10) && walletBalance.Type == "T")
            {
                ModelState.AddModelError("Amount", "Amount should be between 10-1000");
                return(View(walletBalance));
            }

            if (walletBalance.Type == "R")
            {
                ModelState.Remove(("Propose"));
                if ((Convert.ToDecimal(walletBalance.Amount) > 1000 || Convert.ToDecimal(walletBalance.Amount) < 10))
                {
                    ModelState.AddModelError("Amount", "Amount should be between 10-1000");
                    return(View(walletBalance));
                }
            }
            string           usertype = Session["UserType"].ToString();
            string           agentid  = Session["AgentId"].ToString();
            CommonDbResponse response = _walletUser.CheckMobileNumber(agentid, walletBalance.ReceiverAgentId, usertype, "tb");

            if (response.Code != 0)
            {
                ModelState.AddModelError("ReceiverAgentId", "Invalid User Detail");
                return(View(walletBalance));
            }
            else
            {
                ModelState.Remove("ReceiverAgentId");
            }
            if (ModelState.IsValid)
            {
                //walletBalance.AgentId = Session["AgentId"].ToString();
                walletBalance.ActionUser = Session["UserName"].ToString();
                walletBalance.IpAddress  = ApplicationUtilities.GetIP();
                WalletBalanceCommon walletBalanceCommon = walletBalance.MapObject <WalletBalanceCommon>();
                CommonDbResponse    dbResponse          = _walletUser.WalletBalanceRT(walletBalanceCommon);
                if (dbResponse.Code == 0)
                {
                    dbResponse.SetMessageInTempData(this, "balanceTransfer");
                    return(RedirectToAction("balanceTransfer", ControllerName));
                }
                dbResponse.SetMessageInTempData(this, "balanceTransfer");
                return(RedirectToAction("balanceTransfer"));
            }
            else
            {
                return(View(walletBalance));
            }

            return(RedirectToAction("balanceTransfer"));
        }
Esempio n. 17
0
        public ActionResult AgentRT(BalanceModel balanceModel)
        {
            //BalanceModel balanceModel = new BalanceModel();
            List <BalanceCommon>        balanceCommons = _balance.GetAgentName();
            Dictionary <string, string> agentName      = new Dictionary <string, string>();
            Dictionary <string, string> bankList       = _balance.GetBankList();

            foreach (BalanceCommon bcommon in balanceCommons)
            {
                agentName.Add(bcommon.AgentId, bcommon.Name);
            }
            balanceModel.NameList        = ApplicationUtilities.SetDDLValue(agentName, "", "--Agent--");
            balanceModel.BankAccountList = ApplicationUtilities.SetDDLValue(bankList, "", "--Bank--");

            if (Convert.ToDecimal(balanceModel.Amount) > 500000 && balanceModel.Type == "T")
            {
                ModelState.AddModelError("Amount", "Amount Cannot Be Greater then 500000 (5 Lakhs)");
                return(View(balanceModel));
            }

            if (balanceModel.Type == "R")
            {
                ModelState.Remove(("BankId"));
                if (Convert.ToDecimal(balanceModel.Amount) > 100000 && balanceModel.Type == "R")
                {
                    ModelState.AddModelError("Amount", "Amount Cannot Be Greater then 100000 (1 Lakh)");
                    return(View(balanceModel));
                }
            }

            if (ModelState.IsValid)
            {
                balanceModel.CreatedBy = Session["UserName"].ToString();
                balanceModel.AgentId   = agentName.FirstOrDefault(x => x.Key == balanceModel.Name).Key.ToString();
                balanceModel.Name      = agentName.FirstOrDefault(x => x.Key == balanceModel.Name).Value.ToString();
                if (balanceModel.Type == "T")
                {
                    balanceModel.BankName = bankList.FirstOrDefault(x => x.Key == balanceModel.BankId).Value.ToString();
                }
                balanceModel.CreatedIp = ApplicationUtilities.GetIP();

                BalanceCommon    balanceCommon = balanceModel.MapObject <BalanceCommon>();
                CommonDbResponse dbResponse    = _balance.AgentTR(balanceCommon);
                if (dbResponse.Code == 0)
                {
                    dbResponse.SetMessageInTempData(this);
                    return(RedirectToAction("AgentRT", ControllerName));
                }
            }
            else
            {
                return(View(balanceModel));
            }

            return(RedirectToAction("AgentRT", ControllerName));
        }
        public Dictionary <string, string> Denomination(string extra1)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();
            string UserId    = ApplicationUtilities.GetSessionValue("userid").ToString();
            string IpAddress = ApplicationUtilities.GetIP().ToString();

            dictionary.Add("UserId", UserId);
            dictionary.Add("IpAddress", IpAddress);
            var oflist = _ICB.Denomination(extra1, dictionary);
            var list   = oflist.ToDictionary(x => x.Value, x => x.Key);

            return(list);
        }
Esempio n. 19
0
        public void ServicesStatus(string[] servicelist)
        {
            string[] services = servicelist;
            for (Int32 i = 0; i < services.Length; i++)
            {
                services[i] = services[i].DecryptParameter();
            }
            string username  = Session["username"].ToString();
            string ipaddress = ApplicationUtilities.GetIP();

            _services.ServicesStatus(services, username, ipaddress);
            this.ShowPopup(0, "Completed");
            //return null;
        }
Esempio n. 20
0
        public JsonResult UnBlockUser(string userid, string merchantid)
        {
            var  data  = new CommonDbResponse();
            bool valid = true;

            if (!String.IsNullOrEmpty(userid))
            {
                userid = userid.DecryptParameter();
                if (string.IsNullOrEmpty(userid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }

            if (!String.IsNullOrEmpty(merchantid))
            {
                merchantid = merchantid.DecryptParameter();
                if (string.IsNullOrEmpty(merchantid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }
            if (valid)
            {
                MerchantUserCommon DMC = new MerchantUserCommon()
                {
                    UserId     = userid,
                    MerchantId = merchantid,
                    UserStatus = "Y",
                    ActionUser = ApplicationUtilities.GetSessionValue("username").ToString(),
                    IpAddress  = ApplicationUtilities.GetIP()
                };
                data = _merchant.Disable_EnableMerchantUser(DMC);
                if (data.ErrorCode == 0)
                {
                    data.Message = "Successfully Blocked User";
                }
            }

            data.SetMessageInTempData(this);
            return(Json(data));
        }
Esempio n. 21
0
        public JsonResult ResetPassword(string userid, string agentid)
        {
            var  data  = new CommonDbResponse();
            bool valid = true;

            if (!string.IsNullOrEmpty(userid))
            {
                userid = userid.DecryptParameter();
                if (string.IsNullOrEmpty(userid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }

            if (!string.IsNullOrEmpty(agentid))
            {
                agentid = agentid.DecryptParameter();
                if (string.IsNullOrEmpty(agentid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }
            if (valid)
            {
                AgentManagementCommon DMC = new AgentManagementCommon()
                {
                    UserID     = userid,
                    AgentID    = agentid,
                    UserStatus = "Y",
                    ActionUser = ApplicationUtilities.GetSessionValue("username").ToString(),
                    IpAddress  = ApplicationUtilities.GetIP()
                };
                data = buss.ResetPassword(DMC);
                //if (data.ErrorCode == 0)
                //{
                //    data.Message = "User Password Reset Successfully";
                //}
            }

            data.SetMessageInTempData(this);
            return(Json(data));
        }
        public JsonResult BlockUser(string userid, string agentid)
        {
            var  data  = new CommonDbResponse();
            bool valid = true;

            if (!String.IsNullOrEmpty(userid))
            {
                userid = userid.DecryptParameter();
                if (string.IsNullOrEmpty(userid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }

            if (!String.IsNullOrEmpty(agentid))
            {
                agentid = agentid.DecryptParameter();
                if (string.IsNullOrEmpty(agentid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }
            if (valid)
            {
                SubDistributorManagementCommon DMC = new SubDistributorManagementCommon()
                {
                    UserID     = userid,
                    AgentID    = agentid,
                    UserStatus = "N",
                    ActionUser = ApplicationUtilities.GetSessionValue("username").ToString(),
                    IpAddress  = ApplicationUtilities.GetIP()
                };
                data = buss.Disable_EnableSubDistributorUser(DMC);
                if (data.ErrorCode == 0)
                {
                    data.Message = "Successfully Blocked User";
                }
            }

            data.SetMessageInTempData(this);
            return(Json(data));
        }
        public async System.Threading.Tasks.Task <JsonResult> GetCharges(string ConsumerId, string ScNo, string OfficeCode, string PayableAmount)
        {
            NeaBillChargeCommon charge = new NeaBillChargeCommon();

            charge.ConsumerId    = ConsumerId;
            charge.ScNo          = ScNo;
            charge.OfficeCode    = OfficeCode;
            charge.PayableAmount = PayableAmount;
            charge.IpAddress     = ApplicationUtilities.GetIP();
            charge.ActionUser    = ApplicationUtilities.GetSessionValue("userid").ToString();
            var chargeamount = _nea.neabillCharges(charge);
            var jstring      = Newtonsoft.Json.JsonConvert.SerializeObject(chargeamount.Data);
            var obj          = Newtonsoft.Json.JsonConvert.DeserializeObject <NeaServiceChargeModel>(jstring);

            return(Json(obj.SCharge));
        }
Esempio n. 24
0
        protected void Application_Error(object sender, EventArgs e)
        {
            ErrorHandlerBusiness buss      = new ErrorHandlerBusiness();
            Exception            exception = HttpContext.Current.Error;

            var err = Server.GetLastError();

            if (err != null)
            {
                if (exception.GetType() == typeof(HttpException)) //It's an Http Exception
                {
                    var    statusCode = ((HttpException)exception).GetHttpCode();
                    var    page       = HttpContext.Current.Request.Url.ToString();
                    string userName   = "******";
                    if (Session["UserName"] != null)
                    {
                        userName = HttpContext.Current.Session["UserName"].ToString();
                        //userName = string.IsNullOrEmpty(Session["UserName"].ToString()) ? "" : Session["UserName"].ToString();
                    }
                    string ipAddress = ApplicationUtilities.GetIP();
                    var    id        = buss.LogError(err, page, userName, ipAddress);
                    switch (statusCode)
                    {
                    //case 400:
                    //    routeData.Values.Add("status", "400 - Bad Request");
                    //    break;
                    //case 401:
                    //    routeData.Values.Add("status", "401 - Access Denied");
                    //    break;
                    case 403:
                        break;

                    case 404:
                        break;

                    default:
                        //routeData.Values.Add("status", "500 - Internal Server Error");
                        HttpContext.Current.Response.Redirect("/Error/Index?Id=" + id);
                        break;
                    }
                }
            }
        }
Esempio n. 25
0
        public ActionResult ManageGateway(GatewayModel gm)
        {
            if (ModelState.IsValid)
            {
                string username  = Session["UserName"].ToString();
                string ipaddress = ApplicationUtilities.GetIP();

                GatewayCommon gc = new GatewayCommon();
                gc.GatewayId = gm.GatewayId.DecryptParameter();
                if (!string.IsNullOrEmpty(gc.GatewayId))
                {
                    if (string.IsNullOrEmpty(gm.GatewayId))
                    {
                        this.ShowPopup(1, "Gateway Not found !");
                        return(RedirectToAction("ManageGateway", gm));
                    }
                }
                gc.GatewayName     = gm.GatewayName;
                gc.GatewayUsername = gm.GatewayUsername.EncryptParameter();
                gc.GatewayPwd      = gm.GatewayPwd.EncryptParameter();
                // gc.GatewayBalance = gm.GatewayBalance;
                gc.GatewayURL          = gm.GatewayURL.EncryptParameter();
                gc.GatewayAccessCode   = gm.GatewayAccessCode.EncryptParameter();
                gc.GatewaySecurityCode = gm.GatewaySecurityCode.EncryptParameter();
                gc.GatewayApitoken     = gm.GatewayApitoken.EncryptParameter();
                gc.GatewayStatus       = gm.GatewayStatus;
                gc.IsDirectGateway     = gm.IsDirectGateway;
                gc.GatewayType         = gm.GatewayType.Trim();
                gc.GatewayCountry      = gm.GatewayCountry;
                gc.GatewayCurrency     = gm.GatewayCurrency;
                gc.GatewayContact      = gm.GatewayContact;
                gc.ActionUser          = username;
                gc.IpAddress           = ipaddress;
                CommonDbResponse dbresp = buss.ManageGateway(gc);
                if (dbresp.Code == 0)
                {
                    this.ShowPopup(0, "Save Succesfully");
                    return(RedirectToAction("Detail"));
                }
            }
            this.ShowPopup(1, "Error");
            return(RedirectToAction("ManageGateway", gm));
        }
Esempio n. 26
0
 public void ExtendCreditLimit(AgentCreditLimitModel model)
 {
     if (ModelState.IsValid)
     {
         AgentCreditLimitCommon clc = new AgentCreditLimitCommon();
         clc            = model.MapObject <AgentCreditLimitCommon>();
         clc.AgentId    = clc.AgentId.DecryptParameter();
         clc.ActionUser = ApplicationUtilities.GetSessionValue("UserName").ToString();
         clc.IpAddress  = ApplicationUtilities.GetIP();
         CommonDbResponse dbresp = buss.ExtendCreditLimit(clc);
         if (dbresp.Code == 0)
         {
             this.ShowPopup(0, dbresp.Message);
             return;
         }
         this.ShowPopup(1, dbresp.Message);
         return;
     }
     this.ShowPopup(1, "Credit Limit Not Changed");
     return;
 }
Esempio n. 27
0
 public ActionResult Changeuserpassword(ChangePasswordModel model)
 {
     ModelState.Remove("RoleId");
     if (ModelState.IsValid)
     {
         model.UserName   = model.UserNamePassword.DecryptParameter();
         model.ActionUser = Session["UserName"].ToString();
         model.IpAddress  = ApplicationUtilities.GetIP();
         //model.BrowserInfo = ApplicationUtilities.GetBrowserInfo();
         var common            = model.MapObject <shared.Models.User.ChangePasswordCommon>();
         CommonDbResponse resp = buss.ChangeUserPassword(common);//.SetMessageInTempData(this);
         if (resp.Code == ResponseCode.Success)
         {
             this.ShowPopup(0, "Password Changed Successfully!!");
             //resp.SetMessageInTempData(this);
             return(RedirectToAction("Index"));
         }
     }
     this.ShowPopup(1, "Something went wrong!!");
     return(RedirectToAction("Index"));
 }
        public ActionResult AddCustomer(WalletUserInfoModel walletUserModel)
        {
            ModelState.Remove("BalanceToAdd");
            ModelState.Remove("Remarks");
            if (string.IsNullOrEmpty(walletUserModel.FullName))
            {
                ModelState.AddModelError("FullName", "Full Name is Required");
            }
            if (string.IsNullOrEmpty(walletUserModel.Email))
            {
                ModelState.AddModelError("Email", "Email is Required");
            }
            if (string.IsNullOrEmpty(walletUserModel.MobileNo))
            {
                ModelState.AddModelError("MobileNo", "Mobile Number is Required");
            }
            if (ModelState.IsValid)
            {
                WalletUserInfo walletUser = new WalletUserInfo();
                walletUser.ParentId   = walletUserModel.ParentId.DecryptParameter();
                walletUser.MobileNo   = walletUserModel.MobileNo;
                walletUser.Email      = walletUserModel.Email;
                walletUser.FullName   = walletUserModel.FullName;
                walletUser.ActionUser = Session["UserName"].ToString();
                walletUser.ActionIP   = ApplicationUtilities.GetIP();
                HttpContext httpCtx = System.Web.HttpContext.Current;
                walletUser.ActionBrowser = httpCtx.Request.Headers["User-Agent"];
                CommonDbResponse dbresp = _CustomerManagement.AddUser(walletUser);
                if (dbresp.ErrorCode == 0)
                {
                    dbresp.SetMessageInTempData(this);

                    //this.ShowPopup(0, "Succesfully Added amount: " + walletUser.BalanceToAdd);
                    return(RedirectToAction("Index", new { ParentId = walletUserModel.ParentId }));
                }
                dbresp.SetMessageInTempData(this);
            }

            return(View(walletUserModel));
        }
        public ActionResult ManageSubDistributorUsers(SubDistributorManagementModel DMM)
        {
            //RemoveAgentValidation(dcommon);
            //RemoveContactPersonValidation(dcommon);
            LoadDropDownList(DMM);
            RemoveAgentValidation(DMM);
            SubDistributorManagementCommon DMC = new SubDistributorManagementCommon();

            DMC = DMM.MapObject <SubDistributorManagementCommon>();
            if (!string.IsNullOrEmpty(DMC.UserID))
            {
                ModelState.Remove("Password");
                ModelState.Remove("ConfirmPassword");
                ModelState.Remove("username");
            }
            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(DMC.UserID))
                {
                    DMC.UserID = DMC.UserID.DecryptParameter();
                }
                if (!string.IsNullOrEmpty(DMC.AgentID))
                {
                    DMC.AgentID = DMC.AgentID.DecryptParameter();
                }
                DMC.ActionUser = ApplicationUtilities.GetSessionValue("username").ToString();
                DMC.IpAddress  = ApplicationUtilities.GetIP();
                CommonDbResponse dbresp = buss.ManageUser(DMC);
                if (dbresp.Code == shared.Models.ResponseCode.Success)
                {
                    this.ShowPopup(0, "Save Succesfully");
                    return(RedirectToAction("ViewSubDistributorUser", new { DistId = DMC.AgentID.EncryptParameter() }));
                }
                DMC.Msg = dbresp.Message;
            }
            this.ShowPopup(1, "Save unsuccessful!" + DMC.Msg);
            return(View(DMM));
        }
Esempio n. 30
0
        public ActionResult ReceivePaymentNotification(string MerchantTxnId, string GatewayTxnId)
        {
            //check MerchantTxnId in our db first
            var dbRes = _iLoad.CheckTrnasactionExistence(MerchantTxnId, GatewayTxnId);

            if (dbRes.Code == 0)
            {
                ewallet.application.Models.OnePG.CommonResponse resp = MakeHttpRequest.InvokeCheckTransactionStatus("1", "anujApi", MerchantTxnId, "anujApi", "Anuj@123", "AnujSecert");
                if (resp.code == "0")
                {
                    var transactionModel       = ApplicationUtilities.MapObject <CheckTransactionResponse>(resp.data);
                    LoadBalanceCommon lBalance = new LoadBalanceCommon()
                    {
                        pmt_gateway_id     = "",
                        pmt_gateway_txn_id = GatewayTxnId,
                        gateway_status     = transactionModel.Status,
                        gateway_process_id = "",
                        action_user        = "******",
                        action_ip          = ApplicationUtilities.GetIP(),
                        bank_name          = transactionModel.Institution,
                        payment_mode       = transactionModel.Instrument,
                        pmt_txn_id         = MerchantTxnId
                    };
                    _iLoad.UpdateTransaction(lBalance);
                }
            }

            // then check if transaction is already updated by merchanttxnid and gatewaytxnid

            //if transaction exists or already received or txn not found
            //return "Received";


            //
            Response.Write("Received");
            Response.End();
            return(View());
        }