public void GetProductNamesByVendorNameTets()
        {
            List <string> products = Stage3.GetProductNamesByVendorName("Jeff's Sporting Goods");

            Assert.AreEqual(4, products.Count);
            Assert.AreEqual("Mountain Bike Socks, M", products[0]);
        }
        public void GetNRecentlyReviewedProductsTest()
        {
            List <Product> products = Stage3.GetNRecentlyReviewedProducts(1);

            Assert.AreEqual(1, products.Count);
            Assert.AreEqual("HL Mountain Pedal", products[0].Name);
        }
        public async Task <bool> OnMultiStageFormCreate(Stagedform stagedform)
        {
            // Create a new Stage1, Stage2, and Stage3 form then update the StagedForm
            Stage1 newStage1 = new Stage1();

            newStage1.Name = "";
            _context.Stage1.Add(newStage1);

            Stage2 newStage2 = new Stage2();

            newStage2.Description = "";
            _context.Stage2.Add(newStage2);

            Stage3 newStage3 = new Stage3();

            newStage3.Date = DateTime.Now;
            _context.Stage3.Add(newStage3);

            await _context.SaveChangesAsync();

            stagedform.Stage1       = newStage1.Id;
            stagedform.Stage2       = newStage2.Id;
            stagedform.Stage3       = newStage3.Id;
            stagedform.CurrentStage = (int)MultiStageFormStages.First;
            _context.Update(stagedform);

            await _context.SaveChangesAsync();

            return(true);
        }
Exemple #4
0
    // Use this for initialization
    protected void Start()
    {
        //just i know it works
        ToggleWheelRotate();

        //this is here bz gave me a null ref ex
        if (!HType.ToString().Contains(H.Bridge.ToString()))
        {
            Stage2.SetActive(false);
            Stage3.SetActive(false);
        }

        if (HType.ToString().Contains("Unit"))
        {
            PositionFixed = true;
            if (_startingStage == H.None)
            {
                _startingStage = H.Stage2;
            }
        }

        base.Start();

        //this is for BridgeUnits in here
        if (PositionFixed && _currentStage == 0)
        {
            if (_startingStage != H.None && _currentStage == 0)
            {
                RecreateStage();
            }
        }
    }
        private void confirmButton_Click(object sender, EventArgs e)
        {
            string code = codeText.Text;
            try
            {
                Credentials = CompanionAppService.Confirm(Credentials, code);
                Credentials.ToFile();
                CompanionAppService app = new CompanionAppService(Credentials);
                Commander Cmdr = app.Profile();
                Stage3 stage3 = new Stage3(Cmdr.Name);
                stage3.Show();
                this.Hide();

                }
                catch (EliteDangerousCompanionAppAuthenticationException ex)
            {
                Credentials.Clear();
                Credentials.ToFile();
                errorLabel.Text = ex.Message + "\r\nPlease restart this application to re-authenticate";
            }
            catch (EliteDangerousCompanionAppErrorException ex)
            {
                Credentials.Clear();
                Credentials.ToFile();
                errorLabel.Text = ex.Message + "\r\nPlease restart this application to re-authenticate";
            }
            catch (Exception ex)
            {
                Credentials.Clear();
                Credentials.ToFile();
                errorLabel.Text = "Unexpected problem\r\nPlease report this at http://github.com/CmdrMcDonald/EliteDangerousDataProvider/issues\r\n" + ex.Message + "\r\nPlease restart this application to re-authenticate";
            }
        }
        public void GetProductsWithNRecentReviewsTest()
        {
            List <Product> products = Stage3.GetProductsWithNRecentReviews(2);

            Assert.AreEqual(1, products.Count);
            Assert.IsNotNull(products.Find(product => product.ProductID.Equals(937)));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Date")] Stage3 stage3)
        {
            if (id != stage3.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stage3);
                    await _context.SaveChangesAsync();

                    // Update the form to the finished stage
                    MultiStageFormWorkflow multiStageFormWorkflow = new MultiStageFormWorkflow(_context);
                    await multiStageFormWorkflow.MoveFormToStage(stage3, MultiStageFormStages.Finished);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Stage3Exists(stage3.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(stage3));
        }
        public void GetTotalStandardCostByCategoryTest()
        {
            ProductCategory accessories = new ProductCategory
            {
                Name = "Accessories"
            };

            Assert.AreEqual(383, Stage3.GetTotalStandardCostByCategory(accessories));
        }
        public void GetProductsByNameExtendTest()
        {
            List <Product> products = Stage3.GetProductsByNameExtend("Nut");

            Assert.AreEqual(79, products.Count);
            foreach (Product product in products)
            {
                Assert.IsTrue(product.Name.Contains("Nut"));
            }
        }
        public async Task <IActionResult> Create([Bind("Id,Date")] Stage3 stage3)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stage3);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stage3));
        }
