Example #1
0
        public void GetLtaTypes()
        {
            Error = "";
            var result = new ObjectParameter("Result", typeof(Int32));
            var tranDt = new ObjectParameter("TranDT", typeof(DateTime));

            LtasList.Clear();
            LtasList.Add("");
            try
            {
                using (var context = new QuoteLogContext())
                {
                    var collection = context.usp_QT_Customer_LtaTypes_Get();
                    foreach (var item in collection)
                    {
                        LtasList.Add(item.LtaType);
                    }

                    _view.cbxLtaType.DataSource = LtasList;
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null)
                    ? "Failed to return LTA types. " + ex.InnerException.Message
                    : "Failed to return LTA types. " + ex.Message;
            }
        }
Example #2
0
        public formQuoteMaintenance(string quoteNumber, DateTime?sop, DateTime?eop, int?rowId, QuoteTypes quoteType)
        {
            InitializeComponent();

            _context = new QuoteLogContext();

            _quoteType = quoteType;
            _sop       = sop;
            _eop       = eop;
            _rowID     = rowId;

            _quoteMaintenanceController = new QuoteMaintenanceController(quoteNumber, quoteType, this);

            if (_quoteType != QuoteTypes.ModifyExisting)
            {
                gbxLTA.Visible  = btnCSM.Visible = false;
                lblMessage.Text = "CSM and LTA sections will become available after saving.";
            }
            else
            {
                lblMessage.Text = "";
            }

            printDocStatus    = PrintDocStatus.NoActionTaken;
            cbxRepeat.Visible = false;
        }
