public ActionResult ManageAgentUser(AgentUserModel dcommon) { if (!string.IsNullOrEmpty(dcommon.UserID)) { ModelState.Remove("Password"); ModelState.Remove("ConfirmPassword"); ModelState.Remove("UserEmail"); ModelState.Remove("UserMobileNumber"); ModelState.Remove("UserName"); } if (ModelState.IsValid) { if (!string.IsNullOrEmpty(dcommon.UserID)) { dcommon.UserID = dcommon.UserID.DecryptParameter(); } if (!string.IsNullOrEmpty(dcommon.AgentID)) { dcommon.AgentID = dcommon.AgentID.DecryptParameter(); } AgentManagementCommon amcommon = new AgentManagementCommon(); amcommon = dcommon.MapObject <AgentManagementCommon>(); amcommon.ActionUser = ApplicationUtilities.GetSessionValue("username").ToString(); amcommon.IpAddress = ApplicationUtilities.GetIP(); CommonDbResponse dbresp = buss.ManageAgentUser(amcommon); if (dbresp.Code == shared.Models.ResponseCode.Success) { this.ShowPopup(0, "Save Succesfully"); return(RedirectToAction("ViewAgentUser", new { AgentId = dcommon.AgentID.EncryptParameter() })); } } this.ShowPopup(1, "Save unsuccessful.Please try again!"); return(View(dcommon)); }
public ActionResult AssignCategory(string Search = "", int Pagesize = 10) { AssignCommissionCommon ACC = new AssignCommissionCommon(); ACC.AgentType = Session["UserType"].ToString(); ACC.AgentId = ApplicationUtilities.GetSessionValue("agentid").ToString();//Session["UserId"].ToString(); var list = comm.GetAssignedCategoryList(ACC); foreach (var item in list) { item.Action = StaticData.GetActions("AssignCommissionCategory", item.AgentId.ToString().EncryptParameter(), this, "", "/admin/commission/ManageAssignCategory?ID=" + item.AgentId.EncryptParameter(), ""); } IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentName", "Agent Name"); param.Add("AgentType", "Agent Type"); param.Add("CommissionCategoryName", "Category Name"); // param.Add("CreateDate", "Created On"); // param.Add("updatedby", "Updated By"); param.Add("Action", "Action"); ProjectGrid.column = param; var grid = ProjectGrid.MakeGrid(list, "Assign Category", Search, Pagesize, false, "", "", "Home", "Commission", "", ""); ViewData["grid"] = grid; return(View()); }
public ActionResult Category(string Search = "", int Pagesize = 10) { string agentid = ApplicationUtilities.GetSessionValue("agentid").ToString(); var list = comm.GetCommissionCategoryList(agentid); foreach (var item in list) { item.IsActive = (item.IsActive.Trim().ToUpper() == "Y" ? "1" : "0"); item.Action = StaticData.GetActions("CommissionCategory", item.CategoryId.ToString().EncryptParameter(), this, "", "", item.IsActive); } IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("CategoryName", "Category Name"); param.Add("CreatedBy", "Created By"); param.Add("CreateDate", "Created On"); param.Add("IsActive", "Is Active"); param.Add("Action", "Action"); ProjectGrid.column = param; var grid = ProjectGrid.MakeGrid(list, "Commission Category", Search, Pagesize, true, "", "", "Home", "Commission", "/Admin/Commission/category", "/Admin/Commission/ManageCommissionCategory"); ViewData["grid"] = grid; return(View()); }
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 Index(string ParentId = "") { var UserType = Session["UserType"].ToString(); string AgentId = "", IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString(); string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); if (UserType.ToUpper() == "SUB-DISTRIBUTOR") { AgentId = Session["agentid"].ToString(); } ParentId = ParentId.DecryptParameter(); var DistributorCommon = buss.GetSubDistributorList(ParentId, username, AgentId); //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentName", "Agent Name"); param.Add("AgentOperationType", "Operation Type"); param.Add("AgentMobileNumber", "Contact Number"); param.Add("AgentCreditLimit", "Credit Limit"); param.Add("AgentStatus", "Agent Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends foreach (var item in DistributorCommon) { item.Action = StaticData.GetActions("SubDistributorManagement", item.AgentID.EncryptParameter(), this, "", "", username.EncryptParameter(), item.AgentStatus); item.AgentStatus = "<span class='badge badge-" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "Active" : "Blocked") + "</span>"; } var grid = ProjectGrid.MakeGrid(DistributorCommon, "Sub-Distributor List ", "", 0, true, "", "", "Home", "Sub-Distributor", "/Admin/SubDistributorManagement", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Admin/SubDistributorManagement/ManageSubDistributor?parent_id=" + ParentId.EncryptParameter() : ""); ViewData["grid"] = grid; return(View()); }
public ActionResult AssignRole(string distid, string UserId = "") { SubDistributorManagementRolesModel distributormodel = new SubDistributorManagementRolesModel(); var distributor_id = distid.DecryptParameter(); var user_id = UserId.DecryptParameter(); if (string.IsNullOrEmpty(distributor_id)) { return(RedirectToAction("Index")); } if (!string.IsNullOrEmpty(UserId)) { if (string.IsNullOrEmpty(user_id)) { return(RedirectToAction("ViewSubDistributorUser", new { DistId = distributor_id.EncryptParameter() })); } } string username = ApplicationUtilities.GetSessionValue("username").ToString(); var dist = buss.getSubDistributorRoleAssigned(distributor_id, user_id, username); if (dist.UserId != null) { LoadUserDropdownlist(distributormodel); distributormodel.AgentId = dist.AgentId.EncryptParameter(); distributormodel.UserId = dist.UserId.EncryptParameter(); distributormodel.RoleId = dist.RoleId; distributormodel.IsPrimary = dist.IsPrimary; return(View(distributormodel)); } return(RedirectToAction("ViewSubDistributorUser", new { DistId = distributor_id.DecryptParameter() })); }
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)); }
// GET: Admin/Distributor/User/Id public ActionResult ManagemerchantUsers(string merchantid, string UserId = "") { var UserType = Session["UserType"].ToString(); string merchant_id = ""; merchant_id = merchantid.DecryptParameter(); MerchantUserCommon DMC = new MerchantUserCommon(); var user_id = UserId.DecryptParameter(); if (string.IsNullOrEmpty(merchant_id)) { return(RedirectToAction("Index")); } if (!string.IsNullOrEmpty(UserId)) { if (string.IsNullOrEmpty(user_id)) { return(RedirectToAction("ViewMerchantUser", new { merchantid = merchantid.EncryptParameter() })); } string username = ApplicationUtilities.GetSessionValue("username").ToString(); DMC = _merchant.GetUserById(merchant_id, user_id, username); DMC.UserId = user_id.EncryptParameter(); } DMC.MerchantId = merchant_id.EncryptParameter(); MerchantUserModel DMM = DMC.MapObject <MerchantUserModel>(); //LoadDropDownList(DMM); return(View(DMM)); }
// GET: Admin/SubAgentManagement public ActionResult Index(string Search = "", int Pagesize = 10) { string username = ApplicationUtilities.GetSessionValue("username").ToString(); var UserType = Session["UserType"].ToString(); string AgentId = "", IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString(); AgentId = Session["AgentId"].ToString(); //string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); var SubAgentCommon = buss.GetSubAgentList(AgentId, username); //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentName", "Agent Name"); param.Add("AgentOperationType", "Operation Type"); param.Add("AgentCreditLimit", "Credit Limit"); param.Add("AgentMobileNumber", "Contact Number"); param.Add("AgentStatus", "Agent Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends foreach (var item in SubAgentCommon) { item.Action = StaticData.GetActions("ClientSubAgent", item.AgentID.EncryptParameter(), this, "", "", username.EncryptParameter(), item.AgentStatus); item.AgentStatus = "<span class='badge badge-" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "Active" : "Blocked") + "</span>"; } var grid = ProjectGrid.MakeGrid(SubAgentCommon, "Sub Agent List ", "", 0, true, "", "", "Home", "Agent", "/Client/SubAgent/Index", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Client/SubAgent/ManageSubAgent?parentid=" + AgentId.EncryptParameter() : ""); ViewData["grid"] = grid; SubAgentCreditLimitModel sam = new SubAgentCreditLimitModel(); sam.ParentId = AgentId; return(View(sam)); }
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 JsonResult ExtendCreditLimit(string agentid) { AgentManagementCommon amc = new AgentManagementCommon(); AgentCreditLimitModel aclm = new AgentCreditLimitModel(); if (!string.IsNullOrEmpty(agentid)) { string agent_id = agentid.DecryptParameter(); if (!string.IsNullOrEmpty(agent_id)) { string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); amc = buss.GetAgentById(agent_id, username); aclm.AgentId = amc.AgentID.EncryptParameter(); aclm.AgentName = amc.AgentName; aclm.AgentCurrentCreditLimit = amc.AgentCreditLimit; string value = string.Empty; value = JsonConvert.SerializeObject(aclm, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); return(Json(value, JsonRequestBehavior.AllowGet)); } } this.ShowPopup(1, "Error"); return(null); }
public ActionResult ManageCommissionCategory(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.CategoryName = CCM.CategoryName; CCC.IpAddress = ApplicationUtilities.GetIP(); CCC.ActionUser = Session["username"].ToString(); CCC.AgentId = ApplicationUtilities.GetSessionValue("agentid").ToString(); CommonDbResponse dbresp = comm.ManageCommissionCategory(CCC); if (dbresp.Code == 0) { this.ShowPopup((int)dbresp.Code, dbresp.Message); return(RedirectToAction("Category")); } } this.ShowPopup(1, "Error"); return(View()); }
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)); }
public ActionResult Manage(string id) { AppVersionControlModel mnm = new AppVersionControlModel(); string username = ApplicationUtilities.GetSessionValue("username").ToString(); ViewBag.platform = ApplicationUtilities.SetDDLValue(LoadDropdownList("platform"), "", "--Select Application Platform--"); return(View()); }
/* 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 Manage(MobileNotificationModel mnm, HttpPostedFileBase Image_Upload) { var ImagePath = ""; ViewBag.importancelevel = ApplicationUtilities.SetDDLValue(LoadDropdownList("importance"), "", "--select Importance Level--"); if (ModelState.IsValid) { MobileNotificationCommon mnc = new MobileNotificationCommon(); mnc = mnm.MapObject <MobileNotificationCommon>(); if (!string.IsNullOrEmpty(mnc.NotificationId)) { if (string.IsNullOrEmpty(mnc.NotificationId.DecryptParameter())) { return(View("Manage", mnm)); } mnc.NotificationId = mnc.NotificationId.DecryptParameter(); } if (Image_Upload != null) { var contentType = Image_Upload.ContentType; var allowedExtensions = new[] { ".jpg", ".png", ".jpeg" }; var fileName = Path.GetFileName(Image_Upload.FileName); String timeStamp = DateTime.Now.ToString(); var ext = Path.GetExtension(Image_Upload.FileName); if (Image_Upload.ContentLength > 1 * 1024 * 1024)//1 MB { this.ShowPopup(1, "Image Size must be less than 1MB"); return(View(mnm)); } if (allowedExtensions.Contains(ext.ToLower())) { string datet = DateTime.Now.ToString().Replace('/', ' ').Replace(':', ' '); string myfilename = "logo " + datet + ext.ToLower(); ImagePath = Path.Combine(Server.MapPath("~/Content/userupload/Notification"), myfilename); mnc.ImageUpload = "/Content/userupload/Notification/" + myfilename; } else { this.ShowPopup(1, "File Must be .jpg,.png,.jpeg"); return(View(mnm)); } } mnc.ActionUser = ApplicationUtilities.GetSessionValue("username").ToString(); var dbresp = buss.ManageNotification(mnc); if (dbresp.Code == 0) { if (Image_Upload != null) { Image_Upload.SaveAs(ImagePath); } this.ShowPopup(0, "successfully Inserted"); return(RedirectToAction("Index")); } } this.ShowPopup(1, "Error"); return(View(mnm)); }
public ActionResult ViewAgentWalletUser(string AgentId = "") { var UserType = Session["UserType"].ToString(); string id = "", IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString().Trim(); if (UserType.ToUpper() == "SUB-DISTRIBUTOR") { return(RedirectToAction("Index", "SubDistributor", new { DistId = Session["AgentId"].ToString() })); } else if (UserType.ToUpper() == "DISTRIBUTOR") { id = Session["AgentId"].ToString(); } else { id = AgentId.DecryptParameter(); } if (string.IsNullOrEmpty(id)) { return(RedirectToAction("Index")); } var userId = ""; if (String.IsNullOrEmpty(IsPrimary) == false && (IsPrimary.ToUpper().Trim() == "N" || IsPrimary.ToUpper().Trim() == "")) { userId = Session["UserId"].ToString(); } //var WalletUser = buss.GetWalletUserList(id, userId); dynamic WalletUser = null; //Actions foreach (var item in WalletUser) { item.Action = StaticData.GetActions("ViewDistributorUser", item.UserId.EncryptParameter(), this, "", "", item.AgentID.EncryptParameter(), item.UserStatus, item.isPrimary, DisableAddEdit: Session["UserId"].ToString() == item.UserId); } //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); //param.Add("DistributorId", "Agent Id"); param.Add("UserFullName", "Fullname"); param.Add("UserName", "Username"); param.Add("UserEmail", "Email"); param.Add("UserMobileNo", "Mobile No"); param.Add("UserType", "User Type"); param.Add("isPrimary", "Is primary"); param.Add("UserStatus", "Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends //Add New var grid = ProjectGrid.MakeGrid(WalletUser, "Distributor Users", "", 0, true, "", "", "Home", "Distributor", "/Admin/Distributor", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Admin/Distributor/ManageDistributorUsers?distid=" + id.EncryptParameter() : ""); ViewData["grid"] = grid; return(View()); }
public ActionResult Index(string AgentId = "", string parent_id = "") { var UserType = Session["UserType"].ToString(); string IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString(); if (!string.IsNullOrEmpty(AgentId)) { AgentId = AgentId.DecryptParameter(); } if (UserType.ToUpper() == "SUB-AGENT") { return(RedirectToAction("Index", "SubAgentManagement")); } else if (UserType.ToUpper() == "AGENT") { AgentId = Session["AgentId"].ToString(); } if (!string.IsNullOrEmpty(parent_id) && !string.IsNullOrEmpty(parent_id.DecryptParameter())) { parent_id = parent_id.DecryptParameter(); } else { parent_id = Session["AgentId"].ToString(); } string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); var AgentCommon = buss.GetAgentList(AgentId, username, parent_id); //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentName", "Agent Name"); param.Add("AgentOperationType", "Operation Type"); param.Add("AgentMobileNumber", "Contact Number"); param.Add("AgentBalance", "Agent Balance"); //param.Add("AgentCreditLimit", "Credit Limit"); param.Add("AgentStatus", "Agent Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends foreach (var item in AgentCommon) { // item.Action = StaticData.GetActions("Distributor", item.DistributorId.EncryptParameter(), this, "", "", ""); item.Action = StaticData.GetActions("AgentManagement", item.AgentID.EncryptParameter(), this, "", "", username.EncryptParameter(), item.AgentStatus, item.ParentID); item.AgentStatus = "<span class='badge badge-" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "Active" : "Blocked") + "</span>"; } var grid = ProjectGrid.MakeGrid(AgentCommon, "Agent List", "", 0, true, "", "", "Home", "Agent", "/Admin/AgentManagement", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Admin/AgentManagement/ManageAgent?ParentId=" + parent_id.EncryptParameter() : ""); ViewData["grid"] = grid; return(View()); }
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); }
// GET: Admin/CustomerManagement public ActionResult Index(string ParentId = "", string Search = "", int Pagesize = 20) { if (!string.IsNullOrEmpty(ParentId)) { ParentId = ParentId.DecryptParameter(); } else { ParentId = ApplicationUtilities.GetSessionValue("AgentId").ToString(); } List <WalletUserInfoModel> lst = _CustomerManagement.WalletUserList("WalletUser", ParentId: ParentId).MapObjects <WalletUserInfoModel>(); foreach (var item in lst) { item.Action = StaticData.GetActions(ControllerName, item.AgentId.ToString().EncryptParameter(), this, "", "", item.AgentStatus, item.UserId.EncryptParameter()); item.AgentStatus = "<span class='badge badge-" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "Active" : "Blocked") + "</span>"; #region kycStatus if (item.KycStatus.ToUpper().Equals("PENDING")) { item.KycStatus = "<span class='badge badge-warning'>Pending</span>"; } else if (item.KycStatus.ToUpper().Equals("APPROVED")) { item.KycStatus = "<span class='badge badge-success'>Approved</span>"; } else if (item.KycStatus.ToUpper().Equals("REJECTED")) { item.KycStatus = "<span class='badge badge-danger'>Rejected</span>"; } else { item.KycStatus = "<span class='badge badge-info'>Not Filled</span>"; } #endregion } IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("MobileNo", "Mobile No"); param.Add("Email", "Email"); param.Add("FullName", "Name"); //param.Add("AgentId", "Agent Id"); //param.Add("ParentId", "Parent Id"); param.Add("Balance", "Balance"); param.Add("KycStatus", "Kyc Status"); param.Add("AgentStatus", "Status"); param.Add("CreatedLocalDate", "Registered Date"); param.Add("Action", "Action"); ProjectGrid.column = param; var grid = ProjectGrid.MakeGrid(lst, "", Search, Pagesize, true, "", "", "Home", "Customer", "/Admin/CustomerManagement", "/Admin/CustomerManagement/AddCustomer?parentid=" + ParentId.EncryptParameter()); ViewData["grid"] = grid; return(View()); }
public ActionResult ViewMerchantUser(string merchantid = "") { var UserType = Session["UserType"].ToString(); string username = ApplicationUtilities.GetSessionValue("username").ToString(); string id = "", IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString().Trim(); if (!string.IsNullOrEmpty(merchantid)) { id = merchantid.DecryptParameter(); } if (string.IsNullOrEmpty(id)) { return(RedirectToAction("Index")); } //var userId = ""; //if (String.IsNullOrEmpty(IsPrimary) == false && (IsPrimary.ToUpper().Trim() == "N" || IsPrimary.ToUpper().Trim() == "")) //{ // userId = Session["UserId"].ToString(); //} var merchantuser = _merchant.GetUserList(id, username); //Actions foreach (var item in merchantuser) { item.Action = StaticData.GetActions("Merchantuser", item.UserId.EncryptParameter(), this, "", "", item.MerchantId.EncryptParameter(), item.UserStatus, item.IsPrimary, DisableAddEdit: Session["UserId"].ToString() == item.UserId); item.UserStatus = "<span class='badge badge-" + (item.UserStatus.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.UserStatus.Trim().ToUpper() == "Y" ? "Active" : "Blocked") + "</span>"; item.IsPrimary = "<span class='badge badge-" + (item.IsPrimary.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.IsPrimary.Trim().ToUpper() == "Y" ? "Primary" : "Secondary") + "</span>"; } //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); //param.Add("DistributorId", "Agent Id"); param.Add("FullName", "Full Name"); param.Add("UserName", "User Name"); param.Add("UserEmail", "Email"); param.Add("UserMobileNumber", "Mobile Number"); // param.Add("UserType", "User Type"); param.Add("IsPrimary", "Is primary"); param.Add("UserStatus", "Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends //Add New var grid = ProjectGrid.MakeGrid(merchantuser, "Merchant Users", "", 0, true, "", "", "Home", "Merchant", "/Admin/merchantmanagement/ManagemerchantUsers", "/Admin/merchantmanagement/ManagemerchantUsers?merchantid=" + id.EncryptParameter()); ViewData["grid"] = grid; return(View()); }
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)); }
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 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 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)); }
public ActionResult Manage(string id) { MobileNotificationModel mnm = new MobileNotificationModel(); string username = ApplicationUtilities.GetSessionValue("username").ToString(); ViewBag.importancelevel = ApplicationUtilities.SetDDLValue(LoadDropdownList("importance"), "", "--Select Importance Level--"); if (!string.IsNullOrEmpty(id)) { if (!string.IsNullOrEmpty(id.DecryptParameter())) { MobileNotificationCommon mnc = new MobileNotificationCommon(); mnc = buss.GetNotificationById(id.DecryptParameter(), username); } } return(View(mnm)); }
public ActionResult ViewUser(string agentid = "") { var id = agentid.DecryptParameter(); var UserType = Session["UserType"].ToString(); var IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString(); if (string.IsNullOrEmpty(id)) { return(RedirectToAction("Index")); } var userId = ""; if (String.IsNullOrEmpty(IsPrimary) == false && (IsPrimary.ToUpper().Trim() == "N" || IsPrimary.ToUpper().Trim() == "")) { userId = Session["UserId"].ToString(); } // var DistributorCommon = _distributor.GetUserList(id, userId); var subDistributorCommon = ISD.GetUserList(id, userId); foreach (var item in subDistributorCommon) { item.Action = StaticData.GetActions("subdistributoruser", item.AgentID.EncryptParameter(), this, "", "", item.UserId.EncryptParameter(), item.UserStatus, ExtraId5: IsPrimary, DisableAddEdit: Session["UserId"].ToString() == item.UserId); item.UserStatus = "<span class='badge badge-" + (item.UserStatus.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.UserStatus.Trim().ToUpper() == "Y" ? "Enable" : "Disable") + "</span>"; } //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentID", "Agent Id"); param.Add("UserId", "User Id"); param.Add("UserFullName", "Fullname"); param.Add("UserName", "Username"); param.Add("UserEmail", "Email"); param.Add("UserMobileNo", "Mobile No"); param.Add("UserType", "User Type"); param.Add("isPrimary", "Is primary"); param.Add("UserStatus", "Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends //Add New var grid = ProjectGrid.MakeGrid(subDistributorCommon, "SubDistibutor-User", "", 0, true, "", "", "Home", "Distributor", "/Admin/SubDistributor", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Admin/SubDistributor/addUsers?agentid=" + agentid:""); ViewData["grid"] = grid; return(View()); }
// GET: Admin/SubAgentManagement public ActionResult Index(string agentId = "", string UserName = "", string Search = "", int Pagesize = 10) { string username = ApplicationUtilities.GetSessionValue("username").ToString(); var UserType = Session["UserType"].ToString(); string AgentId = "", IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString(); //if (UserType.ToUpper() == "SUB-AGENT") //{ // return RedirectToAction("Index", "SubAgentManagement"); //} //else if (UserType.ToUpper() == "AGENT") //{ // AgentId = Session["AgentId"].ToString(); //} if (!string.IsNullOrEmpty(agentId)) { AgentId = agentId.DecryptParameter(); } //string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); var SubAgentCommon = buss.GetSubAgentList(AgentId, username); //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentName", "Agent Name"); param.Add("AgentOperationType", "Operation Type"); param.Add("AgentCreditLimit", "Credit Limit"); param.Add("AgentMobileNumber", "Contact Number"); param.Add("AgentStatus", "Agent Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends foreach (var item in SubAgentCommon) { item.Action = StaticData.GetActions("SubAgentManagement", item.AgentID.EncryptParameter(), this, "", "", username.EncryptParameter(), item.AgentStatus); } var grid = ProjectGrid.MakeGrid(SubAgentCommon, "Sub Agent List ", "", 0, true, "", "", "Home", "Agent", "/Admin/SubAgentManagement/Index", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Admin/SubAgentManagement/ManageSubAgent?parentid=" + AgentId.EncryptParameter() : ""); ViewData["grid"] = grid; SubAgentCreditLimitModel sam = new SubAgentCreditLimitModel(); sam.ParentId = agentId; return(View(sam)); }
public ActionResult ManageAssignCategory(string ID) { AssignCommissionCommon ACC = comm.GetAssignedCategoryById(ID.DecryptParameter()); AssignCommissionModel ACM = new AssignCommissionModel(); if (ACC != null) { var agentid = ApplicationUtilities.GetSessionValue("agentid").ToString(); ACM.AgentName = ACC.AgentName; ACM.AgentId = ACC.AgentId; ACM.CommissionCategoryId = ACC.CommissionCategoryId; ViewBag.CommissionCategoryList = ApplicationUtilities.SetDDLValue(ICB.sproc_get_dropdown_list("016", agentid), ACM.CommissionCategoryId, "Select Commission Category"); return(View(ACM)); } this.ShowPopup(1, "Error"); return(RedirectToAction("AssignCategory")); }
public ActionResult ManageSubDistributor(string parent_id = "", string agent_Id = "") { SubDistributorManagementModel DMM = new SubDistributorManagementModel(); DMM.ParentID = parent_id; if (!string.IsNullOrEmpty(agent_Id)) { if (!string.IsNullOrEmpty(agent_Id.DecryptParameter())) { string UserName = ApplicationUtilities.GetSessionValue("username").ToString(); SubDistributorManagementCommon DC = buss.GetSubDistributorById(agent_Id.DecryptParameter(), UserName); DMM = DC.MapObject <SubDistributorManagementModel>(); DMM.AgentID = DMM.AgentID.EncryptParameter(); DMM.UserID = DMM.UserID.EncryptParameter(); DMM.ParentID = DMM.ParentID.EncryptParameter(); } } LoadDropDownList(DMM); return(View(DMM)); }