Example #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            MasterViewAdmin mv = new MasterViewAdmin();

            mv.Show();
            Close();
        }
Example #2
0
        private void MenuItem_Click_8(object sender, RoutedEventArgs e)
        {
            MasterViewAdmin mv = new MasterViewAdmin();

            mv.Show();
            Close();
        }
Example #3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Model1  db     = new Model1();
         Masters master = new Masters
         {
             username    = login.Text,
             password    = password.Text,
             first_name  = name.Text,
             last_name   = family.Text,
             middle_name = patronymic.Text,
             address     = address.Text,
             phone       = phone.Text,
             email       = email.Text
         };
         db.Masters.Add(master);
         db.SaveChanges();
         MessageBox.Show("Мастер добавлен!");
         MasterViewAdmin mv = new MasterViewAdmin();
         mv.Show();
         Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Model1 db  = new Model1();
            int    a   = Convert.ToInt32(idtxt.Text);
            var    cls = db.Masters
                         .Where(c => c.id_master == a)
                         .FirstOrDefault();

            cls.username    = username.Text;
            cls.password    = password.Text;
            cls.last_name   = last.Text;
            cls.first_name  = first.Text;
            cls.middle_name = middle.Text;
            cls.address     = addr.Text;

            cls.phone = phone.Text;
            cls.email = email.Text;

            db.SaveChanges();

            MessageBox.Show("Данные о мастере изменены!");
            MasterViewAdmin mv = new MasterViewAdmin();

            mv.Show();
            Close();
        }