public List <CommissionCategoryCommon> GetAgentCommissionCategoryList(string agentid) { string sql = "exec sproc_agent_commission_detail "; sql += " @flag='list'"; sql += ", @agent_id=" + dao.FilterString(agentid); var dt = dao.ExecuteDataTable(sql); List <CommissionCategoryCommon> list = new List <CommissionCategoryCommon>(); if (dt != null) { foreach (DataRow item in dt.Rows) { var common = new CommissionCategoryCommon { CategoryId = item["category_id"].ToString(), CategoryName = item["category_name"].ToString(), CreatedBy = item["created_by"].ToString(), CreateDate = item["created_local_date"].ToString(), IsActive = item["is_active"].ToString() }; list.Add(common); } } return(list); }
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 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." })); }
public CommonDbResponse block_unblockCategory(CommissionCategoryCommon ccc, string status) { string sql = "exec sproc_agent_commission_detail "; sql += "@flag='d'"; sql += ",@comm_category_id=" + dao.FilterString(ccc.CategoryId); sql += ",@is_active=" + dao.FilterString(status); sql += ",@updated_by=" + dao.FilterString(ccc.ActionUser); return(dao.ParseCommonDbResponse(sql)); }
public CommonDbResponse ManageAgentCommissionCategory(CommissionCategoryCommon CC) { string sql = "exec sproc_agent_commission_detail "; sql += "@flag ='" + (string.IsNullOrEmpty(CC.CategoryId) ? "i" : "") + "' "; sql += ", @agent_id=" + dao.FilterString(CC.AgentId); sql += ", @comm_category_id=" + dao.FilterString(CC.CategoryId); sql += ", @comm_category_name=" + dao.FilterString(CC.CategoryName); sql += "," + (string.IsNullOrEmpty(CC.CategoryId) ? "@created_by" : "@updated_by") + "=" + dao.FilterString(CC.ActionUser); sql += "," + (string.IsNullOrEmpty(CC.CategoryId) ? "@created_ip" : "@updated_ip") + "=" + dao.FilterString(CC.IpAddress); return(dao.ParseCommonDbResponse(sql)); }
public CommissionCategoryCommon GetAgentCommissionCategoryById(string Id) { string sql = "exec sproc_agent_commission_detail "; sql += " @flag='lsbyid'"; sql += ", @comm_category_id=" + dao.FilterString(Id); var dt = dao.ExecuteDataRow(sql); CommissionCategoryCommon cc = new CommissionCategoryCommon(); if (dt != null) { cc.CategoryId = dt["category_id"].ToString(); cc.CategoryName = dt["category_name"].ToString(); } return(cc); }
public CommonDbResponse ManageAgentCommissionCategory(CommissionCategoryCommon CC) { return(_repo.ManageAgentCommissionCategory(CC)); }
public CommonDbResponse block_unblockCategory(CommissionCategoryCommon ccc, string status) { return(_repo.block_unblockCategory(ccc, status)); }