public DTO.InitData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.InitData data = new DTO.InitData(); data.ProductionItemGroups = new List <ProductionItemGroup>(); try { using (OutsourcingCostTypeMngEntities context = CreateContext()) { data.ProductionItemGroups = converter.DB2DTO_GetProductionItemGroup(context.OutsourcingCostTypeMng_ProductionItemGroup_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public DTO.InitData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.InitData data = new DTO.InitData(); data.SupportLPManagingDTOs = new List <SupportLPManagingDTO>(); try { using (ClientLPMngEntities context = CreateContext()) { data.SupportLPManagingDTOs = converter.DB2DTO_SupportLPManaging(context.SupportMng_LPManagingTeam_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public object GetInitForm(out Notification notification) { notification = new Notification(); notification.Type = NotificationType.Success; DTO.InitData data = new DTO.InitData(); try { using (var context = CreatContext()) { data.MaterialGroups = AutoMapper.Mapper.Map <List <ProductionItemGroup>, List <DTO.MaterialGroup> >(context.ProductionItemGroup.ToList()); data.Suppliers = AutoMapper.Mapper.Map <List <FactoryRawMaterial>, List <DTO.SubSupplier> >(context.FactoryRawMaterial.ToList()); } } catch (Exception ex) { notification.Type = NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }