Пример #1
0
        public string GetCondiType(int condiType, string event_id)
        {
            string content = string.Empty;
            if (condiType != 0 && !string.IsNullOrEmpty(event_id))
            {

                if (condiType == 1)//按品牌
                {
                    EventPromoBrandDao _epbDao = new EventPromoBrandDao(conn);
                    List<EventPromoBrand> model = _epbDao.GetList(event_id);
                    foreach (EventPromoBrand item in model)
                    {
                        content += item.brand_id + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 2)//類別
                {
                    EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(conn);
                    List<EventPromoCategory> model = _epcateDao.GetList(event_id);
                    foreach (EventPromoCategory item in model)
                    {
                        content += item.category_id + "&" + item.category_name + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 3)//館別
                {
                    EventPromoClassDao _epclassDao = new EventPromoClassDao(conn);
                    List<EventPromoClass> model = _epclassDao.GetList(event_id);
                    foreach (EventPromoClass item in model)
                    {
                        content += item.class_id + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 4)//商品
                {
                    EventPromoProductDao _epproDao = new EventPromoProductDao(conn);

                    List<EventPromoProduct> model = _epproDao.GetList(event_id);
                    foreach (EventPromoProduct item in model)
                    {
                        content += item.product_id + "&" + item.product_num_limit + "&" + item.product_name + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 5)//購物車
                {
                    EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(conn);

                    List<EventPromoShoppingcart> model = _epcartDao.GetList(event_id);
                    foreach (EventPromoShoppingcart item in model)
                    {
                        content += item.cart_id + ",";
                    }
                    content = content.TrimEnd(',');
                }
                else if (condiType == 6)//付款方式
                {
                    EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(conn);

                    List<EventPromoPayment> model = _eppayDao.GetList(event_id);
                    foreach (EventPromoPayment item in model)
                    {
                        content += item.payment_id + ",";
                    }
                    content = content.TrimEnd(',');
                }



            }
            return content;
        }