예제 #1
0
 private void SetModelToUI(FootballDto dto)
 {
     dateTimePicker1.Value = dto.Filled;
     maskedTextBox1.Text   = dto.FullName;
     maskedTextBox2.Text   = dto.Citizenship;
     numericUpDown1.Value  = dto.Age;
     numericUpDown2.Value  = dto.Height;
     numericUpDown3.Value  = dto.Weight;
     numericUpDown4.Value  = dto.AgeStartCareer;
     numericUpDown5.Value  = dto.ExperienceInFootball;
 }
예제 #2
0
        public void Test()
        {
            var dto = new FootballDto
            {
                Filled               = DateTime.Now,
                FullName             = "Малых Александр Александрович",
                Citizenship          = "Русский",
                Age                  = 19,
                Height               = 178,
                Weight               = 60,
                AgeStartCareer       = 15,
                ExperienceInFootball = 3,
                Position             = Position.Goalkeeper,
                WorkingLeg           = WorkingLeg.Right,
                WeakSides            = WeakSides.Endurance,
                Strengths            = Strengths.Reaction,

                Traums = new List <Trauma>()
                {
                    new Trauma
                    {
                        CountTraums = 0,
                        TimeTraums  = 0,
                        TraumаNow   = false,
                        Type        = TraumaTypes.None
                    }
                }
            };
            var tempFileName = Path.GetTempFileName();

            try
            {
                Helper.WriteToFile(tempFileName, dto);
                var readDto = Helper.LoadFromFile(tempFileName);
                Assert.AreEqual(dto.Filled, readDto.Filled);
            }
            finally
            {
                File.Delete(tempFileName);
            }
        }
예제 #3
0
        public void Test()
        {
            var dto = new FootballDto
            {
                Filled               = DateTime.Now,
                FullName             = "Малых Александр Александрович",
                Citizenship          = "Русский",
                Age                  = 19,
                Height               = 178,
                Weight               = 60,
                AgeStartCareer       = 15,
                ExperienceInFootball = 3,
                Position             = Position.Goalkeeper,
                WorkingLeg           = WorkingLeg.Right,
                CountTraums          = 0,
                TimeTraums           = 0,
                TraumаNow            = "Нет",
                Traums               = " Не было травм",
                Strength1            = Strengths.Reaction,
                WeakSides1           = WeakSides.HeadGame,
                Strength2            = Strengths.Jump,
                WeakSides2           = WeakSides.Force,
                Strength3            = Strengths.Pass,
                WeakSides3           = WeakSides.Speed,
            };
            var tempFileName = Path.GetTempFileName();

            try
            {
                Helper.WriteToFile(tempFileName, dto);
                var readDto = Helper.LoadFromFile(tempFileName);
                Assert.AreEqual(dto.Filled, readDto.Filled);
            }
            finally
            {
                File.Delete(tempFileName);
            }
        }
예제 #4
0
 private void SetModelToUI(FootballDto dto)
 {
     dateTimePicker1.Value   = dto.Filled;
     maskedTextBox1.Text     = dto.FullName;
     maskedTextBox2.Text     = dto.Citizenship;
     numericUpDown1.Value    = dto.Age;
     numericUpDown2.Value    = dto.Height;
     numericUpDown3.Value    = dto.Weight;
     numericUpDown4.Value    = dto.AgeStartCareer;
     numericUpDown5.Value    = dto.ExperienceInFootball;
     numericUpDown6.Value    = dto.CountTraums;
     numericUpDown7.Value    = dto.TimeTraums;
     maskedTextBox3.Text     = dto.TraumаNow;
     comboBox1.SelectedIndex = (int)dto.Position;
     comboBox2.SelectedIndex = (int)dto.WorkingLeg;
     comboBox3.SelectedIndex = (int)dto.Strength1;
     comboBox4.SelectedIndex = (int)dto.WeakSides1;
     comboBox5.SelectedIndex = (int)dto.Strength2;
     comboBox6.SelectedIndex = (int)dto.WeakSides2;
     comboBox7.SelectedIndex = (int)dto.Strength3;
     comboBox8.SelectedIndex = (int)dto.WeakSides3;
     textBox1.Text           = dto.Traums;
 }