Exemple #1
0
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            dem = 1;
            try
            {
                int r;
                r = dgvThongTinMon.CurrentCell.RowIndex;
                if (r >= 0)
                {
                    string MaMon   = dgvThongTinMon.Rows[r].Cells[0].Value.ToString();
                    string TenMon  = dgvThongTinMon.Rows[r].Cells[1].Value.ToString();
                    string TheLoai = dgvThongTinMon.Rows[r].Cells[3].Value.ToString();
                    string GiaMon  = dgvThongTinMon.Rows[r].Cells[2].Value.ToString();
                    if (b != null)
                    {
                        k = 1;
                    }
                    else
                    {
                        k = 0;
                    }

                    ThemVaCapNhapMon capnhat = new ThemVaCapNhapMon(MaMon, TenMon, TheLoai, GiaMon, b);
                    capnhat.Show();
                }
                else
                {
                    MessageBox.Show("Chưa Chọn Món Cần Cập Nhật!!!");
                }
            }
            catch
            {
                MessageBox.Show("Không Được. Lỗi rồi!!!");
            }
        }
Exemple #2
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            dem = 0;
            ThemVaCapNhapMon t = new ThemVaCapNhapMon(null, null, null, null, null);

            t.Show();
        }