protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); //BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); PhotoBookContext context = new PhotoBookContext(); if (!WebSecurity.Initialized) { WebSecurity.InitializeDatabaseConnection("PhotoBookContext", "Users", "ID", "UserName", autoCreateTables: true); } ControllerBuilder.Current.SetControllerFactory(new PhotoBookControllerFactory()); BootStrapper.ConfigureDependencies(); var container = ObjectFactory.Container; GlobalConfiguration.Configuration.DependencyResolver = new StructureMapDependencyResolver(container); //GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; //GlobalConfiguration.Configuration.Formatters.Remove( // GlobalConfiguration.Configuration.Formatters.XmlFormatter); }
protected void Application_Start() { RegisterRoutes(RouteTable.Routes); BootStrapper.ConfigureDependencies(); ControllerBuilder.Current.SetControllerFactory(new IoCControllerFactory()); }
public void TestMethod1() { // Database.SetInitializer(new MigrateDatabaseToLatestVersion<TicketDbContext,Configuration>()); BootStrapper.ConfigureDependencies(); IUnitOfWork unitOfWorkTicket = ObjectFactory.GetNamedInstance <IUnitOfWork>(EnumModule.DomesticTicket.ToString()); IUnitOfWorkRepository unitOfWorkRepositoryticket = ObjectFactory.GetNamedInstance <IUnitOfWorkRepository>(EnumModule.DomesticTicket.ToString()); Order order = new Order(); order.OrderId = "01305201230119290277"; order.PnrCode = "HPK3BQ"; order.OrderMoney = decimal.Parse("1000"); order.CreateTime = DateTime.Now; OrderPay orderPay = new OrderPay(); orderPay.PayMoney = decimal.Parse("1000"); order.OrderPay = orderPay ?? null; order.Policy = new Policy(); order.Policy.PolicyPoint = decimal.Parse("8"); order.Policy.PlatformCode = "517"; order.Policy.PolicyType = "1"; order.Policy.WorkTime = new StartAndEndTime(); order.Policy.WorkTime.StartTime = "9:00"; order.Policy.WorkTime.EndTime = "23:00"; order.Policy.ReturnTicketTime = new StartAndEndTime(); order.Policy.ReturnTicketTime.StartTime = "9:00"; order.Policy.ReturnTicketTime.EndTime = "23:00"; order.Policy.AnnulTicketTime = new StartAndEndTime(); order.Policy.AnnulTicketTime.StartTime = "9:00"; order.Policy.AnnulTicketTime.EndTime = "23:00"; order.Passengers = new List <Passenger>(); order.Passengers.Add(new Passenger { PassengerName = "测试", ABFee = decimal.Parse("50"), RQFee = decimal.Parse("120") }); order.OrderLogs = new List <OrderLog>(); order.OrderLogs.Add(new OrderLog { OperationContent = "新订单", OperationPerson = "test1", OperationDatetime = DateTime.Now }); order.SkyWays = new List <SkyWay>(); order.SkyWays.Add(new SkyWay { CarrayCode = "3U", FromCityCode = "CTU", ToCityCode = "PEK", Seat = "F", StartDateTime = DateTime.Parse("2013-12-05 11:15:00.000"), ToDateTime = DateTime.Parse("2013-12-05 11:17:00.000") }); unitOfWorkRepositoryticket.PersistCreationOf(order); unitOfWorkTicket.Commit(); }
public void TestMethod1() { BootStrapper.ConfigureDependencies(); PlatformHttpHandler p = new PlatformHttpHandler(); p.Process(null, null); return; _8000YIPlatformNotify _8000YI = new _8000YIPlatformNotify(); //_517PlatformNotify baiTuoPlatformNotify = new _517PlatformNotify(); //NotifyType=出票通知&OrderId=121130234135710108&DrawABillFlag=0&DrawABillRem //ark=&TicketNos=999|2192820521|NI|500225198608150772|艾庄博,999|2192820520|N //I|510230196401200318|艾勇&Pnr=JGS4DW&NewPnr= &Sign=B899D1455447E0777EFFDBF3 //B7C4B7FE NameValueCollection nv = new NameValueCollection(); /* * platform=8000YI * type=5 * orderguid=I635247870605937500 * orderstate=28 * key=BD42F2D8D6D4203FC47135BCDDE9EFBE * notifymsg=I635247870605937500%5e2014010846896956%5e1712.00%5e%e7%bc%96%e7%a0%81%e5%b7%b2%e5%8f%96%e6%b6%88 * areaCity=ctu */ nv.Add("platform", "8000YI"); nv.Add("type", "5"); nv.Add("orderguid", "I635247870605937500"); nv.Add("orderstate", "28"); nv.Add("key", "BD42F2D8D6D4203FC47135BCDDE9EFBE"); nv.Add("notifymsg", "I635247870605937500%5e2014010846896956%5e1712.00%5e%e7%bc%96%e7%a0%81%e5%b7%b2%e5%8f%96%e6%b6%88"); nv.Add("areaCity", "ctu"); bool b = _8000YI.CanProcess(nv); bool c = _8000YI.CanProcess(nv); //NotifyType =出票通知 //OrderId =140102231401680175 //DrawABillFlag =0 //DrawABillRemark = //TicketNos =999|2123356533|NI|130421197209255712|杨保民,999|2123356534|NI|511121197212100020|曾英 //Pnr =HQ8VYH //NewPnr = //Sign =88EB8681CD34E0E2D1962F94F79C560D }
public void TestMethod1() { BootStrapper.ConfigureDependencies(); IUnitOfWork unitOfWork = ObjectFactory.GetNamedInstance <IUnitOfWork>(EnumModule.SystemSetting.ToString()); IUnitOfWorkRepository unitOfWorkRepository = ObjectFactory.GetNamedInstance <IUnitOfWorkRepository>(EnumModule.SystemSetting.ToString()); Buyer bm = new Buyer(); bm.CreateTime = DateTime.Now; bm.Name = "测试商户1"; bm.Code = "100001"; bm.ContactWay = new ContactWay(); bm.ContactWay.Contact = "测试员A"; bm.ContactWay.Address = "成都"; bm.ContactWay.Tel = "0281238901"; bm.CreateTime = DateTime.Now; bm.CashbagCode = "0000000326"; bm.CashbagKey = "33cd87fd33d2493eb99b71a8a91d2ccf"; bm.Operators = new List <Operator>(); bm.Operators.Add(new Operator { Account = "test1", Password = "******".Md5(), OperatorState = Common.Enums.EnumOperatorState.Normal, Realname = "测试员A", Phone = "13509098743" }); bm.Attachments = new List <Attachment>(); bm.Attachments.Add(new Attachment { Name = "附件1", Url = "www.ss.com" }); bm.SMS = new SMS(); bm.SMS.RemainCount = 20; bm.SMS.SendCount = 0; unitOfWorkRepository.PersistCreationOf(bm); //var businessman = businessmanRepository.FindAll(b => b.Code == code).SingleOrDefault(); //businessman.Name = "测试商户222"; //unitOfWorkRepository.PersistUpdateOf(businessman); //unitOfWork.Commit(); //var businessman = businessmanRepository.FindAll(b => b.Code == "100002").SingleOrDefault(); //unitOfWorkRepository.PersistDeletionOf(businessman); unitOfWork.Commit(); }
public void TestCoordination() { BootStrapper.ConfigureDependencies(); //AuthManager.SaveUser(new CurrentUserInfo() //{ // Code = "aa", // CashbagCode = "0000000326", // OperatorAccount = "cc", // OperatorName = "dd", // CashbagKey = "33cd87fd33d2493eb99b71a8a91d2ccf" //}); BPiaoBao.AppServices.DomesticTicket.OrderService orderservice = ObjectFactory.GetInstance <OrderService>(); string OrderId = "01312091002468804592"; string Content = "测试协调12121"; //添加 // orderservice.AddCoordinationDto(OrderId, Content); //查询 CoordinationDto cd = orderservice.GetCoordinationDto(OrderId); }
protected void Application_Start(object sender, EventArgs e) { BootStrapper.ConfigureDependencies(); }