Пример #1
0
        protected void Application_Start()
        {
            ResourceManager.LoadCache();

            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //初始化规则
            SequenceProvider sequenceProvider = new SequenceProvider("FDDE660E27D849B0913915E9F5E47D6B");

            sequenceProvider.Init();
        }
Пример #2
0
 /// <summary>
 /// 新增公司
 /// </summary>
 /// <returns></returns>
 public int Add(CompanyEntity entity)
 {
     using (TransactionScope ts = new TransactionScope())
     {
         int line = 0;
         entity.CompanyID  = entity.CompanyID.IsEmpty() ? ConvertHelper.NewGuid() : entity.CompanyID;
         entity.CompanyNum = entity.CompanyNum.IsEmpty() ? new TNumProvider(this.CompanyID).GetSwiftNum(typeof(CompanyEntity), 5) : entity.CompanyNum;
         entity.IncludeAll();
         line = this.Company.Add(entity);
         if (line > 0)
         {
             SequenceProvider provider = new SequenceProvider(entity.CompanyID);
             provider.Init();
         }
         ts.Complete();
         return(line);
     }
 }
Пример #3
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);



            //加载缓存修改文
            ResourceManager.LoadCache();
            //注册枚举值
            EnumToJsonHelper.Reg(typeof(EAudite),
                                 typeof(EBadType),
                                 typeof(ECusType),
                                 typeof(EInType),
                                 typeof(EEquipmentStatus),
                                 typeof(EIsDelete),
                                 typeof(ELocalType),
                                 typeof(EMoveType),
                                 typeof(EOutType),
                                 typeof(EProductType),
                                 typeof(EReturnStatus),
                                 typeof(EStorageType),
                                 typeof(EOpType),
                                 typeof(ECheckType),
                                 typeof(EReturnType),
                                 typeof(EChange),
                                 typeof(EOrderStatus),
                                 typeof(EOrderType),
                                 typeof(ESupType),
                                 typeof(EDataSourceType),
                                 typeof(EReportType),
                                 typeof(EElementType),
                                 typeof(ESequence),
                                 typeof(EUnit),
                                 typeof(EBool));

            SetVersion();

            //初始化规则
            SequenceProvider sequenceProvider = new SequenceProvider();

            sequenceProvider.Init();
        }