//delete new anamneza app
 public void DeleteNewAnamanezaApplication()
 {
     DeleteAnamneza.ClickOn();
     ConfirmDelete.ClickOn();
     softAssert.VerifyElementHasEqual(utility.TableCount(anamnezaTableCount), Constant.tmpTableCount);
     CloseAnamnezaTable.ClickOn();
 }
Beispiel #2
0
        private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Delete)
            {
                var selected = Schedule.SelectedAppointment as SessionAppointment;
                if (selected != null)
                {
                    var dialog = new ConfirmDelete(new List <Session>(),
                                                   "Are you sure you want to delete this session?")
                    {
                        HelpState = Constants.ApplicationState.Schedule
                    };

                    dialog.ShowDialog();

                    if (dialog.Confirm)
                    {
                        _viewModel.RemoveSession(selected.Session);
                        _viewModel.InitRemainigSessions();
                    }
                    else
                    {
                        e.Handled = true;
                    }
                }
            }
            else if (e.Key == Key.C && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
            {
                e.Handled = true;
            }
        }
 //delete note
 public void DeleteNoteApplication()
 {
     DeleteNote.ClickOn();
     softAssert.VerifyElementIsPresent(ConfirmDelete);
     ConfirmDelete.ClickOn();
     CloseNotesTable.ClickOn();
     softAssert.VerifyElementHasEqualInsideWindow(utility.TableCount(noteTableCount), Constant.tmpTableCount, CloseNotesTable);
 }
Beispiel #4
0
        public static bool ConfirmDelete(Control c, int yoffset = 0)
        {
            var window = new ConfirmDelete()
            {
                Location = GetLocation(c, yoffset)
            };

            return(window.ShowDialog() == DialogResult.Yes);
        }
        public Subject SaveSubject()
        {
            Subject.RequiredSoftware = new List <Software>();
            foreach (var softwareViewModel in SoftwareList)
            {
                if (softwareViewModel.IsChecked)
                {
                    Subject.RequiredSoftware.Add(softwareViewModel.Software);
                }
            }

            if (_adding)
            {
                SubjectDao.Add(Subject);
            }
            else
            {
                var subject = SubjectDao.FindById(Subject.Id);
                subject.Update(Subject);

                var sessions = SessionDao.GetIncompatibleSessions(subject);
                if (sessions.Count > 0)
                {
                    var dialog = new ConfirmDelete(sessions,
                                                   "Are you sure you want to update this subject? Some of the sessions have already been placed in the schedule. Following is the list of all sessions that will be deleted if you proceed with this update.")
                    {
                        HelpState = Constants.ApplicationState.SubjectsAdd
                    };
                    dialog.ShowDialog();

                    if (dialog.Confirm)
                    {
                        SubjectDao.Update(subject);
                        foreach (var session in sessions)
                        {
                            SessionDao.Remove(session.Id);
                        }

                        _mainWindowViewModel.InitRemainigSessions();
                        _mainWindowViewModel.InitSessions();
                    }
                    else
                    {
                        return(null);
                    }
                }
                else
                {
                    SubjectDao.Update(subject);
                    _mainWindowViewModel.InitRemainigSessions();
                    _mainWindowViewModel.InitSessions();
                }
            }

            return(Subject);
        }
        public virtual IActionResult HandleContact(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var model = new ConfirmDelete();

            model.Id = id.Value;

            return(View(model));
        }
Beispiel #7
0
        private async Task <bool> ConfirmDeletion()
        {
            ConfirmDelete confirmDeleteDialog = new ConfirmDelete();
            await confirmDeleteDialog.ShowAsync();

            if (confirmDeleteDialog.DeleteRecord)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #8
0
        public Classroom SaveClassroom()
        {
            Classroom.InstalledSoftware = new List <Software>();
            foreach (var softwareViewModel in SoftwareList)
            {
                if (softwareViewModel.IsChecked)
                {
                    Classroom.InstalledSoftware.Add(softwareViewModel.Software);
                }
            }

            if (_adding)
            {
                ClassroomDao.Add(Classroom);
            }
            else
            {
                var sessions = SessionDao.GetIncompatibleSessions(Classroom);

                if (sessions.Count > 0)
                {
                    var dialog = new ConfirmDelete(sessions,
                                                   "Are you sure you want to update this classroom? Conflicting sessions have been found in the schedule. Following is the list of all sessions that will be deleted if you proceed with this update.")
                    {
                        HelpState = Constants.ApplicationState.ClassroomsAdd
                    };
                    dialog.ShowDialog();

                    if (dialog.Confirm)
                    {
                        ClassroomDao.Update(Classroom);
                        foreach (var session in sessions)
                        {
                            SessionDao.Remove(session.Id);
                        }

                        _mainWindowViewModel.InitRemainigSessions();
                        _mainWindowViewModel.InitSessions();
                    }
                }
                else
                {
                    ClassroomDao.Update(Classroom);
                    _mainWindowViewModel.InitRemainigSessions();
                    _mainWindowViewModel.InitSessions();
                }
            }

            return(Classroom);
        }
 //delete medicine
 public void DeleteMedicineApplication()
 {
     if (DeleteMedicine.IsDisplayed("delete medicine"))
     {
         DeleteMedicine.ClickOn();
         softAssert.VerifyElementIsPresent(ConfirmDelete);
         ConfirmDelete.ClickOn();
         SaveMedicineTable.ClickOn();
     }
     else
     {
         CancelMedicineTable.ClickOn();
     }
 }
        public virtual IActionResult FlushHandledContacts()
        {
            var model = new ConfirmDelete();

            return(View(model));
        }