private void btnAdd_Click(object sender, EventArgs e) { frmIngredientTypeDetail frmITD = new frmIngredientTypeDetail(); frmITD.setFunction(1); frmITD.ShowDialog(); if (frmITD.DialogResult == DialogResult.OK) { FillGridControl(); } }
private void btnEdit_Click(object sender, EventArgs e) { frmIngredientTypeDetail frmITD = new frmIngredientTypeDetail(); var rowHandle = gridView1.FocusedRowHandle; frmITD.setIngredientType(Convert.ToInt32(gridView1.GetRowCellValue(rowHandle, "IngredientTypeID").ToString())); frmITD.setFunction(2); frmITD.ShowDialog(); if (frmITD.DialogResult == DialogResult.OK) { FillGridControl(); } }