Exemple #1
0
        //新增会员等级
        private void btnAddVip_Click(object sender, EventArgs e)
        {
            VipGradeModel vip = new VipGradeModel();

            vip.VGID1 = -1;
            MemberLevelEditorForm mef = new MemberLevelEditorForm(vip);

            mef.Show();
            this.Hide();
        }
Exemple #2
0
 //修改
 private void btnUpdateVip_Click(object sender, EventArgs e)
 {
     if (dataGridView2.SelectedCells.Count > 0)
     {
         int                   index = Convert.ToInt32(dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[0].Value);
         string                top   = dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[1].Value.ToString();
         double                zk    = Convert.ToDouble(dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[2].Value);
         VipGradeModel         vip   = new VipGradeModel(index, top, zk);
         MemberLevelEditorForm mef   = new MemberLevelEditorForm(vip);
         mef.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("请选择数据!");
     }
 }
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (vip.VGID1 == -1)
     {
         //新增
         string        top    = txtTop.Text.Trim();
         double        zk     = Convert.ToDouble(txtZk.Text.Trim());
         VipGradeModel vip2   = new VipGradeModel(top, zk);
         int           result = adminsBLL.getAddVip(vip2);
         if (result > 0)
         {
             MessageBox.Show("OK");
             this.Close();
             SystemSettingsForm ssf = new SystemSettingsForm();
             ssf.Show();
         }
         else
         {
             MessageBox.Show("NO");
         }
     }
     else
     {
         //修改
         string        top    = txtTop.Text.Trim();
         double        zk     = Convert.ToDouble(txtZk.Text.Trim());
         VipGradeModel vip2   = new VipGradeModel(vip.VGID1, top, zk);
         int           result = adminsBLL.getUpdateVip(vip2);
         if (result > 0)
         {
             MessageBox.Show("OK");
             this.Close();
             SystemSettingsForm ssf = new SystemSettingsForm();
             ssf.Show();
         }
         else
         {
             MessageBox.Show("NO");
         }
     }
 }
Exemple #4
0
        //删除
        private void btnDeleteVip_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("确定删除该行数据?", "温馨提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                int           index = Convert.ToInt32(dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[0].Value);
                VipGradeModel vip   = new VipGradeModel();
                vip.VGID1 = index;
                int result = adminsBLL.getDeleteVip(vip);
                if (result > 0)
                {
                    MessageBox.Show("OK");
                    SystemSettingsForm_Load(null, null);
                }
                else
                {
                    MessageBox.Show("NO");
                }
            }
        }
Exemple #5
0
 //删除
 public static int getDeleteVip(VipGradeModel vip)
 {
     return(adminsDAL.getDeleteVip(vip));
 }
 public MemberLevelEditorForm(VipGradeModel vip)
 {
     this.vip = vip;
     InitializeComponent();
 }
Exemple #7
0
        //删除
        public static int getDeleteVip(VipGradeModel vip)
        {
            string sql = string.Format(@"delete VIPGrade where VGID={0}", vip.VGID1);

            return(DBHelper.getExecuteNonQuery(sql));
        }
Exemple #8
0
        //修改
        public static int getUpdateVip(VipGradeModel vip)
        {
            string sql = string.Format(@"update VIPGrade set VGName='{0}',VGDiscount='{1}' where VGID={2}", vip.VGName1, vip.VGDiscount1, vip.VGID1);

            return(DBHelper.getExecuteNonQuery(sql));
        }
Exemple #9
0
        //添加会员等级
        public static int getAddVip(VipGradeModel vip)
        {
            string sql = string.Format(@"insert VIPGrade values('{0}','{1}')", vip.VGName1, vip.VGDiscount1);

            return(DBHelper.getExecuteNonQuery(sql));
        }