コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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;
                }
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 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;
         }
     }
 }