//对话框载入
        private void PromotionForm_Load(object sender, EventArgs e)
        {
            db = new BathDBDataContext(LogIn.connectionString);
            m_Promotion = db.GroupBuyPromotion.FirstOrDefault();
            if (m_Promotion == null)
            {
                m_Promotion = new GroupBuyPromotion();
                db.GroupBuyPromotion.InsertOnSubmit(m_Promotion);
                db.SubmitChanges();
            }

            m_Offer = BathClass.disAssemble(db, m_Promotion);
            dgvDetails_show();
        }
Ejemplo n.º 2
0
 partial void DeleteGroupBuyPromotion(GroupBuyPromotion instance);
Ejemplo n.º 3
0
 partial void UpdateGroupBuyPromotion(GroupBuyPromotion instance);
Ejemplo n.º 4
0
 partial void InsertGroupBuyPromotion(GroupBuyPromotion instance);
Ejemplo n.º 5
0
 //构造函数
 public GroupBuyItemAddForm(BathDBDataContext dc, GroupBuyPromotion promotion)
 {
     db = dc;
     m_Promotion = promotion;
     InitializeComponent();
 }
Ejemplo n.º 6
0
        //拆分优惠方案
        public static Dictionary<string, string> disAssemble(BathDBDataContext db, GroupBuyPromotion 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;
        }