public DTO.BookingMng.SearchFilterData GetSearchFilter(out Library.DTO.Notification notification) { DTO.BookingMng.SearchFilterData data = new DTO.BookingMng.SearchFilterData(); notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; data.Seasons = new List <DTO.Support.Season>(); try { data.Seasons = supportFactory.GetSeason().ToList(); } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message)) { notification.DetailMessage.Add(ex.InnerException.Message); } } return(data); }
public override DTO.CushionMng.EditFormData GetData(int id, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.CushionMng.EditFormData data = new DTO.CushionMng.EditFormData(); data.Data = new DTO.CushionMng.Cushion(); data.Seasons = new List <DTO.Support.Season>(); //try to get data try { using (CushionMngEntities context = CreateContext()) { data.Data = converter.DB2DTO_Cushion(context.CushionMng_Cushion_View.FirstOrDefault(o => o.CushionID == id)); data.Seasons = supportFactory.GetSeason().ToList(); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public override DTO.CushionColorMng.EditFormData GetData(int id, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.CushionColorMng.EditFormData data = new DTO.CushionColorMng.EditFormData(); data.Data = new DTO.CushionColorMng.CushionColor(); data.Data.CushionColorProductGroups = new List <DTO.CushionColorMng.CushionColorProductGroup>(); data.Data.CushionColorTestReports = new List <DTO.CushionColorMng.CushionColorTestReport>(); data.Seasons = new List <DTO.Support.Season>(); data.CushionTypes = new List <DTO.Support.CushionType>(); data.Data.CushionTestingDTOs = new List <DTO.CushionColorMng.CushionTestingDTO>(); //try to get data try { using (CushionColorMngEntities context = CreateContext()) { if (id == 0) { data.Data.ImageFile_DisplayUrl = FrameworkSetting.Setting.ThumbnailUrl + "no-image.jpg"; int index = -1; foreach (DTO.Support.ProductGroup dtoGroup in supportFactory.GetProductGroup()) { data.Data.CushionColorProductGroups.Add(new DTO.CushionColorMng.CushionColorProductGroup() { CushionColorProductGroupID = index, ProductGroupID = dtoGroup.ProductGroupID, ProductGroupNM = dtoGroup.ProductGroupNM, IsEnabled = false }); index--; } } else { data.Data = converter.DB2DTO_CushionColor(context.CushionColorMng_CushionColor_View.Include("CushionColorMng_CushionColorProductGroup_View").FirstOrDefault(o => o.CushionColorID == id)); } data.Seasons = supportFactory.GetSeason().ToList(); data.CushionTypes = supportFactory.GetCushionType().ToList(); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public DTO.DocumentMonitoringMng.SearchSupportList GetSearchSupportData() { DAL.Support.DataFactory factory = new Support.DataFactory(); DTO.DocumentMonitoringMng.SearchSupportList dtoSupport = new DTO.DocumentMonitoringMng.SearchSupportList(); dtoSupport.Seasons = factory.GetSeason().ToList(); return(dtoSupport); }
public DTO.ReportSalePerCountry.SupportDataContainer GetSupportData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DAL.Support.DataFactory factory = new Support.DataFactory(); //try to get data try { DTO.ReportSalePerCountry.SupportDataContainer dtoItem = new DTO.ReportSalePerCountry.SupportDataContainer(); dtoItem.Seasons = factory.GetSeason().ToList(); dtoItem.Salers = factory.GetSaler().ToList(); return(dtoItem); } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message)) { notification.DetailMessage.Add(ex.InnerException.Message); } return(new DTO.ReportSalePerCountry.SupportDataContainer()); } }
public DTO.ClientPaymentMng.SearchSupportList GetSearchSupportData() { DAL.Support.DataFactory factory = new Support.DataFactory(); DTO.ClientPaymentMng.SearchSupportList dtoSupport = new DTO.ClientPaymentMng.SearchSupportList(); dtoSupport.Seasons = factory.GetSeason().ToList(); dtoSupport.Salers = factory.GetSaler().ToList(); return(dtoSupport); }
public DTO.BackSaleOrderMng.SearchFilterData GetSearchFilter() { DTO.BackSaleOrderMng.SearchFilterData filterData = new DTO.BackSaleOrderMng.SearchFilterData(); Support.DataFactory support_factory = new Support.DataFactory(); filterData.Seasons = support_factory.GetSeason().ToList(); filterData.Salers = support_factory.GetSaler().ToList(); return(filterData); }
public DTO.WarehouseTransportMng.EditSupportList GetEditSupportData() { DAL.Support.DataFactory factory = new Support.DataFactory(); DTO.WarehouseTransportMng.EditSupportList dtoSupport = new DTO.WarehouseTransportMng.EditSupportList(); dtoSupport.Users = factory.GetUser().ToList(); dtoSupport.FromWarehouseAreas = GetPhysicalStockByWarehouseArea(); dtoSupport.ToWarehouseAreas = factory.GetAllWarehouseArea().ToList(); dtoSupport.Seasons = factory.GetSeason().ToList(); return(dtoSupport); }
public DTO.FactoryProformaInvoiceMng.SearchFilterData GetFilterData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.FactoryProformaInvoiceMng.SearchFilterData data = new DTO.FactoryProformaInvoiceMng.SearchFilterData(); data.Seasons = new List <DTO.Support.Season>(); try { data.Seasons = supportFactory.GetSeason().ToList(); } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public override DTO.ShowroomReceiptMng.EditFormData GetData(int id, out Library.DTO.Notification notification) { DTO.ShowroomReceiptMng.EditFormData editFormData = new DTO.ShowroomReceiptMng.EditFormData(); notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; try { using (ShowroomReceiptMngEntities context = CreateContext()) { if (id > 0) { ShowroomReceiptMng_ShowroomReceipt_View dbItem; dbItem = context.ShowroomReceiptMng_ShowroomReceipt_View .Include("ShowroomReceiptMng_ShowroomReceiptDetail_View") .FirstOrDefault(o => o.ShowroomReceiptID == id); editFormData.Data = converter.DB2DTO_ShowroomReceipt(dbItem); } else { editFormData.Data = new DTO.ShowroomReceiptMng.ShowroomReceipt(); editFormData.Data.ShowroomReceiptDetails = new List <DTO.ShowroomReceiptMng.ShowroomReceiptDetail>(); editFormData.Data.Season = DALBase.Helper.GetCurrentSeason(); editFormData.Data.ReceiptDate = DateTime.Now.ToString("dd/MM/yyyy");; } //get support list DAL.Support.DataFactory support_factory = new Support.DataFactory(); editFormData.Users = support_factory.GetUser().ToList(); editFormData.Showrooms = support_factory.GetShowroom(); editFormData.Seasons = support_factory.GetSeason().ToList(); return(editFormData); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message)) { notification.DetailMessage.Add(ex.InnerException.Message); } return(editFormData); } }
public override DTO.BackSaleOrderMng.EditFormData GetData(int id, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success, Message = "Get success" }; try { using (BackSaleOrderMngEntities context = CreateContext()) { DTO.BackSaleOrderMng.EditFormData data = new DTO.BackSaleOrderMng.EditFormData(); if (id > 0) { data.Data = converter.DB2DTO_BackOrder(context.BackSaleOrderMng_BackOrder_View.Include("BackSaleOrderMng_BackOrderDetail_View").Where(o => o.BackOrderID == id).FirstOrDefault()); } else { data.Data = new DTO.BackSaleOrderMng.BackOrder(); } DAL.Support.DataFactory support_factory = new Support.DataFactory(); data.Seasons = support_factory.GetSeason().ToList(); data.Salers = support_factory.GetSaler().ToList(); data.PaymentTerms = support_factory.GetPaymentTerm().ToList(); data.DeliveryTerms = support_factory.GetDeliveryTerm().ToList(); data.VATPercent = support_factory.GetVATPercent(); data.Currency = support_factory.GetCurrency().ToList(); data.SaleOrderTypes = support_factory.GetSaleOrderType(); return(data); } } 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(new DTO.BackSaleOrderMng.EditFormData()); } }
public IEnumerable <DTO.Support.Season> GetSeasons(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DAL.Support.DataFactory support_factory = new Support.DataFactory(); try { return(support_factory.GetSeason().ToList());; } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message)) { notification.DetailMessage.Add(ex.InnerException.Message); } return(new List <DTO.Support.Season>()); } }
// // CUSTOM FUNCTION // public DTO.DDCMng.InitFormData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.DDCMng.InitFormData data = new DTO.DDCMng.InitFormData(); data.Seasons = new List <DTO.Support.Season>(); try { using (DDCMngEntities context = CreateContext()) { data.Seasons = supportFactory.GetSeason().ToList(); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }