Esempio n. 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();
 }
Esempio n. 2
0
 partial void DeletePromotion(Promotion instance);
Esempio n. 3
0
 partial void UpdatePromotion(Promotion instance);
Esempio n. 4
0
 partial void InsertPromotion(Promotion instance);
 //构造函数
 public PromotionItemAddForm(BathDBDataContext dc, Promotion promotion)
 {
     db = dc;
     m_Promotion = promotion;
     InitializeComponent();
 }
Esempio n. 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;
        }