private void ButtonSave_Click(object sender, RoutedEventArgs e) { int from = Int32.Parse(WorkTimeVie.FromDateTime); int to = Int32.Parse(WorkTimeVie.ToDateTime); if (from >= to) { MessageBox.Show("The initial hourly rate must be less than the final hourly rate! ", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } Room r1 = _informationControler.GetEntity(WorkTimeVie.IdOfRoomInMySQLDataBase); r1.RoomId = WorkTimeVie.NameOfRoom; r1.IdRoomClinic = WorkTimeVie.IdOfRoom; r1.NameOfClinic = WorkTimeVie.NameOfClinic; r1.NumberOfFloor = WorkTimeVie.NumberOfFloor; r1.StartWorkTime = WorkTimeVie.FromDateTime; r1.EndWorkTime = WorkTimeVie.ToDateTime; _informationControler.UpdateEntity(r1); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { Room r1 = informationControler.GetEntity(room.IdOfRoomInMySQLDataBase); r1.RoomId = room.NameOfRoom; r1.IdRoomClinic = room.IdOfRoom; r1.NameOfClinic = room.NameOfClinic; r1.NumberOfFloor = room.NumberOfFloor; r1.BedCapacity = room.BedCapacity; r1.AvailableBeds = room.AvailableBeds; r1.OccupiedBeds = room.OccupiedBeds; informationControler.UpdateEntity(r1); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { if (!DoctorsComboBox.Text.ToString().Equals("")) { string _selectedDoctor = DoctorsComboBox.Text; string[] niz = _selectedDoctor.Split(':'); int selectedDoctorId = Int32.Parse(niz[1]); int from = Int32.Parse(DoctorsRoom.FromDateTime); int to = Int32.Parse(DoctorsRoom.ToDateTime); if (from >= to) { MessageBox.Show("The initial hourly rate must be less than the final hourly rate! ", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } Doctor selectedDoctor = _informationControler.GetDoctorById(selectedDoctorId); Room currentRoom = _informationControler.GetRoomById(_idRoom); currentRoom.DoctordId = selectedDoctor.Id; currentRoom.NameOfClinic = DoctorsRoom.NameOfClinic; currentRoom.NumberOfFloor = DoctorsRoom.NumberOfFloor; currentRoom.StartWorkTime = DoctorsRoom.FromDateTime; currentRoom.EndWorkTime = DoctorsRoom.ToDateTime; _informationControler.UpdateEntity(currentRoom); this.Close(); } else { int from = Int32.Parse(DoctorsRoom.FromDateTime); int to = Int32.Parse(DoctorsRoom.ToDateTime); if (from >= to) { MessageBox.Show("The initial hourly rate must be less than the final hourly rate! ", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } Room currentRoom = _informationControler.GetRoomById(_idRoom); currentRoom.NameOfClinic = DoctorsRoom.NameOfClinic; currentRoom.NumberOfFloor = DoctorsRoom.NumberOfFloor; currentRoom.StartWorkTime = DoctorsRoom.FromDateTime; currentRoom.EndWorkTime = DoctorsRoom.ToDateTime; _informationControler.UpdateEntity(currentRoom); this.Close(); } }