public PromotionBannerMgr(string connectionStr) { _promotionBannerDao = new PromotionBannerDao(connectionStr); _promotionBannerRelationDao = new PromotionBannerRelationDao(connectionStr); _mysqlDao = new MySqlDao(connectionStr); _vendorBrandDao = new VendorBrandDao(connectionStr); _accessMySql = DBFactory.getDBAccess(DBType.MySql, connectionStr); }
public PromotionsAmountDiscountMgr(string connectionstring) { _mysqlDao = new MySqlDao(connectionstring); _padDao = new PromotionsAmountDiscountDao(connectionstring); _prodpromoDao = new ProdPromoDao(connectionstring); _proCateDao = new ProductCategoryDao(connectionstring); _prodCategSet = new ProductCategorySetDao(connectionstring); _proAllDao = new PromoAllDao(connectionstring); _usconDao = new UserConditionDao(connectionstring); _promoDisDao = new PromoDiscountDao(connectionstring); _promoMainDao = new PromotionsMaintainDao(connectionstring); _prodDao = new ProductDao(connectionstring); _vendorBrandDao = new VendorBrandDao(connectionstring); connStr = connectionstring; }
/// <summary> /// 有參構造函數 /// </summary> /// <param name="connectionstring">數據庫連接字符串</param> public PromotionsAmountGiftDao(string connectionstring) { _access = DBFactory.getDBAccess(DBType.MySql, connectionstring); this.connStr = connectionstring; _proCateDao = new ProductCategoryDao(connectionstring); _prodCategSetDao = new ProductCategorySetDao(connectionstring); _prodpromoDao = new ProdPromoDao(connectionstring); _proAllDao = new PromoAllDao(connectionstring); _usconDao = new UserConditionDao(connectionstring); _promoDisDao = new PromoDiscountDao(connectionstring); _serialDao = new SerialDao(connectionstring); _ptDao = new PromoTicketDao(connectionstring); _prodDao = new ProductDao(connectionstring); _promoMainDao = new PromotionsMaintainDao(connectionstring); _vendorBrandDao = new VendorBrandDao(connectionstring); }
public DataTable GetCourseCountList(CourseQuery query, out int totalCount) { try { DataTable course_dt = _tmDao.GetCourseCountList(query, out totalCount); course_dt.Columns.Add("ticket_detail_id"); course_dt.Columns.Add("spec_name_1"); course_dt.Columns.Add("spec_name_2"); course_dt.Columns.Add("vendor_name_simple"); course_dt.Columns.Add("sales_number"); course_dt.Columns.Add("used_number"); if (course_dt != null) { VendorBrandDao _vbDao = new VendorBrandDao(connStr); ProductSpecDao _psDao = new ProductSpecDao(connStr); CourseTicketDao _ctDao = new CourseTicketDao(connStr); foreach (DataRow item in course_dt.Rows) { //獲取供應商名稱 item["vendor_name_simple"] = _vbDao.GetBandList(string.Format(" and vb.brand_id='{0}'", item["brand_id"])).Rows[0]["vendor_name_simple"]; item["spec_name_1"] = _psDao.query(Convert.ToInt32(item["spec_id_1"])).spec_name; item["spec_name_2"] = _psDao.query(Convert.ToInt32(item["spec_id_2"])).spec_name; DataTable s_dt = _ctDao.GetCount(Convert.ToInt32(item["item_id"])); if (s_dt.Rows.Count > 0) { item["sales_number"] = s_dt.Rows[0]["number"]; item["ticket_detail_id"] = s_dt.Rows[0]["ticket_detail_id"]; } DataTable u_dt = _ctDao.GetCount(Convert.ToInt32(item["item_id"]), 1); if (u_dt.Rows.Count > 0) { item["used_number"] = u_dt.Rows[0]["number"]; } } } return course_dt; } catch (Exception ex) { throw new Exception("TicketMasterMgr-->GetCourseCountList-->" + ex.Message, ex); } }
public HttpResponseBase QueryProList() { string json = string.Empty; string _classid = String.Empty; PromotionsMaintainDao pmDao = new PromotionsMaintainDao(mySqlConnectionString); try { QueryVerifyCondition query = new QueryVerifyCondition(); #region 查询条件填充 query.IsPage = true; query.Start = int.Parse(Request.Params["start"] ?? "0"); query.Limit = int.Parse(Request.Params["limit"] ?? "25"); if (!string.IsNullOrEmpty(Request.Params["key"]))//變動1支持商品編號的批次查詢 { query.product_name = Request.Params["key"].Replace(',', ',').Replace('|', ',').Replace(' ', ','); //在這裡product_id用,分割拼接的字符串用product_name 存放 } query.combination = 1;//只顯示單一商品 if (!string.IsNullOrEmpty(Request.Params["brand_id"]))//支持品牌查詢 { query.brand_id = uint.Parse(Request.Params["brand_id"]); } else { if (!string.IsNullOrEmpty(Request.Params["class_id"]))//支持館別查詢 { VendorBrandDao _vendorBrandDao = new VendorBrandDao(mySqlConnectionString); List<VendorBrand> results = _vendorBrandDao.GetClassBrandList(new VendorBrand { }, Convert.ToUInt32(Request.Params["class_id"]), 1); foreach (VendorBrand item in results) { query.brand_ids += item.Brand_Id + ","; } query.brand_ids = query.brand_ids.TrimEnd(','); } } #endregion int totalCount = 0; List<QueryandVerifyCustom> pros = pmDao.GetProList(query, out totalCount); json = "{succes:true,totalCount:" + totalCount + ",item:" + JsonConvert.SerializeObject(pros) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{succes:true,totalCount:0,item:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }