void gridViewCompanies_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { var row = gridViewCompanies.GetRow(e.RowHandle) as CompanyModel; if (row == null) { return; } if (e.Clicks == 2) { if (IsFinder) { this.CompanyID = row.CompanyID; this.DialogResult = System.Windows.Forms.DialogResult.Yes; this.Close(); } else { var manager = CompanyManager.CreateEdit(row.CompanyID); using (XF_CompanyNewEdit form = new XF_CompanyNewEdit(manager)) form.ShowDialog(); } } else if (e.Column.Name == col_Edit.Name) { var manager = CompanyManager.CreateEdit(row.CompanyID); using (XF_CompanyNewEdit form = new XF_CompanyNewEdit(manager)) form.ShowDialog(); } }
private void menuNewCompany_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var manager = CompanyManager.CreateNew(); using (XF_CompanyNewEdit form = new XF_CompanyNewEdit(manager)) { if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { int index = gridViewCompanies.TopRowIndex; btnSearch_Click(this, EventArgs.Empty); gridViewCompanies.TopRowIndex = index; } } }
void gridViewCompanies_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { var row = gridViewCompanies.GetRow(e.RowHandle) as CompanyModel; if (row == null) return; if (e.Clicks == 2) { if (IsFinder) { this.CompanyID = row.CompanyID; this.DialogResult = System.Windows.Forms.DialogResult.Yes; this.Close(); } else { var manager = CompanyManager.CreateEdit(row.CompanyID); using (XF_CompanyNewEdit form = new XF_CompanyNewEdit(manager)) form.ShowDialog(); } } else if (e.Column.Name == col_Edit.Name) { var manager = CompanyManager.CreateEdit(row.CompanyID); using (XF_CompanyNewEdit form = new XF_CompanyNewEdit(manager)) form.ShowDialog(); } }
private void menuNewCompany_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var manager = CompanyManager.CreateNew(); using (XF_CompanyNewEdit form = new XF_CompanyNewEdit(manager)) { if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { int index = gridViewCompanies.TopRowIndex; btnSearch_Click(this, EventArgs.Empty); gridViewCompanies.TopRowIndex = index; } } }