Esempio n. 1
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (BusTableBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BUSTABLE)BusTableBindingSource.Current);
                }
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BUSTABLE)BusTableBindingSource.Current);
                }
                e.Allow = false;
            }
        }
Esempio n. 2
0
 private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     if (!gridView2.PostEditor() || !gridView1.UpdateCurrentRow())
     {
         e.Allow = false;
     }
 }
Esempio n. 3
0
        private void gridViewUsers_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (!ignoreLeaveRow)
            {
                if (UsersBindingSource.Current == null)
                {
                    e.Allow = true;
                    return;
                }

                temp = newRec;
                bool temp2 = modified;
                if (checkForms(true))
                {
                    e.Allow = true;
                    if ((!temp) && temp2)
                    {
                        context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (ExtranetUser)UsersBindingSource.Current);
                    }

                    setReadOnly(true);
                }
                else
                {
                    if (!temp && !modified)
                    {
                        context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (ExtranetUser)UsersBindingSource.Current);
                    }

                    e.Allow = false;
                }
            }
        }
Esempio n. 4
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (HtlBrandBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            ((HTLBRAND)HtlBrandBindingSource.Current).ImagesRoot = imagesRoot;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (HTLBRAND)HtlBrandBindingSource.Current);
                }
                cODETextEdit.Properties.ReadOnly = true;
                GridViewHtlBrand.Columns.ColumnByName(colName).OptionsColumn.AllowEdit = false;
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (HTLBRAND)HtlBrandBindingSource.Current);
                }

                e.Allow = false;
            }
        }
Esempio n. 5
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (CarOffBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }

            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                errorProvider1.Clear();
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CAROFF)CarOffBindingSource.Current);
                }
                setReadOnly(true);
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CAROFF)CarOffBindingSource.Current);
                }

                e.Allow = false;
            }
        }
Esempio n. 6
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (SvcRestr2BindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR2)SvcRestr2BindingSource.Current);
                }
                //codeTextEdit.Properties.ReadOnly = true;
                //gridView1.Columns.ColumnByName(colName1).OptionsColumn.AllowEdit = false;
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR2)SvcRestr2BindingSource.Current);
                }

                e.Allow = false;
            }
        }
Esempio n. 7
0
 private void GridViewLookup_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     //If the user selects a row, edits, then selects the auto-filter row, then selects a different row,
     //this event will fire for the auto-filter row, so we cannot ignore it because there is still a record
     //that may need to be saved. 
     if (!_ignoreLeaveRow && IsModified(_selectedRecord)) {
         e.Allow = SaveRecord(true);
     }
 }
Esempio n. 8
0
        private void advBandedGridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            //if (DigHdrBindingSource.Current == null)
            //{
            //    e.Allow = true;
            //    return;
            //}

            //temp = newRec;
            //bool temp2 = modified;
            //if (checkForms())
            //{
            //    errorProvider1.Clear();
            //    e.Allow = true;  if (!temp && !modified)
            // context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);

            //    if ((!temp) && temp2)
            //        context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);


            //    agencySearch.ButtonEdit.Properties.ReadOnly = true;
            //    cOUP_RESTextEdit.Properties.ReadOnly = true;

            //}
            //else
            //    e.Allow = false;
            if (DigHdrBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);
                }
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);
                }

                e.Allow = false;
            }
        }
Esempio n. 9
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            ColumnView view    = gridView1;
            GridColumn column1 = view.Columns["Link_Table"];
            GridColumn column2 = view.Columns["Link_Column"];
            GridColumn column3 = view.Columns["Description"];

            string val1 = (string)view.GetFocusedRowCellValue(column1);
            string val2 = (string)view.GetFocusedRowCellValue(column2);
            string val3 = (string)view.GetFocusedRowCellValue(column3);

            if ((string.IsNullOrWhiteSpace(val1) || string.IsNullOrWhiteSpace(val2) || string.IsNullOrWhiteSpace(val3)) && newRec == true)
            {
                e.Allow = false;
                return;
            }

            if (BookSelBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }

            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BookSel)BookSelBindingSource.Current);
                }
            }
            else
            {
                if ((!temp) && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BookSel)BookSelBindingSource.Current);
                }

                e.Allow = false;
            }
        }
Esempio n. 10
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (contactNewRowRec == true)
            {
                MessageBox.Show("Please save or delete the new record being added in the grid on the Contacts tab before attempting to navigate to another record.");
                e.Allow = false;
                return;
            }

            if (OperatorBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }

            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                errorProvider1.Clear();
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (OPERATOR)OperatorBindingSource.Current);
                }

                setReadOnly(true);
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (OPERATOR)OperatorBindingSource.Current);
                }

                e.Allow = false;
            }
        }
Esempio n. 11
0
        private void advBandedGridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            ColumnView view    = advBandedGridView1;
            GridColumn column1 = view.Columns["CODE"];
            GridColumn column2 = view.Columns["ITIN"];


            string val1 = (string)view.GetFocusedRowCellValue(column1);
            string val2 = (string)view.GetFocusedRowCellValue(column2);

            if ((string.IsNullOrWhiteSpace(val1) || string.IsNullOrWhiteSpace(val2)) && newRec == true)
            {
                e.Allow = false;
                return;
            }

            if (CruItItemBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CRUITItem)CruItItemBindingSource.Current);
                }
            }
            else
            {
                e.Allow = false;
            }
        }
Esempio n. 12
0
 private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     gridView1.OptionsBehavior.Editable = false;
 }
Esempio n. 13
0
 private void GroupRowExpanding(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
 }