Exemple #11
0
    public void init()
    {
        working = true;
        core    = GetComponent <Core>();
        action  = 1;

        pivot_c = GameObject.Find("Pivot").GetComponent <Pivot_code>();

        s1 = new Stage1(pivot_c, core);
        s2 = new Stage2(pivot_c, core);
        s3 = new Stage3(pivot_c, core);
    }
Exemple #12
0
    private bool m_CanHitButton = true;                                     // allows user to register one click for ending the stage

    // Use this for initialization
    void Start()
    {
        if (s_Instance == null)
        {
            s_Instance        = this;
            m_Manager         = IntroSessionManager.s_Instance;
            m_RaycasterScript = IntroSessionManager.s_RaycasterScript;
            StartCoroutine(Run());                                                       // Begin the stage
        }
        else
        {
            Destroy(gameObject);
        }
    }
Exemple #13
0
        bool CheckACK()
        {
            AddText(richTextBox1, "check ack ");
            AddText(richTextBox1, Buff2Log(true, 7));

            Stage3 st = GetMsg3(m_buffer);

            byte[] m_EchoId = new byte[] { st.m_id1, st.m_id2, st.m_id3, st.m_id4 };
            UInt32 id       = BitConverter.ToUInt32(m_EchoId, 0);

//            AddText(richTextBox1, string.Format("header: {0} id: {1}", st.m_Header, id));
            if (m_nType != TYPE_HUB)
            {
                if (st.m_Header != 0xA5)
                {
                    AddText(richTextBox1, "wrong header");
                    return(false);
                }
            }
            else
            {
                if (st.m_Header != 0xA8)
                {
                    return(false);
                }
            }
            // if got the sameID as sent
            if (id == Convert.ToInt32(textID.Text))
            {
                {
                    //AddText(richTextBox1, Buff2Log(true, 7));
                    AddText(richTextBox1, "Successfully set up identity ");
                    PrintSticker();
                    SendSensorInfo();
                    SetText(statusText, "PASS");
                    SetColor(statusText, Color.Green);
                    m_stage             = Stage.STAGE0_NONE;
                    checkReused.Checked = m_bDefaultReused;
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemple #14
0
 public void DoTheThing_transforms_an_empty_string()
 {
     Assert.Equal("short_even_", Stage3.DoTheThing(""));
 }
Exemple #15
0
 public void DoTheThing_transforms_the_input_string(string input, string output)
 {
     Assert.Equal(output, Stage3.DoTheThing(input));
 }
Exemple #16
0
 public void Print(int stage)
 {
     if (stage == 1)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
     }
     else if (stage == 2)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide();
     }
     else if (stage == 3)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide();
     }
     else if (stage == 4)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide();
     }
     else if (stage == 5)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide();
     }
     else if (stage == 6)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide();
     }
     else if (stage == 7)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
     }
     else if (stage == 8)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
         Stage7.Hide();
     }
     else if (stage == 9)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
         Stage7.Hide(); Stage8.Hide();
     }
     else if (stage == 10)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
         Stage7.Hide(); Stage8.Hide(); Stage9.Hide();
     }
     else if (stage == 11)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
         Stage7.Hide(); Stage8.Hide(); Stage9.Hide(); Stage10.Hide();
     }
     else if (stage == 12)
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
         Stage7.Hide(); Stage8.Hide(); Stage9.Hide(); Stage10.Hide(); Stage11.Hide();
     }
     else if (stage == 100) // 숙련자
     {
         pictureBox1.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
         Stage7.Hide(); Stage8.Hide(); Stage9.Hide(); Stage10.Hide(); Stage11.Hide(); Stage12.Hide();
     }
     else
     {
         textBox1.Hide(); Ex_Input.Hide(); pictureBox2.Hide();
         Stage1.Hide(); Stage2.Hide(); Stage3.Hide(); Stage4.Hide(); Stage5.Hide(); Stage6.Hide();
         Stage7.Hide(); Stage8.Hide(); Stage9.Hide(); Stage10.Hide(); Stage11.Hide(); Stage12.Hide();
     }
 }
