private void btnInsert_Click(object sender, EventArgs e) { frmClinicEdit frmedit = new frmClinicEdit(); frmClinicEdit.IdClinicEdit = 0; frmedit.ShowDialog(); FillToGrid(); }
private void btnEdit_Click(object sender, EventArgs e) { if ((lblID.Text == "") || (lblID.Text == "0")) { MessageBox.Show("Bạn hãy chọn phòng khám cần sửa!"); return; } frmClinicEdit.IdClinicEdit = int.Parse(lblID.Text); frmClinicEdit frmedit = new frmClinicEdit(); frmedit.ShowDialog(); FillToGrid(); }
private void grd_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } if (grd.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value == null) { IdClinic = 0; } else { IdClinic = int.Parse(grd.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value.ToString()); } lblID.Text = IdClinic.ToString(); frmClinicEdit.IdClinicEdit = IdClinic; frmClinicEdit frmEdit = new frmClinicEdit(); frmEdit.ShowDialog(); FillToGrid(); }
private void grd_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) return; if (grd.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value == null) { IdClinic = 0; } else { IdClinic = int.Parse(grd.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value.ToString()); } lblID.Text = IdClinic.ToString(); frmClinicEdit.IdClinicEdit = IdClinic; frmClinicEdit frmEdit = new frmClinicEdit(); frmEdit.ShowDialog(); FillToGrid(); }