Пример #1
0
 private void editSkatesButton_Click(object sender, RoutedEventArgs e)
 {
     if (SkatesGrid.SelectedItems.Count > 0)
     {
         for (int i = 0; i < SkatesGrid.SelectedItems.Count; i++)
         {
             WFAEntity.API.DatabaseRequest.NewSkates_hire objectStudent = SkatesGrid.SelectedItems[i] as WFAEntity.API.DatabaseRequest.NewSkates_hire;
             if (objectStudent != null)
             {
                 Forms.SkatesWindow g = new Forms.SkatesWindow(false, objectStudent.ID_skates_hire);
                 if (g.ShowDialog() == true)
                 {
                     this.ShowAll();
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("Выберите строку");
     }
     //var itm = (Skates_hire)SkatesGrid.SelectedItem;
     //Skates_hire EditSkates = MyDBContext.DBContext.Skates_hire.Find(itm.ID_skates_hire);
     //SkatesWindow skatesAddForm = new SkatesWindow(this, EditSkates);
     //skatesAddForm.ShowDialog();
 }
Пример #2
0
 private void addSkatesButton_Click(object sender, RoutedEventArgs e)
 {
     Forms.SkatesWindow g = new Forms.SkatesWindow(this);
     if (g.ShowDialog() == true)
     {
         this.ShowAll();
     }
 }
Пример #3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     using (WFAEntity.API.MyDBContext MyDBContext = new WFAEntity.API.MyDBContext())
     {
         var tmp = (
             from tmpEmployees in MyDBContext.Employees.ToList <Employees>()
             where tmpEmployees.Login.CompareTo(Log.Text) == 0 && tmpEmployees.Password.CompareTo(Pas.Text) == 0
             select tmpEmployees
             ).ToList();
         if (tmp.Count > 0)
         {
             if (tmp[0].Login == "Администратор")
             {
                 Forms.SheduleWindow g = new Forms.SheduleWindow(new MainWindow());
                 if (g.ShowDialog() == true)
                 {
                     this.ShowAll();
                 }
             }
             else if (tmp[0].Login == "Кассир")
             {
                 SkatesWindow g = new SkatesWindow(new MainWindow());
                 if (g.ShowDialog() == true)
                 {
                     this.ShowAll();
                 }
             }
             else if (tmp[0].Login == "Посетитель")
             {
                 MainWindow g = new MainWindow();
                 if (g.ShowDialog() == true)
                 {
                     this.ShowAll();
                 }
             }
         }
         else
         {
             MessageBox.Show("Ошибочка");
         }
     }
 }