Example #3
0
        public void GetCustomer()
        {
            Error = "";
            var result = new ObjectParameter("Result", typeof(Int32));
            var tranDt = new ObjectParameter("TranDT", typeof(DateTime));

            try
            {
                using (var context = new QuoteLogContext())
                {
                    var collection = context.usp_QT_Customer_Get(_view.cbxCode.Text);
                    foreach (var item in collection)
                    {
                        _view.tbxName.Text       = item.CustomerName;
                        _view.tbxAddress1.Text   = item.Address1;
                        _view.tbxAddress2.Text   = item.Address2;
                        _view.tbxAddress3.Text   = item.Address3;
                        _view.tbxCity.Text       = item.City;
                        _view.cbxState.Text      = item.State;
                        _view.tbxCountry.Text    = item.Country;
                        _view.tbxPostalCode.Text = item.PostalCode;
                        _view.cbxTerms.Text      = item.Terms;
                        _view.cbxLtaType.Text    = item.LtaType;
                    }
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Example #4
0
        public FileController(string quoteNumber)
        {
            _quoteNumber = quoteNumber;
            _context     = new QuoteLogContext();

            _context.QuoteLog.Where(q => q.QuoteNumber == _quoteNumber).Load();
        }
Example #5
0
        public QuoteMaintenanceController(string quoteNumber, QuoteTypes QuoteType, formQuoteMaintenance frmQuoteMaintenance)
        {
            string errorMessage;
            string errorMethod;

            _theView     = frmQuoteMaintenance;
            _quoteNumber = quoteNumber;
            _quoteType   = QuoteType;

            _context = new QuoteLogContext();
            _nqn     = new DataLayerNewQuoteNumber();
            _empireMarketDataLayer = new DataLayerEmpireMarket();

            // Get quote header data, get a new quote number and reset the _quoteNumber variable if necessary
            GetQuoteHeaderData(out errorMessage, out errorMethod);
            if (errorMessage != "")
            {
                ShowError(errorMessage, errorMethod);
                return;
            }

            // Bind all the LookupEdit columns in the grid
            LoadLookupColumns();
            BindDataSources();


            // Quote LTA data
            if (_quoteType == QuoteTypes.ModifyExisting)
            {
                // Existing quote, so update LTA data for it
                _ltaController         = new LTAController(_quoteNumber, false);
                _theView.LtaDataSource = _ltaController.GetLtaData(out errorMessage);
                if (errorMessage != "")
                {
                    ShowError(errorMessage, "GetLtaData()");
                    return;
                }
            }
            else
            {
                // New quote, so bypass LTA functions until the quote is saved
                _ltaController = new LTAController(_quoteNumber, true);
            }


            // Quote Print document and Customer Quote document
            _fileController = new FileController(_quoteNumber);
            if (_quoteType == QuoteTypes.ModifyExisting)
            {
                _theView.QuotePrintFile    = _fileController.GetQuotePrint();
                _theView.QuotePrintNo      = _fileController.GetPrintNo();
                _theView.QuotePrintDate    = _fileController.GetPrintDate();
                _theView.CustomerQuoteFile = _fileController.GetCustomerQuote();
            }
            else
            {
                _theView.ExistsQuotePrint = _theView.ExistsCustomerQuote = false;
            }
        }
Example #6
0
        public SimpleQuoteLogView()
        {
            InitializeComponent();
            InitGrid();

            _context = new QuoteLogContext();

            btnRefresh.Visible = false;
        }
Example #7
0
        public LTAController(string quoteNumber, bool isNewQuoteNumber)
        {
            _quoteNumber = quoteNumber;

            _ltaContext = new QuoteLogContext();

            //if (!isNewQuoteNumber)
            //{
            //    string errorMessage = "";
            //    UpdateLtas(out errorMessage);
            //    SaveLtaData(out errorMessage);
            //}
        }
Example #8
0
        public void SendEmail()
        {
            var result = new ObjectParameter("Result", typeof(Int32));
            var tranDt = new ObjectParameter("TranDT", typeof(DateTime));

            try
            {
                using (var context = new QuoteLogContext())
                {
                    context.usp_QT_Customer_Request_SendEmail(CustomerCode, tranDt, result);
                }
            }
            catch (Exception)
            {
            }
        }
Example #9
0
        public BindingList <QuoteLTA> GetLtaData(out string errorMessage)
        {
            errorMessage = "";
            try
            {
                if (_ltaContext != null)
                {
                    _ltaContext.Dispose();
                }

                _ltaContext = new QuoteLogContext();
                var bindingList = DbExtensions.ToBindingList <QuoteLTA>(new ObservableCollection <QuoteLTA>(_ltaContext.QuoteLTAs.Where(q => q.QuoteNumber == _quoteNumber)));

                return(bindingList);
            }
            catch (Exception ex)
            {
                errorMessage = "Failed to retrieve LTA grid data.";
            }
            return(null);
        }
Example #10
0
        public void UpdateCustomer()
        {
            Error = "";
            var result = new ObjectParameter("Result", typeof(Int32));
            var tranDt = new ObjectParameter("TranDT", typeof(DateTime));

            try
            {
                using (var context = new QuoteLogContext())
                {
                    context.usp_QT_Customer_Update(OperatorCode, CustomerCode, CustomerName, Address1, Address2, Address3, City, State, Country, PostalCode, Terms, LtaType,
                                                   tranDt, result);
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null)
                    ? "Failed to update the customer. " + ex.InnerException.Message
                    : "Failed to update the customer. " + ex.Message;
            }
        }
Example #11
0
        public formQuoteMaintenance(string quoteNumber, DateTime?sop, DateTime?eop, int?rowId, QuoteTypes quoteType, string customer,
                                    string customerRfqNumber, string customerPartNumber, string eeiPartNumber, string notes, string oem, string applicationCode,
                                    string applicationName, string functionName, string eau, string program, string nameplate, string programManagerInitials,
                                    string engineeringInitials, string salesInitials, string engineeringMaterialsInitials, string quoteReviewInitials,
                                    string quotePricingInitials, string customerQuoteInitials, string modelYear, string packageNumber, string quoteReason,
                                    string productLine, string printFilePath, string customerQuoteFilePath, string marketSegment, string marketSubsegment,
                                    string minimumOrderQuantity, string awarded, string awardedDate, string straightMaterialCost, string stdHours,
                                    string tooling, string quotePrice, string prototypePrice)
        {
            InitializeComponent();

            _context = new QuoteLogContext();

            _quoteType                    = quoteType;
            _sop                          = sop;
            _eop                          = eop;
            _customer                     = customer;
            _customerRfqNumber            = customerRfqNumber;
            _customerPartNumber           = customerPartNumber;
            _eeiPartNumber                = eeiPartNumber;
            _notes                        = notes;
            _oem                          = oem;
            _applicationCode              = applicationCode;
            _applicationName              = applicationName;
            _functionName                 = functionName;
            _eau                          = eau;
            _program                      = program;
            _nameplate                    = nameplate;
            _programManagerInitials       = programManagerInitials;
            _engineeringInitials          = engineeringInitials;
            _salesInitials                = salesInitials;
            _engineeringMaterialsInitials = engineeringMaterialsInitials;
            _quoteReviewInitials          = quoteReviewInitials;
            _quotePricingInitials         = quotePricingInitials;
            _customerQuoteInitials        = customerQuoteInitials;
            _modelYear                    = modelYear;
            _packageNumber                = packageNumber;
            _quoteReason                  = quoteReason;
            _productLine                  = productLine;
            _printFilePath                = printFilePath;
            _customerQuoteFilePath        = customerQuoteFilePath;
            _marketSegment                = marketSegment;
            _marketSubsegment             = marketSubsegment;
            _awarded                      = awarded;
            _awardedDate                  = awardedDate;
            _straightMaterialCost         = straightMaterialCost;
            _stdHours                     = stdHours;
            _tooling                      = tooling;
            _quotePrice                   = quotePrice;
            _prototypePrice               = prototypePrice;
            _minimumOrderQuantity         = minimumOrderQuantity;
            _rowID                        = rowId;

            _quoteMaintenanceController = new QuoteMaintenanceController(quoteNumber, quoteType, this);

            if (_quoteType != QuoteTypes.ModifyExisting)
            {
                gridControl3.Enabled = btnCSM.Visible = false;
                lblMessage.Text      = "CSM and LTA sections will become available after saving.";
            }
            else
            {
                lblMessage.Text = "";
            }

            printDocStatus    = PrintDocStatus.NoActionTaken;
            cbxRepeat.Visible = false;

            // File Management
            ShowQuotePrintFileInfo();
            ShowCustomerQuoteFileInfo();
        }
Example #12
0
        public formLightingData()
        {
            InitializeComponent();

            _context = new QuoteLogContext();
        }
Example #13
0
 public CSMController(string quoteNumber)
 {
     _context     = new QuoteLogContext();
     _quoteNumber = quoteNumber;
 }
Example #14
0
 public DataLayerNewQuoteNumber()
 {
     _context = new QuoteLogContext();
 }
Example #15
0
 public DataLayerEmpireMarket()
 {
     _context = new QuoteLogContext();
 }