private void UpdateRecord() { try { if (MainGridView.FocusedRowHandle < 0) { MyLocalizer.XtraMessageBoxShow("Необходимо указать проверку.", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DataRowView drv = (DataRowView)(qMainChecksBindingSource.Current); long id = Convert.ToInt64(drv.Row["CheckID"]); this.ShowInTaskbar = false; CheckDataForm cf = new CheckDataForm(id, -1, -1, -1); DialogResult dr = cf.ShowDialog(this); this.ShowInTaskbar = true; //if (dr == System.Windows.Forms.DialogResult.OK) RefreshGridPos(id); } catch (Exception ex) { MyLocalizer.XtraMessageBoxShow(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAdd_Click(object sender, EventArgs e) { try { long id = -1; long subjectID = -1; long branchID = -1; long substationID = -1; if (cbSubject.EditValue != null) { subjectID = Convert.ToInt64(cbSubject.EditValue); } if (cbBranch.EditValue != null) { branchID = Convert.ToInt64(cbBranch.EditValue); } if (cbSubstation.EditValue != null) { substationID = Convert.ToInt64(cbSubstation.EditValue); } this.ShowInTaskbar = false; CheckDataForm cf = new CheckDataForm(id, subjectID, branchID, substationID); DialogResult dr = cf.ShowDialog(this); this.ShowInTaskbar = true; id = cf.m_CheckID; //if (dr == System.Windows.Forms.DialogResult.OK) RefreshGridPos(id); } catch (Exception ex) { MyLocalizer.XtraMessageBoxShow(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void InsertRecord() { //if (GridView.FocusedRowHandle < 0) return; long id = -1; CheckDataForm cf = new CheckDataForm(id, -1, -1, -1); DialogResult dr = cf.ShowDialog(this); id = cf.m_CheckID; RefreshGridPos(id); }
public void UpdateRecord() { if (GridView.FocusedRowHandle < 0) { return; } DataRowView drv = (DataRowView)(qChecksBindingSource.Current); long id = Convert.ToInt64(drv.Row["CheckID"]); CheckDataForm cf = new CheckDataForm(id, -1, -1, -1); DialogResult dr = cf.ShowDialog(this); RefreshGridPos(id); }