//商品設定 public ArrayList InsertCondiType(EventPromoAdditionalPrice model, string condiType) { ArrayList _list = new ArrayList(); if (!string.IsNullOrEmpty(condiType)) { var arryType = condiType.Split(','); if (model.condition_type == 1)//按品牌 { foreach (string iType in arryType) { EventPromoBrand epb = new EventPromoBrand(); epb.event_type = model.event_type; epb.site_id = model.site_id; epb.brand_id = Convert.ToInt32(iType); epb.event_id = model.event_id; epb.event_status = model.event_status; epb.create_user = model.create_user; epb.create_time = model.create_time; epb.modify_user = epb.create_user; epb.modify_time = epb.create_time; epb.event_start = model.event_start; epb.event_end = model.event_end; EventPromoBrandDao _epbDao = new EventPromoBrandDao(conn); _list.Add(_epbDao.AddOrUpdate(epb)); } } else if (model.condition_type == 2)//類別 { foreach (string iType in arryType) { EventPromoCategory epcate = new EventPromoCategory(); epcate.event_type = model.event_type; epcate.site_id = model.site_id; epcate.category_id = Convert.ToInt32(iType); epcate.event_id = model.event_id; epcate.event_status = model.event_status; epcate.create_user = model.create_user; epcate.create_time = model.create_time; epcate.modify_user = epcate.create_user; epcate.modify_time = epcate.create_time; epcate.event_start = model.event_start; epcate.event_end = model.event_end; EventPromoCategoryDao _epcateDao = new EventPromoCategoryDao(conn); _list.Add(_epcateDao.AddOrUpdate(epcate)); } } else if (model.condition_type == 3)//館別 { foreach (string iType in arryType) { EventPromoClass epclass = new EventPromoClass(); epclass.event_type = model.event_type; epclass.site_id = model.site_id; epclass.class_id = Convert.ToInt32(iType); epclass.event_id = model.event_id; epclass.event_status = model.event_status; epclass.create_user = model.create_user; epclass.create_time = model.create_time; epclass.modify_user = epclass.create_user; epclass.modify_time = epclass.create_time; epclass.event_start = model.event_start; epclass.event_end = model.event_end; EventPromoClassDao _epclassDao = new EventPromoClassDao(conn); _list.Add(_epclassDao.AddOrUpdate(epclass)); } } else if (model.condition_type == 4)//商品 { foreach (string iType in arryType) { var arryPro = iType.Split('&'); EventPromoProduct eppro = new EventPromoProduct(); eppro.event_type = model.event_type; eppro.site_id = model.site_id; eppro.product_id = Convert.ToInt32(arryPro[0]); eppro.product_num_limit = Convert.ToInt32(arryPro[1]); eppro.event_id = model.event_id; eppro.event_status = model.event_status; eppro.create_user = model.create_user; eppro.create_time = model.create_time; eppro.modify_user = eppro.create_user; eppro.modify_time = eppro.create_time; eppro.event_start = model.event_start; eppro.event_end = model.event_end; EventPromoProductDao _epproDao = new EventPromoProductDao(conn); _list.Add(_epproDao.AddOrUpdate(eppro)); } } else if (model.condition_type == 5)//購物車 { foreach (string iType in arryType) { EventPromoShoppingcart epcart = new EventPromoShoppingcart(); epcart.event_type = model.event_type; //epcart.site_id = epaGift.site_id; epcart.cart_id = Convert.ToInt32(iType); epcart.event_id = model.event_id; epcart.event_status = model.event_status; epcart.create_user = model.create_user; epcart.create_time = model.create_time; epcart.modify_user = epcart.create_user; epcart.modify_time = epcart.create_time; epcart.event_start = model.event_start; epcart.event_end = model.event_end; EventPromoShoppingcartDao _epcartDao = new EventPromoShoppingcartDao(conn); _list.Add(_epcartDao.AddOrUpdate(epcart)); } } else if (model.condition_type == 6)//付款方式 { foreach (string iType in arryType) { EventPromoPayment eppay = new EventPromoPayment(); eppay.event_type = model.event_type; eppay.site_id = model.site_id; eppay.payment_id = Convert.ToInt32(iType); eppay.event_id = model.event_id; eppay.event_status = model.event_status; eppay.create_user = model.create_user; eppay.create_time = model.create_time; eppay.modify_user = eppay.create_user; eppay.modify_time = eppay.create_time; eppay.event_start = model.event_start; eppay.event_end = model.event_end; EventPromoPaymentDao _eppayDao = new EventPromoPaymentDao(conn); _list.Add(_eppayDao.AddOrUpdate(eppay)); } } } return _list; }