Ejemplo n.º 1
0
        public void loadSecondWeek()
        {
            numWarmUpCount1.Value = 5;
            numWarmUpCount2.Value = 5;
            numWarmUpCount3.Value = 5;

            numWarmUpWeight1.Value = (decimal)CalcLib.getWeight(orm * 0.40);
            numWarmUpWeight2.Value = (decimal)CalcLib.getWeight(orm * 0.50);
            numWarmUpWeight3.Value = (decimal)CalcLib.getWeight(orm * 0.60);

            numMainCount1.Value = 3;
            numMainCount2.Value = 3;
            numMainCount3.Value = 3;

            numMainWeight1.Value = (decimal)CalcLib.getWeight(orm * 0.70);
            numMainWeight2.Value = (decimal)CalcLib.getWeight(orm * 0.80);
            numMainWeight3.Value = (decimal)CalcLib.getWeight(orm * 0.90);

            numBBBCount1.Value = 5;
            numBBBCount2.Value = 5;
            numBBBCount3.Value = 5;
            numBBBCount4.Value = 5;
            numBBBCount5.Value = 5;

            numBBBWeight1.Value = (decimal)CalcLib.getWeight(orm * 0.65);
            numBBBWeight2.Value = (decimal)CalcLib.getWeight(orm * 0.65);
            numBBBWeight3.Value = (decimal)CalcLib.getWeight(orm * 0.65);
            numBBBWeight4.Value = (decimal)CalcLib.getWeight(orm * 0.65);
            numBBBWeight5.Value = (decimal)CalcLib.getWeight(orm * 0.65);
        }
Ejemplo n.º 2
0
        private void btEndWorkout_Click(object sender, EventArgs e)
        {
            double      potentORM = CalcLib.OrmCalc((double)numMainCount3.Value, (int)numMainWeight3.Value);
            XmlDocument xmlDoc    = new XmlDocument();

            xmlDoc.Load(name + ".xml");
            XmlElement root = xmlDoc.DocumentElement;

            if (root.SelectSingleNode($"Week{exercise}").InnerText == "3")
            {
                root.SelectSingleNode($"Week{exercise}").InnerText = "1";
                cycle++;
                root.SelectSingleNode($"Cycle{exercise}").InnerText = "1";
            }
            else
            {
                week++;
                root.SelectSingleNode($"Week{exercise}").InnerText = week.ToString();
            }
            if (potentORM > Convert.ToDouble(root.SelectSingleNode($"ORM{exercise}").InnerText))
            {
                root.SelectSingleNode($"ORM{exercise}").InnerText = potentORM.ToString();
                MessageBox.Show($"New {exercise} 1RM ! {potentORM} kg!");
            }
            this.Close();
        }
Ejemplo n.º 3
0
        private void btProceed_Click(object sender, EventArgs e)
        {
            try {
                name = tBoxName.Text;
                double benchPressValue = double.Parse(tBoxInitBenchPress.Text);
                double squatValue      = double.Parse(tBoxInitSquat.Text);
                double deadliftValue   = double.Parse(tBoxInitDeadlift.Text);
                double ohpValue        = double.Parse(tBoxInitOHP.Text);

                benchPressInit = CalcLib.OrmCalc(benchPressValue, Convert.ToInt32(numInitBenchPress.Value));
                ohpInit        = CalcLib.OrmCalc(ohpValue, Convert.ToInt32(numInitBenchPress.Value));
                squatInit      = CalcLib.OrmCalc(squatValue, Convert.ToInt32(numInitBenchPress.Value));
                deadliftInit   = CalcLib.OrmCalc(deadliftValue, Convert.ToInt32(numInitBenchPress.Value));
                try {
                    FileLib.SaveIntoFile(name, benchPressInit, squatInit, deadliftInit, ohpInit);
                }
                catch { }

                this.Hide();
                MainForm mainForm = new MainForm(name);
                mainForm.Closed += (s, args) => this.Close();
                mainForm.ShowDialog();
            }
            catch (FormatException) {
                MessageBox.Show("Enter valid data", "Error");
            }
        }
Ejemplo n.º 4
0
        public void TestMethod1()
        {
            //переменные готовим
            int x        = 10;
            int y        = 20;
            int expected = 30; //ожидаемое значение

            //выполняем код
            CalcLib c      = new CalcLib();
            int     actual = c.Sum(x, y); //значение по факту

            //сравнение значений ожидаемого и фактического
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 5
0
 private void WorkoutForm_Load(object sender, EventArgs e)
 {
     orm = CalcLib.getORMValue(name, exercise);
     LoadData();
 }