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