Пример #1
0
        public void GetQuoteFile(string quote, string attachmentCategory, out string fileName, out byte[] fileContents)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            fileName     = "";
            fileContents = null;

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    var collection = context.usp_QT_FileManagement_Get(quote, attachmentCategory, tranDT, result);
                    var item       = collection.ToList().First();
                    fileName     = item.FileName;
                    fileContents = item.FileContents;
                }
            }
            catch (Exception ex)
            {
                string err = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #2
0
 public List <usp_QL_GetQuoteTransfers_Result> GetQuoteTransfers()
 {
     using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
     {
         return(context.usp_QL_GetQuoteTransfers().ToList());
     }
 }
        public void GetSpecialReqNotes()
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            string quote = (System.Web.HttpContext.Current.Session["Quote"] != null)
                ? quote = System.Web.HttpContext.Current.Session["Quote"].ToString()
                : "";

            NotesList = new List <QtSpecialReqNotesDataModel>();
            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    var collection = context.usp_QL_QuoteTransfer_GetSpecialReqNotes(quote, tranDT, result);
                    foreach (var item in collection)
                    {
                        var dataModel = new QtSpecialReqNotesDataModel {
                            RowID       = item.RowID,
                            Description = item.Description,
                            Answer      = item.Answer,
                            Notes       = item.Notes
                        };

                        NotesList.Add(dataModel);
                    }
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #4
0
        public void CustomerContactsUpdate(usp_QL_QuoteTransfer_GetCustomerContacts_Result u)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
            {
                context.usp_QL_QuoteTransfer_CustomerContacts_Update(OperatorCode, u.RowID, u.FirstName, u.LastName, u.PhoneNumber, u.FaxNumber, u.EmailAddress, tranDT, result);
            }
        }
Пример #5
0
        public void ToolingBreakdownDelete(usp_QL_QuoteTransfer_GetToolingBreakdown_Result u)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
            {
                context.usp_QL_QuoteTransfer_ToolingBreakdown_Delete(OperatorCode, u.RowID, tranDT, result);
            }
        }
Пример #6
0
        public void ToolingBreakdownInsert(usp_QL_QuoteTransfer_GetToolingBreakdown_Result u)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            string quote = (System.Web.HttpContext.Current.Session["Quote"] != null)
                ? quote = System.Web.HttpContext.Current.Session["Quote"].ToString()
                : "";

            using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
            {
                context.usp_QL_QuoteTransfer_ToolingBreakdown_Insert(OperatorCode, quote, u.Description, u.Quantity, u.Value, tranDT, result);
            }
        }
Пример #7
0
        public void GetQuote(string quote)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    var collection = context.usp_QL_QuoteTransfer_GetQuote(quote, tranDT, result);
                    foreach (var item in collection)
                    {
                        QuoteNumber          = item.QuoteNumber;
                        QtDate               = item.Date.ToString("yyyy-MM-dd");
                        Customer             = item.Customer;
                        EmpirePartNumber     = item.EmpirePartNumber;
                        CustomerPartNumber   = item.CustomerPartNumber;
                        Program              = item.Program;
                        Application          = item.Application;
                        FinancialEau         = (item.FinancialEau.HasValue) ? item.FinancialEau.Value.ToString("N0") : "";
                        CapactiyEau          = (item.CapacityEau.HasValue) ? item.CapacityEau.Value.ToString("N0") : "";
                        Salesman             = item.Salesman;
                        QuoteEngineer        = item.QuoteEngineer;
                        ProgramManager       = item.ProgramManager;
                        SalePrice            = (item.SalesPrice.HasValue) ? item.SalesPrice.Value.ToString("C2") : "";
                        LtaYear1             = (item.LtaYear1 != 0) ? item.LtaYear1.Value.ToString("C2") : "";
                        LtaYear2             = (item.LtaYear2 != 0) ? item.LtaYear2.Value.ToString("C2") : "";
                        LtaYear3             = (item.LtaYear3 != 0) ? item.LtaYear3.Value.ToString("C2") : "";
                        LtaYear4             = (item.LtaYear4 != 0) ? item.LtaYear4.Value.ToString("C2") : "";
                        PrototypePrice       = (item.PrototypePrice.HasValue) ? item.PrototypePrice.Value.ToString("N2") : "";
                        MinimumOrderQuantity = (item.MinimumOrderQuantity.HasValue) ? item.MinimumOrderQuantity.ToString() : "";
                        Material             = (item.Material.HasValue) ? item.Material.Value.ToString("C2") : "";
                        Labor   = (item.Labor.HasValue) ? item.Labor.Value.ToString("C2") : "";
                        Tooling = (item.Tooling.HasValue) ? item.Tooling.Value.ToString("C2") : "";
                        Sop     = (item.SOP.HasValue) ? item.SOP.Value.ToString("yyyy-MM-dd") : "";
                        Eop     = (item.EOP.HasValue) ? item.EOP.Value.ToString("yyyy-MM-dd") : "";
                        QuoteTransferComplete = item.QuoteTransferComplete;
                    }
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #8
0
        public void QuoteTransferCompleteUpdateSendEmail(string quote, string complete, DateTime?completedDate)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";
            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    context.usp_QL_QuoteTransfer_Complete_UpdateSendEmail(OperatorCode, quote, complete, completedDate, tranDT, result);
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #9
0
        public void DeleteQuoteFile(string quote, string attachmentCategory)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    context.usp_QT_FileManagement_Delete(quote, attachmentCategory, tranDT, result);
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #10
0
        public void SignOffUpdate(int rowId, string employeeCode, string initials, DateTime?signOffDate)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    context.usp_QL_QuoteTransfer_SignOff_Update(OperatorCode, rowId, employeeCode, initials, signOffDate, tranDT, result);
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #11
0
        public void SaveDocumentationAnswers(string quote, string description, string answer)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    var collection = context.usp_QL_QuoteTransfer_Documentation_Insert(OperatorCode, quote, description, answer, tranDT, result);
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #12
0
        public void NewQuoteTransfer(string quote)
        {
            ObjectParameter tranDT   = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result   = new ObjectParameter("Result", typeof(Int32?));
            ObjectParameter debugMsg = new ObjectParameter("DebugMsg", typeof(string));

            Error = "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    context.usp_QL_NewQuoteTransfer(OperatorCode, quote, tranDT, result, 0, debugMsg);
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #13
0
        public List <usp_QL_QuoteTransfer_GetCustomerContacts_Result> GetCustomerContacts(string quote)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            var contactList = new List <usp_QL_QuoteTransfer_GetCustomerContacts_Result>();

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    contactList = context.usp_QL_QuoteTransfer_GetCustomerContacts(quote, tranDT, result).ToList();
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
            return(contactList);
        }
