public AddAdminDialogVM() { NewAdmin = new BE.Entities.Admin(); model = new AddAdminDialogM(); CancelClick = new Command <object>(ExecuteCancel, CanExecuteCancel); AddNewAdminClick = new AsyncCommand <object>(ExecuteAsyncAdd, CanExecuteAdd); }
public async Task ExecuteAsync(object parameter) { LoginUC loginUserControl = (LoginUC)parameter; loginUserControl.loginProgressRing.IsIndeterminate = true; string userName = loginUserControl.UserNameTextBox.Text; string pass = loginUserControl.PasswordTextBox.Password; User user = null; await Task.Run(() => { user = ExecuteSync(userName, pass); }); if (user != null) { StackPanel UserDetailsContainer = ((MainWindow)(((App)App.Current).mainWindow)).UserDetailsContainer; Border HeaderLine = ((MainWindow)(((App)App.Current).mainWindow)).HeaderLine; Border DetailesLine = ((MainWindow)(((App)App.Current).mainWindow)).DetailesLine; DockPanel HeaderContainer = ((MainWindow)(((App)App.Current).mainWindow)).HeaderContainer; DockPanel HomeContainer = ((MainWindow)(((App)App.Current).mainWindow)).HomeContainer; HeaderLine.BorderThickness = new Thickness(0, 0, 0, 2); DetailesLine.BorderThickness = new Thickness(0, 0, 2, 0); //HeaderBorder.Background = System.Windows.Media.Brushes.LightSteelBlue; //HomeBorder.Background = System.Windows.Media.Brushes.AliceBlue; Doctor doctor = user as Doctor; if (doctor != null) { ((App)(App.Current)).ClearAllContainers(); UserDetailsContainer.Children.Clear(); UserDetailsContainer.Children.Add(new UserDetailsUC(user)); UserDetailsContainer.Children.Add(new DoctorDetailsUC((Doctor)user)); ((App)(App.Current)).NotifyMessage(String.Format("Hello Dr. {0}.", doctor.FullName)); } BE.Entities.Admin admin = user as BE.Entities.Admin; if (admin != null) { ((App)(App.Current)).ClearAllContainers(); UserDetailsContainer.Children.Clear(); UserDetailsContainer.Children.Add(new UserDetailsUC(user)); HomeContainer.Children.Clear(); HomeContainer.Children.Add(new AdminTabV()); ((App)(App.Current)).NotifyMessage(String.Format("Hello Admin {0}.", admin.FullName)); } } loginUserControl.loginProgressRing.IsIndeterminate = false; }
private void AddFewEntities() { DateTime x = new DateTime(1997, 12, 23); List <Prescription> l = new List <Prescription>(); Dictionary <string, int> dict = new Dictionary <string, int>(); Patient p = new Patient(l, "Moshe", "Iluz", Gender.MALE, "209492065", x, "Israel, Petah Tikva, Rabbi Yehuda 17 Apartment 1"); BLObj.AddPatient(p); Doctor d = new Doctor("yona", "1111", "Yonatan", "Cohen", Gender.MALE, "111222333", new DateTime(1990, 1, 1), 15462, new DateTime(2020, 1, 1), Expertize.FAMILY, "Israel, Elad, Rabbi Yehoshua 32"); BLObj.AddDoctor(d); Prescription pr = new Prescription(DateTime.Now, dict, "My head is hurts", "his head hurts", 209492065, 111222333); BLObj.AddPrescription(pr); BE.Entities.Admin admin = new BE.Entities.Admin("admin", "1111", "Yitzhak", "Iluz", Gender.MALE, "12121212", x, "Israel, Elad, Rabbi Meir 16 Apartment 1"); BLObj.AddAdmin(admin); }
public void UpdateAdmin(BE.Entities.Admin a) { BLObj.UpdateAdmin(a); }