Пример #1
0
 //构造函数
 public PromotionForm(BathDBDataContext dc, Promotion promotion)
 {
     db = dc;
     if (promotion != null)
     {
         newPromotion = false;
         m_Promotion = promotion;
         m_Offer = BathClass.disAssemble(db, m_Promotion);
     }
     InitializeComponent();
     dgv_show();
 }
Пример #2
0
 partial void DeletePromotion(Promotion instance);
Пример #3
0
 partial void UpdatePromotion(Promotion instance);
Пример #4
0
 partial void InsertPromotion(Promotion instance);
 //构造函数
 public PromotionItemAddForm(BathDBDataContext dc, Promotion promotion)
 {
     db = dc;
     m_Promotion = promotion;
     InitializeComponent();
 }
Пример #6
0
        //拆分优惠方案
        public static Dictionary<string, string> disAssemble(BathDBDataContext db, Promotion promotion)
        {
            Dictionary<string, string> menuIdList = new Dictionary<string, string>();

            if (promotion.menuIds == null)
                return menuIdList;

            string[] menuIds = promotion.menuIds.Split(';');
            foreach (string menuId in menuIds)
            {
                if (menuId == "")
                    continue;

                string[] tps = menuId.Split('=');
                menuIdList.Add(tps[0], tps[1]);
            }

            return menuIdList;
        }