void InputHeader(Class.Enums.enumClsState tstate) { try { Guid g = Guid.Empty; switch (tstate) { case Class.Enums.enumClsState.New: g = Guid.NewGuid(); break; case Class.Enums.enumClsState.Update: if (dataGridHeader.SelectedCells.Count > 0) { g = (Guid)dataGridHeader.SelectedCells[0].OwningRow.Cells["HeaderRowID"].Value; } break; } if (g != null && g != Guid.Empty) { frmNotaBeliInput frmH = new frmNotaBeliInput(tstate, g); frmH.FormClosed += new FormClosedEventHandler(frmH_FormClosed); frmH.MdiParent = this.MdiParent; frmH.Show(); } } catch (Exception ex) { Error.LogError(ex); } }
void frmH_FormClosed(object sender, FormClosedEventArgs e) { try { frmNotaBeliInput f = (frmNotaBeliInput)sender; if (f.DialogResult == DialogResult.OK) { RefreshDataNotaBeli(); dataGridHeader.FindRow("HeaderRowID", f.RowID.ToString()); } } catch (Exception ex) { Error.LogError(ex); } }