protected void Page_Load(object sender, EventArgs e)
        {
            var settings = SettingsManager.Instance.LoadSettingsFor <StartupSettings>(Guid.Empty);

            if (!CoreContext.Configuration.Standalone || settings.Start)
            {
                Response.Redirect(CommonLinkUtility.GetDefault(), true);
            }

            settings.Start = true;
            SettingsManager.Instance.SaveSettingsFor(settings, Guid.Empty);

            Master.DisabledSidePanel = true;

            //top panel
            Master.TopStudioPanel.DisableProductNavigation = true;
            Master.TopStudioPanel.DisableUserInfo          = true;
            Master.TopStudioPanel.DisableSearch            = true;
            Master.TopStudioPanel.DisableSettings          = true;
            Master.TopStudioPanel.DisableTariff            = true;

            loaderHolder.Controls.Add(LoadControl(LoaderPage.Location));

            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            Page.RegisterStyleControl(VirtualPathUtility.ToAbsolute("~/usercontrols/common/startup/css/startup.less"));
            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/common/startup/js/startup.js"));
            Page.RegisterInlineScript("ProgressStartUpManager.init();");

            WarmUp.InitRequests();
        }
Example #2
0
            public async Task Should_receive_the_published_message()
            {
                Task <ConsumeContext <StartupComplete> > messageReceived = ConnectPublishHandler <StartupComplete>();

                Guid sagaId = NewId.NextGuid();

                var warmUpMessage = new WarmUp(sagaId, "Joe");

                await InputQueueSendEndpoint.Send(warmUpMessage);

                await _repository.ShouldContainSaga(sagaId, TestTimeout);

                var message = new Start(sagaId, "Joe");

                await InputQueueSendEndpoint.Send(message);

                ConsumeContext <StartupComplete> received = await messageReceived;

                Assert.AreEqual(sagaId, received.Message.TransactionId);

                Assert.IsTrue(received.InitiatorId.HasValue, "The initiator should be copied from the CorrelationId");

                Assert.AreEqual(received.InitiatorId.Value, message.CorrelationId, "The initiator should be the saga CorrelationId");

                Assert.AreEqual(received.SourceAddress, InputQueueAddress, "The published message should have the input queue source address");

                Guid?saga =
                    await _repository.ShouldContainSaga(x => x.CorrelationId == message.CorrelationId && x.CurrentState == _machine.Running.Name, TestTimeout);

                Assert.IsTrue(saga.HasValue);
            }
        public ActionResult DeleteConfirmed(int id)
        {
            WarmUp warmUp = db.WarmUps.Find(id);

            db.WarmUps.Remove(warmUp);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
 public void Print()
 {
     ConsoleHelper.WriteLineHeader("WarmUp:");
     WarmUp.Print();
     ConsoleHelper.NewLine();
     ConsoleHelper.WriteLineHeader("Result:");
     Result.Print();
 }
Example #5
0
        public void PlusMinus()
        {
            var input = new int[6] {
                -4, 3, -9, 0, 4, 1
            };

            Assert.Equal(new float[] { 0.5f, (float)1 / 3, (float)1 / 6 }, WarmUp.PlusMinus(input));
        }
Example #6
0
        public void AVeryBigSum()
        {
            var input = new long[5] {
                1000000001, 1000000002, 1000000003, 1000000004, 1000000005
            };

            Assert.Equal(5000000015, WarmUp.AVeryBigSum(input));
        }
 public ActionResult Edit([Bind(Include = "ID,Name")] WarmUp warmUp)
 {
     if (ModelState.IsValid)
     {
         db.Entry(warmUp).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(warmUp));
 }
        public ActionResult Create([Bind(Include = "ID,Name")] WarmUp warmUp)
        {
            if (ModelState.IsValid)
            {
                db.WarmUps.Add(warmUp);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(warmUp));
        }
Example #9
0
        public void Staircase()
        {
            var line1 = "     #";
            var line2 = "    ##";
            var line3 = "   ###";
            var line4 = "  ####";
            var line5 = " #####";
            var line6 = "######";

            Assert.Equal(new string[] { line1, line2, line3, line4, line5, line6 }, WarmUp.Staircase(6));
        }
        // GET: WarmUps/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WarmUp warmUp = db.WarmUps.Find(id);

            if (warmUp == null)
            {
                return(HttpNotFound());
            }
            return(View(warmUp));
        }
Example #11
0
        public void DiagonalDifference()
        {
            var firstRow = new int[3] {
                11, 2, 4
            };
            var secondRow = new int[3] {
                4, 5, 6
            };
            var thirdRow = new int[3] {
                10, 8, -12
            };
            var input = new int[3][] { firstRow, secondRow, thirdRow };

            Assert.Equal(15, WarmUp.DiagonalDifference(input));
        }
Example #12
0
        public void CompareTriplets()
        {
            var input1 = new List <int> {
                17, 28, 30
            };
            var input2 = new List <int> {
                99, 16, 8
            };
            var expectedOutput = new List <int>()
            {
                2, 1
            };

            var output = WarmUp.CompareTriplets(input1, input2);

            Assert.Equal(expectedOutput, output);
        }
Example #13
0
        /// <summary>
        /// SqlSugar与Dapper的性能比较
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            WarmUp wu = new WarmUp();//预热处理

            //设置执行的DEMO
            string switchOn = "4";
            IDemos demo     = null;

            switch (switchOn)
            {
            //查询所有
            case "1": demo = new SelectBigData(); break;

            //查询单条
            case "2": demo = new SelectSingle(); break;

            //比拼海量数据更新
            case "3": demo = new UpdateList(); break;

            //比拼海量数据插入
            case "4": demo = new InsertList(); break;

            //比拼批量删除
            case "5": demo = new DeleteArray(); break;

            //分页
            case "6": demo = new Page(); break;

            //比拼普通插入
            case "7": demo = new InsertItem(); break;

            //比拼普通更新
            case "8": demo = new UpdateItem(); break;

            default: Console.WriteLine("switchOn的值错误,请输入正确的 case"); break;
            }
            demo.Init();
            Console.WriteLine("执行成功请关闭窗口");
            Console.ReadKey();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (CoreContext.Configuration.Standalone)
         {
             return;
         }
         var domain = ConfigurationManager.AppSettings["web.warmup.domain"];
         var tenant = CoreContext.TenantManager.GetTenant(domain);
         if (tenant == null)
         {
             return;
         }
         CoreContext.TenantManager.SetCurrentTenant(tenant);
         SecurityContext.AuthenticateMe(tenant.OwnerId);
         WarmUp.InitRequests();
     }
     catch (Exception exc)
     {
         log4net.LogManager.GetLogger("ASC").Error("Startup", exc);
     }
 }
Example #15
0
 public void BirthdayCackeCandles()
 {
     Assert.Equal(2, WarmUp.BirthdayCakeCandles(new int[] { 3, 2, 1, 3 }));
 }
Example #16
0
 public void TimeConversion()
 {
     Assert.Equal("19:05:45", WarmUp.TimeConversion("07:05:45PM"));
 }
Example #17
0
 public void MiniMaxSum()
 {
     Assert.Equal(new long[] { 10, 14 }, WarmUp.MiniMaxSum(new long[] { 1, 2, 3, 4, 5 }));
 }