Пример #1
0
        private void ButtonOk_OnClick(object sender, RoutedEventArgs e)
        {
            EmployeeType  eEmployeeType = EmployeeType.SysAdm;
            List <Skills> objSkills     = new List <Skills>();

            if (RadioButton1.IsChecked == true)
            {
                eEmployeeType = EmployeeType.SysAdm;
            }
            if (RadioButton2.IsChecked == true)
            {
                eEmployeeType = EmployeeType.Programmer;
            }
            if (RadioButton3.IsChecked == true)
            {
                eEmployeeType = EmployeeType.ProductManager;
            }

            if (CheckBox1.IsChecked == true)
            {
                objSkills.Add(Skills.CSharp);
            }
            if (CheckBox2.IsChecked == true)
            {
                objSkills.Add(Skills.CPlusPlus);
            }
            if (CheckBox3.IsChecked == true)
            {
                objSkills.Add(Skills.Linux);
            }

            var objInfo = new ResumeInfo()
            {
                FirstName    = TextBox1.Text,
                LastName     = TextBox2.Text,
                BirthDate    = TextBox3.Text,
                EmployeeType = eEmployeeType,
                Skills       = objSkills
            };


            using (var objWriter = new StreamWriter("list.txt")) {
                objWriter.Write(objInfo.ToString());
            }
        }
Пример #2
0
      private void ButtonOk_OnClick(object sender, RoutedEventArgs e) {
         EmployeeType eEmployeeType = EmployeeType.SysAdm;
         List<Skills> objSkills = new List<Skills>();
         if(RadioButton1.IsChecked == true) {
            eEmployeeType = EmployeeType.SysAdm;
         }
         if(RadioButton2.IsChecked == true) {
            eEmployeeType = EmployeeType.Programmer;
         }
         if(RadioButton3.IsChecked == true) {
            eEmployeeType = EmployeeType.ProductManager;
         }

         if(CheckBox1.IsChecked == true) {
            objSkills.Add(Skills.CSharp);
         }
         if(CheckBox2.IsChecked == true) {
            objSkills.Add(Skills.CPlusPlus);
         }
         if(CheckBox3.IsChecked == true) {
            objSkills.Add(Skills.Linux);
         }

         var objInfo = new ResumeInfo() {
            FirstName = TextBox1.Text,
            LastName = TextBox2.Text,
            BirthDate = TextBox3.Text,
            EmployeeType = eEmployeeType,
            Skills = objSkills
         };


         using(var objWriter = new StreamWriter("list.txt")) {
            objWriter.Write(objInfo.ToString());
         }
      }