Exemple #17
0
        public static void Main(string[] args)
        {
            //var test = new Test1();
            //Console.ReadKey();
            bool serv = false;
            //string s1 = niceString("123123", "sdfsdf", "sdfsdf", 50, 50);
            //Console.WriteLine(s1);
            //string s2 = niceString("1231sdfsdfsdf23", "sdfsaaaadf", "sdfsdf", 50, 50);
            //Console.WriteLine(s2);
            //Console.ReadKey();
            //return;
            string procName = Process.GetCurrentProcess().ProcessName;

            if (Process.GetProcessesByName(procName).Length != 1)
            {
                Console.WriteLine("УЖЕ ЕСТЬ ЕЩЕ ОДИН ЭКЗЕМПЛЯР ПРОГРАММЫ");
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
                return;
            }
            // Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight);
            // ShowWindow(ThisConsole, MAXIMIZE);
            //ShowWindow(ThisConsole, MAXIMIZE);
            //Thread.Sleep(1000);
            //Console.SetWindowSize(Console.WindowWidth, Console.LargestWindowHeight-1);
            var stage1 = new Stage1("ПРОВЕРКА");

            var stage2 = new Stage2("ДОБАВЛЯЕМ");

            var stage3 = new Stage3("ОБРАБОКА ФОТОГРАФИЙ");

            var stage4 = new Stage4("СОЗДАНИЕ МОДЕЛЕЙ");

            var stage5 = new Stage5("WORKOUT CREATING...");

            var stage6 = new Stage6("FRIENDS CREATING...");

            var stage7 = new Stage7("DOGANDCAT CREATING...");

            var stage8 = new Stage8("SPORT CREATING...");

            var stage9 = new Stage9("FOOD CREATING...");

            var stage10 = new Stagef10("TRAVEL CREATING...");

            var stage11 = new Stage11("CONTACT CREATING...");

            var stage12 = new Stage12("INDEX CREATING...");

            var stage13 = new Stage13("REPORT CREATING...");

            var stage14 = new Stage14("RANDOMOPENER CREATE...");

            var stage15 = new Stage15("BOOK CREATE...");


            Console.WriteLine("");
            Console.WriteLine(DateTime.Now.ToString());
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("");
            Stopwatch stopwatch = new Stopwatch();

            // Begin timing.
            stopwatch.Start();
            PATH.INIT();
            CONST.INIT();
            PATH.checking();
            FILEWORK.SIZE();

            stage1.EXECUTE();

            stage2.EXECUTE();

            stage3.EXECUTE();

            stage4.EXECUTE();


            if (serv)
            {
                var serv1 = new Service1();
                serv1.EXECUTE();
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
                return;
            }

            stage15.EXECUTE();

            stage14.EXECUTE();

            stage5.EXECUTE();

            stage6.EXECUTE();

            stage7.EXECUTE();

            stage8.EXECUTE();

            stage9.EXECUTE();

            stage15.EXECUTE();

            stage10.EXECUTE();

            stage11.EXECUTE();

            stage12.EXECUTE();


            stage13.EXECUTE();

            COUNTER.count();
            // Stop timing.
            stopwatch.Stop();
            //var wo = new WORKOUT();
            //Console.WriteLine(wo._type);

            // Write result.
            Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
        /// <summary>
        /// Moves the form to the indicated stage.
        /// </summary>
        /// <returns>The form to stage.</returns>
        /// <param name="stage3">Stage3.</param>
        /// <param name="stage">Stage.</param>
        public async Task <bool> MoveFormToStage(Stage3 stage3, MultiStageFormStages stage)
        {
            Stagedform stagedform = await _context.Stagedform.SingleOrDefaultAsync(s => s.Stage3 == stage3.Id);

            return(await MoveFormToStage(stagedform, stage));
        }
        public void GetProductsByVendorNameTest()
        {
            List <Product> products = Stage3.GetProductsByVendorName("Jeff's Sporting Goods");

            Assert.AreEqual(4, products.Count);
        }
        public void GetNProductsFromCategoryTest()
        {
            List <Product> products = Stage3.GetNProductsFromCategory("Bikes", 1);

            Assert.AreEqual(1, products.Count);
        }
        public void GetProductVendorByProductNameTest()
        {
            string product = Stage3.GetProductVendorByProductName("Flat Washer 1");

            Assert.AreEqual("Continental Pro Cycles", product);
        }