Example #1
0
        public DTO.InitForm GetInitData(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.InitForm data = new DTO.InitForm();
            data.SupportSubSuppliers = new List <DTO.SupportSubSupplierData>();

            //try to get data
            try
            {
                using (var context = CreateContext())
                {
                    data.SupportSubSuppliers = converter.DB2DTO_GetSubSupplier(context.SummaryPurchasesRpt_SupportSubSupplier_View.ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }
Example #2
0
        public DTO.InitForm GetInitData(int userId, out Library.DTO.Notification notification)
        {
            DTO.InitForm              initData         = new DTO.InitForm();
            Support.DAL.DataFactory   supportFactory   = new Support.DAL.DataFactory();
            Framework.DAL.DataFactory frameworkFactory = new Framework.DAL.DataFactory();

            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            try
            {
                initData.WorkCenters = supportFactory.GetWorkCenter();

                int?companyID = frameworkFactory.GetCompanyID(userId);
                initData.ProductionTeams   = supportFactory.GetProductionTeam(companyID);
                initData.FactoryWarehouses = supportFactory.GetFactoryWarehouse(companyID);
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(initData);
        }
Example #3
0
        public override object GetInitData(int userId, out Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.InitForm data = new DTO.InitForm();
            data.keyRawMaterials = new List <DTO.KeyRawMaterial>();

            //try to get data
            try
            {
                using (var context = CreateContext())
                {
                    data.keyRawMaterials = AutoMapper.Mapper.Map <List <AccountReceivableRpt_KeyRawMaterial_View>, List <DTO.KeyRawMaterial> >(context.AccountReceivableRpt_KeyRawMaterial_View.ToList());
                    data.dueColorDTOs    = AutoMapper.Mapper.Map <List <AccountReceivableRpt_DueColor_View>, List <DTO.DueColorDTO> >(context.AccountReceivableRpt_DueColor_View.ToList());
                    data.SupplierDTO     = AutoMapper.Mapper.Map <List <AccountReceivableRpt_FactoryRawMaterial_View>, List <DTO.SupplierDTO> >(context.AccountReceivableRpt_FactoryRawMaterial_View.ToList());
                }
                data.CurrentDate = DateTime.Now.ToString("dd/MM/yyyy");
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }
Example #4
0
        public DTO.InitForm GetInitData(out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            DTO.InitForm initForm = new DTO.InitForm();
            initForm.Season = new List <Support.DTO.Season>();

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

                initForm.Season = supportFactory.GetSeason();
            }
            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(initForm);
        }
Example #5
0
        public DTO.InitForm GetInitData(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.InitForm data = new DTO.InitForm();
            data.SupplierDTOs = new List <DTO.SupplierDTO>();

            //try to get data
            try
            {
                using (var context = CreateContext())
                {
                    data.SupplierDTOs = converter.DB2DTO_GetSubSupplier(context.Supplier.Where(o => o.SupplierID == 336037).ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }
Example #6
0
        public DTO.InitForm GetInitData(int iRequesterID, out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            DTO.InitForm initForm = new DTO.InitForm();
            initForm.FactoryWarehouses = new List <Support.DTO.FactoryWarehouseDto>();

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

                Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory();
                initForm.FactoryWarehouses = supportFactory.GetFactoryWarehouse(companyID);
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;

                if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message.Trim()))
                {
                    notification.DetailMessage.Add(ex.InnerException.Message);
                }
            }

            return(initForm);
        }
Example #7
0
        public override object GetInitData(int userId, out Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.InitForm data = new DTO.InitForm();
            data.keyRawMaterials = new List <KeyRawMaterial>();

            //try to get data
            try
            {
                using (var context = CreateContext())
                {
                    data.keyRawMaterials = AutoMapper.Mapper.Map <List <AccountPayableRpt_KeyRawMaterial_View>, List <DTO.KeyRawMaterial> >(context.AccountPayableRpt_KeyRawMaterial_View.ToList());
                    data.dueColorDTOs    = AutoMapper.Mapper.Map <List <AccountPayableRpt_DueColor_View>, List <DTO.DueColorDTO> >(context.AccountPayableRpt_DueColor_View.ToList());
                    // data.PurchaseInvoiceDTO = AutoMapper.Mapper.Map<List<AccountPayableMng_PurchaseInvoice_View>, List<DTO.PurchaseInvoiceDTO>>(context.AccountPayableRpt_function_PurchaseInvoice());
                    data.SupplierDTO = AutoMapper.Mapper.Map <List <AccountPayableMng_FactoryRawMaterial_View>, List <DTO.SupplierDTO> >(context.AccountPayableMng_FactoryRawMaterial_View.ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }
Example #8
0
        public DTO.InitForm GetInitForm(out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            DTO.InitForm data = new DTO.InitForm();
            data.Countries = new List <Support.DTO.ManufacturerCountry>();

            try
            {
                Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory();
                data.Countries = supportFactory.GetManufacturerCountry();
            }
            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);
        }
Example #9
0
        public DTO.InitForm GetInit(int userID, out Library.DTO.Notification notification)
        {
            notification      = new Library.DTO.Notification();
            notification.Type = Library.DTO.NotificationType.Success;

            DTO.InitForm            data           = new DTO.InitForm();
            Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory();

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

            data.SupportWorkCenter       = supportFactory.GetWorkCenter();
            data.SupportProductionTeam   = supportFactory.GetProductionTeam(companyID);
            data.SupportFactoryWarehouse = supportFactory.GetFactoryWarehouse(companyID);

            return(data);
        }