Пример #14
0
        //public void GetSignOffInitialsQuoteEngineer()
        //{
        //    ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
        //    ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));
        //    Error = "";

        //    QuoteEngineerList = new List<String>();
        //    QuoteEngineerList.Add("");
        //    try
        //    {
        //        using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
        //        {
        //            var collection = context.usp_QL_QuoteTransfer_GetSignOffInitials("QuoteEngineer", tranDT, result);
        //            foreach (var item in collection) QuoteEngineerList.Add(item.Initials);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
        //    }
        //}

        //public void GetSignOffInitialsMaterialRep()
        //{
        //    ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
        //    ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));
        //    Error = "";

        //    MaterialRepList = new List<String>();
        //    MaterialRepList.Add("");
        //    try
        //    {
        //        using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
        //        {
        //            var collection = context.usp_QL_QuoteTransfer_GetSignOffInitials("MaterialRep", tranDT, result);
        //            foreach (var item in collection) MaterialRepList.Add(item.Initials);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
        //    }
        //}

        //public void GetSignOffInitialsProductEngineer()
        //{
        //    ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
        //    ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));
        //    Error = "";

        //    ProductEngineerList = new List<String>();
        //    ProductEngineerList.Add("");
        //    try
        //    {
        //        using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
        //        {
        //            var collection = context.usp_QL_QuoteTransfer_GetSignOffInitials("ProductEngineer", tranDT, result);
        //            foreach (var item in collection) ProductEngineerList.Add(item.Initials);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
        //    }
        //}

        //public void GetSignOffInitialsProgramManager()
        //{
        //    ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
        //    ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));
        //    Error = "";

        //    ProgramManagerList = new List<String>();
        //    ProgramManagerList.Add("");
        //    try
        //    {
        //        using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
        //        {
        //            var collection = context.usp_QL_QuoteTransfer_GetSignOffInitials("ProgramManager", tranDT, result);
        //            foreach (var item in collection) ProgramManagerList.Add(item.Initials);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
        //    }
        //}

        public void GetSignedOffEmployees()
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            string quote = (System.Web.HttpContext.Current.Session["Quote"] != null)
                ? quote = System.Web.HttpContext.Current.Session["Quote"].ToString()
                : "";

            SignOffList = new List <QtSignOffDataModel>();
            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    var collection = context.usp_QL_QuoteTransfer_GetSignOff(quote, tranDT, result);
                    foreach (var item in collection)
                    {
                        var dataModel = new QtSignOffDataModel
                        {
                            RowID        = item.RowID,
                            Title        = item.Title,
                            SignOffDate  = item.SignOffDate,
                            EmployeeCode = item.EmployeeCode,
                            EmployeeName = item.EmployeeName,
                            Initials     = item.Initials
                        };

                        SignOffList.Add(dataModel);
                    }
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #15
0
        public void ShowQuoteFileInfo(string quote, string attachmentCategory)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = QuoteFileName = "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    var collection = context.usp_QT_FileManagement_Get(quote, attachmentCategory, tranDT, result).ToList();
                    foreach (var item in collection)
                    {
                        QuoteFileName = item.FileName;
                    }
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #16
0
        public void SpecialReqNotesUpdate(int rowId, string answer, string notes)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            string quote = (System.Web.HttpContext.Current.Session["Quote"] != null)
                ? quote = System.Web.HttpContext.Current.Session["Quote"].ToString()
                : "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    context.usp_QL_QuoteTransfer_SpecialReqNotes_Update(OperatorCode, rowId, answer, notes, tranDT, result);
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }
Пример #17
0
        public void GetDocumentationAnswers(string quote)
        {
            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            Error = "";

            try
            {
                using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer())
                {
                    var collection = context.usp_QL_QuoteTransfer_GetDocumentation(quote, tranDT, result).ToList();
                    foreach (var item in collection)
                    {
                        DocDescription = item.Description;
                        DocAnswer      = item.Answer;
                    }
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
            }
        }