예제 #1
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            FormThem_CapNhatSach newForm = new FormThem_CapNhatSach();

            this.Visible = false;
            newForm.Show();
            newForm.Disposed += NewForm_Disposed;
        }
예제 #2
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            DataGridViewRow row = dataGVSach.SelectedRows.Count >= 1 ? dataGVSach.SelectedRows[0] : null;

            if (row != null)
            {
                string maSach                = row.Cells["colMaSach"].Value.ToString();
                string tenSach               = row.Cells["colTenSach"].Value.ToString();
                string tenTacGia             = row.Cells["colTacGia"].Value.ToString();
                string tenTheLoai            = row.Cells["colTheLoai"].Value.ToString();
                string tenNXB                = row.Cells["colNXB"].Value.ToString();
                string gia                   = row.Cells["colGia"].Value.ToString();
                int    soLuong               = Convert.ToInt32(row.Cells["colSoLuong"].Value);
                FormThem_CapNhatSach newForm = new FormThem_CapNhatSach(maSach, tenSach, tenTacGia, tenNXB, tenTheLoai, gia, soLuong);
                this.Visible = false;
                newForm.Show();
                newForm.Disposed += NewForm_Disposed;
            }
            else
            {
                MessageBox.Show("Bạn chưa chọn sách để sửa");
            }
        }