コード例 #1
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            var    rows = dgvList.SelectedRows;
            string id   = rows[0].Cells[0].Value.ToString();

            if (rows.Count > 0)
            {
                DialogResult result = MessageBox.Show("确定要删除吗?", "提示", MessageBoxButtons.OKCancel);
                if (result == DialogResult.Cancel)
                {
                    return;
                }
                if (bll.Delete(id))
                {
                    RemoveInfo remove = new RemoveInfo()
                    {
                        RId    = Convert.ToInt32(id),
                        RName  = rows[0].Cells[1].Value.ToString(),
                        RTable = "DishTypeInfo"
                    };
                    RemoveInfoBll removebll = new RemoveInfoBll();
                    removebll.Add(remove);
                    LoadList();
                }
            }
            resulted = DialogResult.OK;
        }
コード例 #2
0
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (dishTypeInfoBll.Delete(Convert.ToInt32(dgvList.SelectedRows[0].Cells["Column1"].Value)))
     {
         LoadList();
         btnCancel.PerformClick();
         Type();
     }
     else
     {
         MessageBox.Show("删除失败,请稍后重试");
     }
 }
コード例 #3
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure?", "tip", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                return;
            }
            var row = dgvList.SelectedRows[0];
            int id  = Convert.ToInt32(row.Cells[0].Value);

            if (bll.Delete(id))
            {
                LoadList();
            }
        }
コード例 #4
0
        private void button_删除选中的菜系_Click(object sender, EventArgs e)
        {
            var          rows = dataGridView_菜单类型管理.SelectedCells;
            DishTypeInfo mti  = new DishTypeInfo()
            {
                DId = Convert.ToInt32(rows[0].Value)
            };

            if (dtibll.Delete(mti))
            {
                GetInfo();
            }
            else
            {
                MessageBox.Show("删除错误,请重试");
            }
        }
コード例 #5
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            var          row    = dgvList.SelectedRows[0];
            DialogResult result = MessageBox.Show("确认删除吗?", "窗口", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                return;
            }
            if (dtiBll.Delete(Convert.ToInt32(row.Cells[0].Value)))
            {
                LoadList();
            }
            else
            {
                MessageBox.Show("删除失败");
            }
        }
コード例 #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("Are you sure to delete?", "Tips", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                return;
            }

            if (dtiBll.Delete(id))
            {
                LoadList();
            }
            else
            {
                MessageBox.Show("Fail to delete");
            }

            this.result = DialogResult.OK;
        }