public DTO.ReportData GetReportData(string season, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportData data = new DTO.ReportData(); data.FactorySales = new List <DTO.FactorySale>(); data.Season = season; //try to get data try { using (MIFactorySaleRptEntities context = CreateContext()) { data.FactorySales = converter.DB2DTO_FactorySale(context.MIFactorySaleRpt_function_getFactorySale(season).ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; notification.DetailMessage.Add(ex.Message); if (ex.GetBaseException() != null) { notification.DetailMessage.Add(ex.GetBaseException().Message); } } return(data); }
public DTO.ReportData GetHtmlReportData(string season, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportData data = new DTO.ReportData(); data.CheckLists = new List <DTO.CheckList>(); //try to get data try { using (ClientConditionRptEntities context = CreateContext()) { data.CheckLists = converter.DB2DTO_CheckList(context.ClientConditionRpt_CheckListHtml_View.Where(o => o.Season == season).ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public DTO.ReportData GetReportData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportData data = new DTO.ReportData(); data.MissingShippingInfos = new List <DTO.MissingShippingInfo>(); //try to get data try { using (MissingShippingInfoRptEntities context = CreateContext()) { data.MissingShippingInfos = converter.DB2DTO_MissingShippingInfoList(context.MissingShippingInfoRpt_MissingShippingInfo_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public DTO.ReportData GetHtmlReportData(string season, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportData data = new DTO.ReportData(); data.CommercialInvoices = new List <DTO.CommercialInvoice>(); data.ExchangeRate = 0; //try to get data try { using (CommercialInvoiceOverviewRptEntities context = CreateContext()) { data.CommercialInvoices = converter.DB2DTO_CommercialInvoiceList(context.CommercialInvoiceOverviewRpt_CommercialInvoice_View.Where(o => o.Season == season).ToList()); data.ExchangeRate = Convert.ToDecimal(supportFactory.GetSettingValue(season, "ExRate-EUR-USD"), new System.Globalization.CultureInfo("en-US")); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public DTO.ReportData GetReportData(string season, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportData data = new DTO.ReportData(); try { using (MISaleByItemRptEntities context = CreateContext()) { data.Top20ByCategories = converter.DB2DTO_Top20ByCategoryList(context.MISaleByItemRpt_Top20ByCategory_View.Where(o => o.Season == season).ToList()); data.Top30s = converter.DB2DTO_Top30List(context.MISaleByItemRpt_Top30_View.Where(o => o.Season == season).OrderByDescending(o => o.EURAmount).Take(30).ToList()); data.ItemByClients = converter.DB2DTO_ItemByClient(context.MISaleByItemRpt_ItemByClient_View.Where(o => o.Season == season).ToList()); data.CommercialInvoiceByCategories = converter.DB2DTO_CommercialInvoiceByCategories(context.MISaleByItemRpt_CommercialInvoiceByCategories_View.Where(o => o.Season == season).ToList()); data.ExchangeRate = Convert.ToDecimal(supportFactory.GetSettingValue(season, "ExRate-EUR-USD"), new System.Globalization.CultureInfo("en-US")); data.USDContainerValue = Convert.ToDecimal(supportFactory.GetSettingValue(season, "EstUSDContValue")); data.EURContainerValue = Convert.ToDecimal(supportFactory.GetSettingValue(season, "EstEURContValue")); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.HandleExceptionSingleLine(ex); } return(data); }
public DTO.ReportData GetReportData(string season, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportData data = new DTO.ReportData(); string prevSeason = Library.Helper.GetPreviousSeason(season); try { using (MISaleByClientRptEntities context = CreateContext()) { //data.ProformaInvoiceConfirmeds = converter.DB2DTO_ProformaInvoiceConfirmed(context.MISaleByClientRpt_function_getProformaInvoiceConfirmed(season).ToList()); //data.ProformaInvoices = converter.DB2DTO_ProformaInvoice(context.MISaleByClientRpt_function_getProformaInvoice(season).ToList()); //data.Expectations = converter.DB2DTO_Expectation(context.MISaleByClientRpt_function_getExpectation(season).ToList()); //data.EurofarCommercialInvoices = converter.DB2DTO_EurofarCommercialInvoice(context.MISaleByClientRpt_function_getEurofarCommercialInvoice(season).ToList()); //proforma lost/new clients current season data.ProformaInvoiceOfLostedClients = converter.DB2DTO_ProformaInvoice_LostedClient(context.MISaleByClientRpt_function_getProformaInvoiceOfLostedClient(season).ToList()); data.ProformaInvoiceOfNewClients = converter.DB2DTO_ProformaInvoice_NewClient(context.MISaleByClientRpt_function_getProformaInvoiceOfNewClient(season).ToList()); //commercial invoice lost/new clients current season data.EurofarCommercialInvoiceOfNewClientThisSeason = converter.DB2DTO_EurofarCommercialInvoice_NewClient(context.MISaleByClientRpt_function_getEurofarCommercialInvoiceOfNewClient(season).ToList()); data.EurofarCommercialInvoiceOfLostedClientThisSeason = converter.DB2DTO_EurofarCommercialInvoice_LostedClient(context.MISaleByClientRpt_function_getEurofarCommercialInvoiceOfLostedClient(season).ToList()); //commercial invoice lost/new clients last season data.EurofarCommercialInvoiceOfNewClientLastSeason = converter.DB2DTO_EurofarCommercialInvoice_NewClient(context.MISaleByClientRpt_function_getEurofarCommercialInvoiceOfNewClient(prevSeason).ToList()); data.EurofarCommercialInvoiceOfLostedClientLastSeason = converter.DB2DTO_EurofarCommercialInvoice_LostedClient(context.MISaleByClientRpt_function_getEurofarCommercialInvoiceOfLostedClient(prevSeason).ToList()); //param value data.ExchangeRate = Convert.ToDecimal(supportFactory.GetSettingValue(season, "ExRate-EUR-USD"), new System.Globalization.CultureInfo("en-US")); data.USDContainerValue = Convert.ToDecimal(supportFactory.GetSettingValue(season, "EstUSDContValue")); data.EURContainerValue = Convert.ToDecimal(supportFactory.GetSettingValue(season, "EstEURContValue")); //Do not need anymore (Iron Request) //data.ConfirmedDetails = converter.DB2DTO_ConfirmedDetailList(context.MISaleByClientRpt_function_getConfirmedDetail(season).ToList()); //data.ConfirmedSummaries = converter.DB2DTO_ConfirmedSummaryList(context.MISaleByClientRpt_function_getConfirmedSummary(season).ToList()); //data.Details = converter.DB2DTO_DetailList(context.MISaleByClientRpt_function_getDetail(season).ToList()); //data.Summaries = converter.DB2DTO_SummaryList(context.MISaleByClientRpt_function_getSummary(season).ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.HandleExceptionSingleLine(ex); } return(data); }
public DTO.ReportData GetReportData_ForDeltaOverview(string season, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportData data = new DTO.ReportData(); try { using (MISaleByItemRptEntities context = CreateContext()) { data.CommercialInvoiceByCategories = converter.DB2DTO_CommercialInvoiceByCategories(context.MISaleByItemRpt_CommercialInvoiceByCategories_View.Where(o => o.Season == season).ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.HandleExceptionSingleLine(ex); } return(data); }