private void btnInsert_Click(object sender, EventArgs e) { frmFigureEdit frmedit = new frmFigureEdit(); frmFigureEdit.IdFigureEdit = 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ác đồ cần sửa!"); return; } frmFigureEdit.IdFigureEdit = int.Parse(lblID.Text); frmFigureEdit frmedit = new frmFigureEdit(); 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) { IdFigure = 0; } else { IdFigure = int.Parse(grd.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value.ToString()); } lblID.Text = IdFigure.ToString(); frmFigureEdit.IdFigureEdit = IdFigure; frmFigureEdit frmEdit = new frmFigureEdit(); 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) { IdFigure = 0; } else { IdFigure = int.Parse(grd.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value.ToString()); } lblID.Text = IdFigure.ToString(); frmFigureEdit.IdFigureEdit = IdFigure; frmFigureEdit frmEdit = new frmFigureEdit(); frmEdit.ShowDialog(); FillToGrid(); }