public CreateDoctorViewModel(CreateDoctor open) { register = open; newUser = new tblUser(); newDoctor = new tblClinicDoctor(); allManagers = Service.Service.GetManagersList(); }
public CreateDoctorViewModel(CreateDoctor open, tblClinicDoctor d, tblUser u) { register = open; newUser = u; newDoctor = d; allManagers = Service.Service.GetManagersList(); isEditingWindow = true; }
private void AddDoctorExecute() { try { CreateDoctor create = new CreateDoctor(); create.ShowDialog(); if ((create.DataContext as CreateDoctorViewModel).isUpdated == true) { doctorList = Service.Service.DoctorList(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public ActionResult Create() { CreateDoctor ViewModel = new CreateDoctor(); string URL = "PracticeData/GetListOfPractices"; HttpResponseMessage HttpResponse = Client.GetAsync(URL).Result; if (HttpResponse.IsSuccessStatusCode) { List <PracticeDTO> Practices = HttpResponse.Content.ReadAsAsync <List <PracticeDTO> >().Result; ViewModel.Practice = Practices; return(View(ViewModel)); } else { return(RedirectToAction("Error")); } }
private void EditDoctorExecute() { try { int? userId = doctor.userId; tblUser user = Service.Service.UserById(userId); CreateDoctor create = new CreateDoctor(doctor, user); create.ShowDialog(); if ((create.DataContext as CreateDoctorViewModel).isUpdated == true) { doctorList = Service.Service.DoctorList(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public ActionResult Update(int id) { CreateDoctor ViewModel = new CreateDoctor(); string URL = "DoctorData/FindDoctor/" + id; HttpResponseMessage Response = Client.GetAsync(URL).Result; if (Response.IsSuccessStatusCode) { DoctorDTO SelectedDoctor = Response.Content.ReadAsAsync <DoctorDTO>().Result; ViewModel.Doctor = SelectedDoctor; URL = "PracticeData/GetListOfPractices"; Response = Client.GetAsync(URL).Result; List <PracticeDTO> PracticeList = Response.Content.ReadAsAsync <List <PracticeDTO> >().Result; ViewModel.Practice = PracticeList; return(View(ViewModel)); } else { return(RedirectToAction("Error")); } }