Ejemplo n.º 1
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();
                }
            }
        }