public List <GatewayProductCommon> GetGatewayProductList(string GatewayId, string ProductId) { var sql = "exec sproc_gateway_products_commission"; sql += " @flag = 's' "; sql += ", @gateway_id =" + dao.FilterString(GatewayId); sql += ", @product_id =" + dao.FilterString(ProductId); var dt = dao.ExecuteDataTable(sql); var list = new List <GatewayProductCommon>(); if (null != dt) { int sn = 1; foreach (DataRow item in dt.Rows) { var common = new GatewayProductCommon { GatewayProductId = (int)item["gatewayproductid"], GatewayId = item["gatewayid"].ToString(), ProductId = item["productid"].ToString(), ProductLabel = item["servicename"].ToString(), CommissionValue = float.Parse(item["commission"].ToString()), CommissionType = item["commissiontype"].ToString() }; sn++; list.Add(common); } } return(list); }
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)); }
//public GatewayProductCommon GetGatewayProductByid(string GatewayId, string ProductId) //{ // var sql = "exec sproc_gateway_products_commission"; // sql += " @flag = 's' "; // sql += ", @gateway_id =" + dao.FilterString(GatewayId); // sql += ", @product_id =" + dao.FilterString(ProductId); // var dt = dao.ExecuteDataTable(sql); // if (null != dt) // { // var common = new GatewayProductCommon // { // GatewayId = .tostring(); // }; // } //} public CommonDbResponse ManageGatewayProductCommission(GatewayProductCommon GWPC) { var sql = "exec sproc_gateway_products_commission"; sql += " @flag='i'"; sql += ", @gateway_id=" + dao.FilterString(GWPC.GatewayId); sql += ", @product_id=" + dao.FilterString(GWPC.ProductId); sql += ", @commission=" + dao.FilterString(GWPC.CommissionValue.ToString()); sql += ", @commission_type=" + dao.FilterString(GWPC.CommissionType); sql += ", @ipaddress=" + dao.FilterString(GWPC.IpAddress); sql += ", @createdby=" + dao.FilterString(GWPC.ActionUser); return(dao.ParseCommonDbResponse(sql)); }
public CommonDbResponse ManageGatewayProductCommission(GatewayProductCommon GWPC) { return(repo.ManageGatewayProductCommission(GWPC)); }