Exemple #1
0
        //删除操作
        private void button3_Click(object sender, EventArgs e)
        {
            //获取选中的行,找到对应的编号
            var rows = dataGridView1.SelectedRows;

            if (rows.Count > 0)
            {
                DialogResult result = MessageBox.Show("确定要删除吗?", "提示", MessageBoxButtons.OKCancel);
                if (result == DialogResult.OK)
                {
                    int id = int.Parse(rows[0].Cells[0].Value.ToString());
                    if (mtiBll.Remove(id))
                    {
                        LoadList();
                        UpdateTypeEvent();
                    }
                    else
                    {
                        MessageBox.Show("删除失败,请稍后重试!!!");
                    }
                }
            }
            else
            {
                MessageBox.Show("请选择要删除的数据");
            }
        }
Exemple #2
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            //获取选中的行
            var rows = gvMemberTypeInfo.SelectedRows;

            if (rows.Count > 0)
            {
                DialogResult result = MessageBox.Show("确定删除吗?", "提示", MessageBoxButtons.OKCancel);

                if (result == DialogResult.OK)
                {
                    int id = int.Parse(rows[0].Cells[0].Value.ToString());
                    if (mtiBll.Remove(id))
                    {
                        LoadMemberList();
                        UpdateTypeEvent();
                    }
                    else
                    {
                        MessageBox.Show("删除失败,请稍后重试!");
                    }
                }
            }
            else
            {
                MessageBox.Show("二货,你还没选要删除的行呢!");
            }
        }
Exemple #3
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            var rows = gv_MemberTypeInfoList.SelectedRows;

            if (rows.Count > 0)
            {
                var result = MessageBox.Show("确定要删除么?", "提示", MessageBoxButtons.OKCancel);
                if (result == DialogResult.OK)
                {
                    var id = int.Parse(rows[0].Cells[0].Value.ToString());
                    if (mtiBll.Remove(id))
                    {
                        Load_List();
                        UpdateTypeEvent?.Invoke();
                    }

                    else
                    {
                        MessageBox.Show("删除失败");
                    }
                }
            }
            else
            {
                MessageBox.Show("请选择要删除的数据");
            }
        }
        private void btnRemove_Click(object sender, EventArgs e)
        {
            int          Mid    = Convert.ToInt32(dgvList.SelectedCells[0].Value);
            DialogResult result = MessageBox.Show("确定要删除吗", "提示", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                return;
            }
            if (mtiBll.Remove(Mid))
            {
                LoadList();
            }
            else
            {
                MessageBox.Show("删除失败");
            }
            result = DialogResult.OK;
        }
Exemple #5
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            var row = dgvList.SelectedRows[0];
            int id  = Convert.ToInt32(row.Cells[0].Value);

            DialogResult result = MessageBox.Show("Are you sure to delete it?", "Tips", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                return;
            }
            if (mtiBll.Remove(id))
            {
                LoadList();
            }
            else
            {
                MessageBox.Show("Fail to delete a VIP type.");
            }
            result = DialogResult.OK;
        }
Exemple #6
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            var          row    = dgvList.SelectedRows[0];
            int          id     = Convert.ToInt32(row.Cells[0].Value);
            DialogResult result = MessageBox.Show("确定要删除吗?", "提示", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                if (mtiBll.Remove(id))
                {
                    LoadList();
                    MessageBox.Show("删除成功.");
                }
                else
                {
                    MessageBox.Show("删除失败,稍后重试......");
                }
            }

            resule = DialogResult.OK;
        }
        private void btnRemove_Click(object sender, EventArgs e)
        {
            var row = dgvList.SelectedRows[0];
            int id  = Convert.ToInt32(row.Cells[0].Value);
            //确认
            DialogResult result = MessageBox.Show("Delete?", "Alert", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                return;
            }
            if (mtiBll.Remove(id))
            {
                LoadList();
            }
            else
            {
                MessageBox.Show("Falied");
            }

            result = DialogResult.OK;
        }
Exemple #8
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            //获取选中行的编号
            var row = dgvList.SelectedRows[0];
            int id  = Convert.ToInt32(row.Cells[0].Value);
            //确认
            DialogResult result = MessageBox.Show("确定要删除吗?", "提示", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                return;
            }
            //进行删除
            if (mtiBll.Remove(id))
            {
                LoadList();
            }
            else
            {
                MessageBox.Show("删除失败,请稍候重试");
            }

            result = DialogResult.OK;
        }