public PromoCouponModel GetCouponList(string CatId, string SubCatId, string CompanyId, string BrandId, string PCKGId, string Itemval) { DataSet districtBlockVilage = _Apdal.GetCouponList(CatId, SubCatId, CompanyId, BrandId, PCKGId, Itemval); PromoCouponModel model = new PromoCouponModel(); if ((districtBlockVilage != null)) { if (districtBlockVilage.Tables[0].Rows.Count <= 0) { return(model); } List <PromoCoupon> list = new List <PromoCoupon>(); for (int i = 0; i < districtBlockVilage.Tables[0].Rows.Count; i++) { PromoCoupon item = new PromoCoupon { CouponID = Convert.ToInt32(districtBlockVilage.Tables[0].Rows[i]["CouponID"].ToString()), CouponCode = districtBlockVilage.Tables[0].Rows[i]["CouponCode"].ToString(), CouponName = districtBlockVilage.Tables[0].Rows[i]["CouponName"].ToString(), CouponDesc = districtBlockVilage.Tables[0].Rows[i]["CouponDesc"].ToString() }; list.Add(item); } model.List = list; } return(model); }
public PromoCouponModel GetCouponList(string apiKey, string CatId = "0", string SubCatId = "0", string CompnanId = "0", string BrandId = "0", string PCKGId = "0", string Itemval = "0") { PromoCouponModel list = new PromoCouponModel(); if (apiKey == ConfigurationManager.AppSettings["reasonkey"]) { try { PromoCouponModel a = _agentbal.GetCouponList(CatId, SubCatId, CompnanId, BrandId, PCKGId, Itemval); list = a; } catch (Exception ex) { LogBal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); } } return(list); }