コード例 #1
0
        private void menuNewDriver_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var manager = DriverManager.CreateNew();

            using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager))
            {
                if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                {
                    int index = gridViewDrivers.TopRowIndex;
                    btnSearch_Click(this, EventArgs.Empty);
                    gridViewDrivers.TopRowIndex = index;
                }
            }
        }
コード例 #2
0
        void gridViewDrivers_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            var row = gridViewDrivers.GetRow(e.RowHandle) as DriverModel;

            if (row == null)
            {
                return;
            }

            if (e.Clicks == 2)
            {
                if (this.Manager.IsFinder)
                {
                    this.Manager.ActiveDriver = row;
                    this.DialogResult         = System.Windows.Forms.DialogResult.Yes;
                    this.Close();
                }
                else
                {
                    var manager = DriverManager.CreateEdit(row.DriverID);
                    using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager))
                    {
                        form.ShowDialog();
                        RefreshDrivers();
                    }
                }
            }
            else if (e.Column.Name == col_Edit.Name)
            {
                var manager = DriverManager.CreateEdit(row.DriverID);
                using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager))
                {
                    form.ShowDialog();
                    RefreshDrivers();
                }
            }
        }
コード例 #3
0
 private void menuNewDriver_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     var manager = DriverManager.CreateNew();
     using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager))
     {
         if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
         {
             int index = gridViewDrivers.TopRowIndex;
             btnSearch_Click(this, EventArgs.Empty);
             gridViewDrivers.TopRowIndex = index;
         }
     }
 }
コード例 #4
0
        void gridViewDrivers_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            var row = gridViewDrivers.GetRow(e.RowHandle) as DriverModel;
            if (row == null)
                return;

            if (e.Clicks == 2)
            {
                if (this.Manager.IsFinder)
                {
                    this.Manager.ActiveDriver = row;
                    this.DialogResult = System.Windows.Forms.DialogResult.Yes;
                    this.Close();
                }
                else
                {
                    var manager = DriverManager.CreateEdit(row.DriverID);
                    using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager))
                    {
                        form.ShowDialog();
                        RefreshDrivers();
                    }
                }
            }
            else if (e.Column.Name == col_Edit.Name)
            {
                var manager = DriverManager.CreateEdit(row.DriverID);
                using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager))
                {
                    form.ShowDialog();
                    RefreshDrivers();
                }
            }
        }