Ejemplo n.º 1
0
        //新增
        private void addTool_Click(object sender, EventArgs e)
        {
            CouponForm addCoupon = new CouponForm(db, null);

            if (addCoupon.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
            }
        }
Ejemplo n.º 2
0
        //编辑
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int selId  = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var coupon = db.Coupon.FirstOrDefault(x => x.pkey == selId);

            CouponForm editCoupon = new CouponForm(db, coupon);

            if (editCoupon.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
            }
        }
Ejemplo n.º 3
0
        //编辑
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int selId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var coupon = db.Coupon.FirstOrDefault(x => x.pkey == selId);

            CouponForm editCoupon = new CouponForm(db, coupon);
            if (editCoupon.ShowDialog() == DialogResult.OK)
                dgv_show();
        }
Ejemplo n.º 4
0
 //新增
 private void addTool_Click(object sender, EventArgs e)
 {
     CouponForm addCoupon = new CouponForm(db, null);
     if (addCoupon.ShowDialog() == DialogResult.OK)
         dgv_show();
 }