Beispiel #1
0
        public List <FlatFileDetailModel> GetCatalogInfoData(int custAutoID, int quoteID, string strInsertionType)
        {
            List <FlatFileDetailModel> lstCatalogInfo = new List <FlatFileDetailModel>();
            int noofBooksCount = GetNoofBooksCountbyQuoteID(quoteID);
            IFileCreationService _fileCreationSrv = new FileCreationService();

            _fileCreationSrv.UserVM = UserVM;
            if (noofBooksCount > 0)
            {
                List <FlatFileDetailModel> lstCatalogInfoValues = _fileCreationSrv.FillCatalogInfovalues(noofBooksCount, custAutoID, strInsertionType, false, string.Empty, quoteID);
                //FlatFileDetailModel CatalogProtectorInfo = _fileCreationSrv.FillCatalogProtectorValues(noofBooksCount, custAutoID, strInsertionType);
                //FlatFileDetailModel catalogShelfReadyInfo = _fileCreationSrv.FillCatalogShelfReadyValues(noofBooksCount, custAutoID, strInsertionType);
                List <FlatFileDetailModel> lstCatalogSpecialInfovalues = _fileCreationSrv.FillCatalogSpecialChargeValues(noofBooksCount, custAutoID, strInsertionType);
                //if (CatalogProtectorInfo != null) lstCatalogInfo.Add(CatalogProtectorInfo);
                //if (catalogShelfReadyInfo != null) lstCatalogInfo.Add(catalogShelfReadyInfo);
                if (lstCatalogInfoValues != null && lstCatalogInfoValues.Count() > 0)
                {
                    lstCatalogInfo.AddRange(lstCatalogInfoValues);
                }
                if (lstCatalogSpecialInfovalues != null && lstCatalogSpecialInfovalues.Count() > 0)
                {
                    lstCatalogInfo.AddRange(lstCatalogSpecialInfovalues);
                }
            }
            return(lstCatalogInfo);
        }
Beispiel #2
0
        private void GenerateFlatFiles()
        {
            try
            {
                EmailService           mailService          = new EmailService();
                ActiveQuoteService     _activeQuote         = new ActiveQuoteService();
                List <CalTagViewModel> lstCalTagViewModel   = _activeQuote.GetQuoteByCTStatus();
                FileCreationService    _fileCreation        = new FileCreationService();
                List <string>          lstFilePathWithNames = new List <string>();

                if (lstCalTagViewModel.Count > 0)
                {
                    string filePath = _fileCreation.GenerateCTFlatFiles(lstCalTagViewModel);
                    if (!string.IsNullOrEmpty(filePath))
                    {
                        lstFilePathWithNames.Add(filePath);
                    }
                }
                if (lstFilePathWithNames.Count > 0)
                {
                    _activeQuote.ChangeCTStatus();
                    mailService.SendMail("CallTagInfo", "Please find the attached CallTag files", false, true, lstFilePathWithNames, null, ConfigurationManager.AppSettings["fromAddress"], ConfigurationManager.AppSettings["WareHouseEmail"]);
                }
            }
            catch (Exception ex)
            {
                Elmah.SqlErrorLog ErrorLog = new Elmah.SqlErrorLog(conn);
                ErrorLog.Log(new Elmah.Error(new Exception(ex.ToString())));
            }
        }