Ejemplo n.º 1
0
        private void AMSAppProcess(DXInfo.Business.Common businessCommon, Common centerCommon)
        {
            #region 连接串缓存
            Hashtable htapp = new Hashtable();
            htapp.Add("cons", System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]);
            Application["appconf"] = htapp;
            #endregion

            #region 导入基本数据
            ParaInit(Application);
            AMSApp.zhenghua.Business.Helper.LoadInitCode(Application);
            #endregion

            #region 刷新AMSApp数据至FairiesMemberManage
            if (centerCommon.IsAMSAppRefresh())
            {
                var AmscmUow = DependencyResolver.Current.GetService <IAMSCMUow>();
                businessCommon.SyncDept(AmscmUow);
                centerCommon.SyncOper(AmscmUow);
                centerCommon.SyncGT(AmscmUow);
                businessCommon.SyncGoods(AmscmUow);
            }
            #endregion
        }
Ejemplo n.º 2
0
        protected void Application_Start()
        {
            #region 设置
            AreaRegistration.RegisterAllAreas();
            IocConfig.RegisterIoc();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            #endregion

            var Uow = DependencyResolver.Current.GetService <IFairiesMemberManageUow>();
            DXInfo.Business.Common businessCommon = new DXInfo.Business.Common(Uow);
            Common centerCommon = new Common(Uow);
            if (!centerCommon.IsAMSApp())
            {
                InitData();
            }

            #region 处理AMSApp
            if (centerCommon.IsAMSApp())
            {
                AMSAppProcess(businessCommon, centerCommon);
            }
            #endregion

            #region  射对象
            Mapper.CreateMap <DXInfo.Models.ScrapVouch, DXInfo.Models.RdRecord>();
            Mapper.CreateMap <DXInfo.Models.ScrapVouchs, DXInfo.Models.RdRecords>();

            Mapper.CreateMap <DXInfo.Models.TransVouch, DXInfo.Models.RdRecord>();
            Mapper.CreateMap <DXInfo.Models.TransVouchs, DXInfo.Models.RdRecords>();

            Mapper.CreateMap <DXInfo.Models.CheckVouch, DXInfo.Models.RdRecord>();
            Mapper.CreateMap <DXInfo.Models.CheckVouchs, DXInfo.Models.RdRecords>();

            Mapper.CreateMap <DXInfo.Models.MixVouch, DXInfo.Models.RdRecord>();
            Mapper.CreateMap <DXInfo.Models.MixVouchs, DXInfo.Models.RdRecords>();

            Mapper.CreateMap <DXInfo.Models.AdjustLocatorVouch, DXInfo.Models.RdRecord>();
            Mapper.CreateMap <DXInfo.Models.AdjustLocatorVouchs, DXInfo.Models.RdRecords>();

            Mapper.CreateMap <DXInfo.Models.AdjustLocatorVouch, DXInfo.Models.InvLocator>();
            Mapper.CreateMap <DXInfo.Models.AdjustLocatorVouchs, DXInfo.Models.InvLocator>();

            Mapper.CreateMap <DXInfo.Models.RdRecord, DXInfo.Models.InvLocator>();
            Mapper.CreateMap <DXInfo.Models.RdRecords, DXInfo.Models.InvLocator>();

            Mapper.CreateMap <ynhnTransportManage.Models.StockManage.RdRecord, DXInfo.Models.RdRecord>();
            Mapper.CreateMap <DXInfo.Models.RdRecord, ynhnTransportManage.Models.StockManage.RdRecord>();

            Mapper.CreateMap <ynhnTransportManage.Models.StockManage.RdRecord, DXInfo.Models.MixVouch>();
            Mapper.CreateMap <DXInfo.Models.MixVouch, ynhnTransportManage.Models.StockManage.RdRecord>();

            Mapper.CreateMap <ynhnTransportManage.Models.StockManage.MixVouch, DXInfo.Models.MixVouch>();
            Mapper.CreateMap <DXInfo.Models.MixVouch, ynhnTransportManage.Models.StockManage.MixVouch>();



            Mapper.CreateMap <DXInfo.Models.MixVouch, DXInfo.Models.TransVouch>();
            Mapper.CreateMap <DXInfo.Models.MixVouchs, DXInfo.Models.TransVouchs>();

            Mapper.CreateMap <ynhnTransportManage.Models.StockManage.TransVouch, DXInfo.Models.TransVouch>();
            Mapper.CreateMap <DXInfo.Models.TransVouch, ynhnTransportManage.Models.StockManage.TransVouch>();

            Mapper.CreateMap <ynhnTransportManage.Models.StockManage.AdjustLocatorVouch, DXInfo.Models.AdjustLocatorVouch>();
            Mapper.CreateMap <DXInfo.Models.AdjustLocatorVouch, ynhnTransportManage.Models.StockManage.AdjustLocatorVouch>();

            Mapper.CreateMap <ynhnTransportManage.Models.StockManage.CheckVouch, DXInfo.Models.CheckVouch>();
            Mapper.CreateMap <DXInfo.Models.CheckVouch, ynhnTransportManage.Models.StockManage.CheckVouch>();

            Mapper.CreateMap <DXInfo.Models.CurrentInvLocator, DXInfo.Models.CheckVouchs>();
            Mapper.CreateMap <DXInfo.Models.CurrentStock, DXInfo.Models.CheckVouchs>();
            Mapper.CreateMap <ynhnTransportManage.Models.StockManage.ScrapVouch, DXInfo.Models.ScrapVouch>();
            Mapper.CreateMap <DXInfo.Models.ScrapVouch, ynhnTransportManage.Models.StockManage.ScrapVouch>();
            Mapper.CreateMap <DXInfo.Models.Receipts, DXInfo.Models.ReceiptHis>();
            #endregion

            #region 自动同步零售数据入库存

            bool isSyncSaleStock = businessCommon.IsSyncSaleStock();
            if (isSyncSaleStock)
            {
                timer          = new Timer();
                timer.Enabled  = true;
                timer.Interval = 3 * 60 * 1000;
                timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
                timer.Start();
            }
            #endregion
        }