private void Button_Click(object sender, RoutedEventArgs e) { Get.date = Convert.ToDateTime(date_tb.Text); Get.time = time_tb.Text; ReceptionWindow a = new ReceptionWindow(); list b = new list { id_doc = Get.doc_id, id_person = Get.person_id, a_date = Get.date, time = Get.time }; admin.list.Add(b); admin.SaveChanges(); a.dg2(); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { doc b = a.doc.Where(c => c.login == login_tb.Text && c.password == password_tb.Text).SingleOrDefault(); try { Get.doc_id = b.id_doc; } catch (System.NullReferenceException) { Get.doc_id = 1; } if (b == null) { MessageBox.Show("Ошибка, повторите введение логина и пароля"); } else if (b.login == "admin" && b.password == "admin") { Get.admin = 1; ReceptionWindow a = new ReceptionWindow(); a.Show(); this.Close(); } else if (b.id_position == 1) { ReceptionWindow a = new ReceptionWindow(); a.Show(); this.Close(); } else { DocWindow a = new DocWindow(); a.Show(); this.Close(); } }