예제 #1
0
        private void CancelButtonClicked(object sender, RoutedEventArgs routedEventArgs)
        {
            GroupModifyList groupModifyList = new GroupModifyList();

            groupModifyList.Show();
            this.Close();
        }
예제 #2
0
        private void GroupModifyButtonClicked(object sender, RoutedEventArgs routedEventArgs)
        {
            ProfessionalPracticesContext professionalPracticesContext = new ProfessionalPracticesContext();
            UnitOfWork unitOfWork = new UnitOfWork(professionalPracticesContext);

            try
            {
                IEnumerable <Group> thereAreGroups = unitOfWork.Groups.GetAll();
                if (IENumerableHasGroups(thereAreGroups))
                {
                    GroupModifyList groupModify = new GroupModifyList();
                    groupModify.Show();
                    Close();
                }
                else
                {
                    MessageBox.Show("No hay ningún grupo registrado. Por favor registre uno", "Ingreso Faliido", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            catch (EntityException)
            {
                MessageBox.Show("No hay conexión con la base de datos. Intente más tarde", "Ingreso Faliido", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                unitOfWork.Dispose();
            }
        }