コード例 #1
0
        public List<Model.Query.EventPromoAmountGiftQuery> GetList(Model.Query.EventPromoAmountGiftQuery epQuery, out int totalCount)
        {
            try
            {
                List<Model.Query.EventPromoAmountGiftQuery> _list = _iepaGiftDao.GetList(epQuery, out totalCount);
                if (_list.Count > 0)
                {
                    SiteDao _sDao = new SiteDao(conn);
                    List<Site> _slist = _sDao.Query(new Site { });
                    foreach (Model.Query.EventPromoAmountGiftQuery item in _list)
                    {
                        if (_slist.Count > 0 && !string.IsNullOrEmpty(item.site_id))
                        {
                            foreach (string sid in item.site_id.Split(','))
                            {
                                item.site_name = _slist.Find(m => m.Site_Id == Convert.ToUInt32(sid)).Site_Name;
                            }
                        }

                    }

                }
                return _list;
            }
            catch (Exception ex)
            {
                throw new Exception("EventPromoAmountGiftMgr-->GetList-->" + ex.Message, ex);
            }
        }
コード例 #2
0
        public List<Model.EventPromoAmountFare> GetList(Model.EventPromoAmountFare model, out int totalCount)
        {
            try
            {
                List<Model.EventPromoAmountFare> _list = _iepaFareDao.GetList(model, out totalCount);
                if (_list.Count > 0)
                {
                    SiteDao _sDao = new SiteDao(_conn);
                    List<Site> _slist = _sDao.Query(new Site { });
                    foreach (Model.EventPromoAmountFare item in _list)
                    {
                        if (_slist.Count > 0 && !string.IsNullOrEmpty(item.site_id))
                        {
                            foreach (string sid in item.site_id.Split(','))
                            {
                                item.site_name = _slist.Find(m => m.Site_Id == Convert.ToUInt32(sid)).Site_Name;
                            }
                        }

                    }

                }
                return _list;
            }
            catch (MySqlException ex)
            {
                throw new Exception(ex.Number.ToString() + ":EventPromoAmountFareMgr-->GetList-->" + ex.Message, ex);
            }
            catch (Exception ex)
            {
                throw new Exception("EventPromoAmountFareMgr-->GetList-->" + ex.Message, ex);
            }
        }
コード例 #3
0
        public List<PromotionAmountDiscountQuery> Query(PromotionAmountDiscountQuery query, out int totalCount, string eventtype)
        {

            try
            {
                List<PromotionAmountDiscountQuery> _list = _padDao.Query(query, out totalCount, eventtype);
                if (_list.Count > 0)
                {
                    ShopClassDao _scDao = new ShopClassDao(connStr);
                    VipUserGroupDao _vugDao = new VipUserGroupDao(connStr);
                    SiteDao _sDao = new SiteDao(connStr);
                    foreach (PromotionAmountDiscountQuery item in _list)
                    {
                        if (item.class_id != 0)
                        {
                            item.class_name = _scDao.QueryStore(item.class_id).FirstOrDefault().class_name;
                        }
                        if (item.brand_id != 0)
                        {
                            item.brand_name = _vendorBrandDao.GetProductBrand(new VendorBrand { Brand_Id = Convert.ToUInt32(item.brand_id) }).Brand_Name;
                        }
                        if (item.group_id != 0)
                        {
                            item.group_name = _vugDao.GetModelById(Convert.ToUInt32(item.group_id)).group_name;
                        }
                        string[] arrySite = item.siteId.Split(',');
                        foreach (string i in arrySite)
                        {
                            if (i != "" && i != "0")
                            {
                                item.site += _sDao.Query(new Site { Site_Id = Convert.ToUInt32(i) }).FirstOrDefault().Site_Name + ",";
                            }
                        }
                        item.site = item.site.TrimEnd(',');
                        item.isallclass = GetProductFromProCatSetAsCid(item.category_id, 999999);
                    }
                }
                return _list;
            }
            catch (Exception ex)
            {
                throw new Exception("PromotionsAmountDiscountMgr-->Query-->" + ex.Message, ex);
            }
        }
コード例 #4
0
        public List<PromotionsAmountDiscountCustom> GetList(PromotionsAmountDiscountCustom query, out int totalCount)
        {
            try
            {
                List<PromotionsAmountDiscountCustom>store=_padDao.GetList(query, out totalCount);
                     SiteDao _sDao = new SiteDao(connStr);
                foreach (var item in store)
                {

                    string[] araySite = item.site.Split(',');
                    foreach (string site in araySite)
                    {
                        if (item.group_name == "")
                        {
                            item.group_name = "不分";
                        }
                        if (site != "" && site != "0")
                        {
                            item.site_name += _sDao.Query(new Site { Site_Id = Convert.ToUInt32(site) }).FirstOrDefault().Site_Name + ",";
                        }
                    }
                    item.site_name = item.site_name.TrimEnd(',');
                }
                return store;
            }
            catch (Exception ex)
            {
                throw new Exception("PromotionsAmountDiscountMgr-->GetList-->" + ex.Message, ex);
            }
        }