public JsonResult ExtendCreditLimit(string agentid) { DistributorManagementCommon amc = new DistributorManagementCommon(); DistributorCreditLimitModel aclm = new DistributorCreditLimitModel(); if (!string.IsNullOrEmpty(agentid)) { string agent_id = agentid.DecryptParameter(); if (!string.IsNullOrEmpty(agent_id)) { string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); amc = buss.GetDistributorById(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 void ExtendCreditLimit(DistributorCreditLimitModel model) { if (ModelState.IsValid) { DistributorCreditLimitCommon clc = new DistributorCreditLimitCommon(); clc = model.MapObject <DistributorCreditLimitCommon>(); 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; }