Ejemplo n.º 1
0
        public DTO.InitFormDTO GetInitData(int userID, out Notification notification)
        {
            notification      = new Notification();
            notification.Type = NotificationType.Success;

            DTO.InitFormDTO data = new DTO.InitFormDTO();

            try
            {
                Framework.DAL.DataFactory fwFactory = new Framework.DAL.DataFactory();
                int?companyID = fwFactory.GetCompanyID(userID);

                using (var context = CreateContext())
                {
                    data.ProductionTeam = AutoMapper.Mapper.Map <List <OutsourceRpt_ProductionTeam_View>, List <DTO.OutsourceProductionTeamDTO> >(context.OutsourceRpt_ProductionTeam_View.Where(o => o.CompanyID == companyID).ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = NotificationType.Error;
                notification.Message = Library.Helper.GetInnerException(ex).Message;
            }

            return(data);
        }
Ejemplo n.º 2
0
        public DTO.InitFormDTO GetInitForm(int userID, out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            DTO.InitFormDTO data = new DTO.InitFormDTO();

            try
            {
                Framework.DAL.DataFactory frameworkFactory = new Framework.DAL.DataFactory();
                int?companyID = frameworkFactory.GetCompanyID(userID);

                using (WarehouseTransferMngEntities context = CreateContext())
                {
                    data.Branches          = AutoMapper.Mapper.Map <List <WarehouseTransferMng_Branch_View>, List <DTO.BranchDTO> >(context.WarehouseTransferMng_Branch_View.Where(o => o.CompanyID == companyID).ToList());
                    data.FactoryWarehouses = AutoMapper.Mapper.Map <List <WarehouseTransferMng_FactoryWarehouse_View>, List <DTO.FactoryWarehouseDTO> >(context.WarehouseTransferMng_FactoryWarehouse_View.Where(o => o.CompanyID == companyID).ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = Library.Helper.GetInnerException(ex).Message;
            }

            return(data);
        }
Ejemplo n.º 3
0
        public DTO.InitFormDTO GetInitData(int userId, out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            DTO.InitFormDTO data = new DTO.InitFormDTO();

            try
            {
                Framework.DAL.DataFactory frameworkFactory = new Framework.DAL.DataFactory();
                int?companyId = frameworkFactory.GetCompanyID(userId);

                using (var context = CreateContext())
                {
                    var dbFactoryWarehouses = context.ShowroomTransferMng_FactoryWarehouse_View.Where(o => o.CompanyID == companyId);
                    data.FactoryWarehouses = dataConverter.DB2DTO_SupportFactoryWarehouse(dbFactoryWarehouses.ToList());

                    var dbFactoryWarehousePallets = context.ShowroomTransferMng_FactoryWarehousePallet_View.Where(o => o.CompanyID == companyId);
                    data.FactoryWarehousePallets = dataConverter.DB2DTO_SupportFactoryWarehousePallet(dbFactoryWarehousePallets.ToList());
                }
            }
            catch (System.Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = Helper.GetInnerException(ex).Message;
            }

            return(data);
        }
Ejemplo n.º 4
0
        public object GetInitData(int userID, int branchID, out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;
            int?CompanyID = fwFactory.GetCompanyID(userID);

            DTO.InitFormDTO data = new DTO.InitFormDTO();

            try
            {
                Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory();
                data.ProductionItemGroups = this.GetProductionItemGroup().ToList();
                using (var context = CreateContext())
                {
                    data.FactoryWarehouseDtos = converter.DB2DTO_FactoryWarehouses(context.StockStatusQntRpt_FactoryWarehouse_View.Where(o => o.BranchID == branchID).ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = Library.Helper.GetInnerException(ex).Message;
            }

            return(data);
        }
Ejemplo n.º 5
0
        public object GetInitForm(int userID, out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            DTO.InitFormDTO data = new DTO.InitFormDTO();

            try
            {
                Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory();

                data.Seasons   = supportFactory.GetSeason().ToList();
                data.Factories = supportFactory.GetFactory().Where(s => s.FactoryID == 374043 || s.FactoryID == 374072).ToList();
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = Library.Helper.GetInnerException(ex).Message;
            }

            return(data);
        }
Ejemplo n.º 6
0
        public DTO.InitFormDTO GetInitData(int userID, out Library.DTO.Notification notification)
        {
            notification      = new Notification();
            notification.Type = NotificationType.Success;

            DTO.InitFormDTO data = new DTO.InitFormDTO();

            try
            {
                using (var context = CreateContext())
                {
                    data.PurchaseRequestStatuses = AutoMapper.Mapper.Map <List <SupportMng_PurchaseRequestStatus_View>, List <DTO.PurchaseRequestStatusDTO> >(context.SupportMng_PurchaseRequestStatus_View.ToList());
                    data.ProductionItemGroups    = AutoMapper.Mapper.Map <List <PurchaseRequestMng_ProductionItemGroup_View>, List <DTO.ProductionItemGroupDTO> >(context.PurchaseRequestMng_ProductionItemGroup_View.ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = NotificationType.Error;
                notification.Message = Library.Helper.GetInnerException(ex).Message;
            }

            return(data);
        }