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);
            }
        }
Esempio n. 2
0
 public VipUserGroupMgr(string connectionStr)
 {
     _vipUserGroup = new VipUserGroupDao(connectionStr);
     _vipUserGroupDao = new VipUserGroupDao(connectionStr);
     _ISerialImpl = new SerialDao(connectionStr);
 }