//添加
        private void toolAdd_Click(object sender, EventArgs e)
        {
            PromotionForm promotionForm = new PromotionForm(db, null);

            if (promotionForm.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
            }
        }
        //修改
        private void toolEdit_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printWarningMsg("没有选择行!");
                return;
            }

            int selId     = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var promotion = db.Promotion.FirstOrDefault(x => x.id == selId);

            PromotionForm editPromotion = new PromotionForm(db, promotion);

            if (editPromotion.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
            }
        }
        //修改
        private void toolEdit_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printWarningMsg("没有选择行!");
                return;
            }

            int selId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var promotion = db.Promotion.FirstOrDefault(x => x.id == selId);

            PromotionForm editPromotion = new PromotionForm(db, promotion);
            if (editPromotion.ShowDialog() == DialogResult.OK)
                dgv_show();
        }
 //添加
 private void toolAdd_Click(object sender, EventArgs e)
 {
     PromotionForm promotionForm = new PromotionForm(db, null);
     if (promotionForm.ShowDialog() == DialogResult.OK)
         dgv_show();
 }