Пример #1
0
        private void ReloadSingleQuoteLogEntity()
        {
            Cursor.Current = Cursors.WaitCursor;

            gridControl.FocusedView.CloseEditor();

            //  Get the specific entity that was modified
            foreach (var quote in _context.QuoteLog.Where(q => q.QuoteNumber == _quoteNumber))
            {
                // Reload the entity from the database
                _context.Entry(quote).Reload();
            }

            Cursor.Current = Cursors.Default;



            //gridControl.FocusedView.CloseEditor();
            //System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;


            ////_context.QuoteLog.Load();
            ////_context.QuoteLog.Local.ToBindingList();

            //var x = (from u in _context.QuoteLog
            //         //where u.QuoteNumber.StartsWith("52")
            //         select u).ToList();

            //gridControl.DataSource = null;
            //gridControl.DataSource = _context.QuoteLog.Local.ToBindingList();

            //BindLookupColumns();



            //// Modified quote
            ////  Create a list of the Entities (rows) in the Entity Set (table)
            //foreach (var quote in _context.QuoteLog.Where(q => q.QuoteNumber == "526-07"))
            //{
            //    // Reload the entity from the database
            //    _context.Entry(quote).Reload();
            //}

            // New quote
            //_context.QuoteLog.Load();



            //System.Windows.Forms.Cursor.Current = Cursors.Default;
        }
Пример #2
0
        public BindingList <QuoteCSM> RefreshNorthAmericanCsmData(string quoteNumber)
        {
            // Create a list of the Entities (rows) in the Entity Set (table)
            var csmList = _context.QuoteCSMs.Local.ToList();

            foreach (var csm in csmList)
            {
                // Records that no longer exist in the database will be removed from the current state
                _context.Entry(csm).Reload();
            }

            // Look up CSM Mnemonics for this quote and check them in the grid
            _context.QuoteCSMs.Where(o => o.QuoteNumber == _quoteNumber).Load();
            return(_context.QuoteCSMs.Local.ToBindingList());
        }