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(); }