Пример #1
0
        public void EditSeasons(IDiscipline discipline)
        {
            HideAllUserControls();
            SeasonOverview seasonOverview = new SeasonOverview(this);

            AddCustomControl("Season", seasonOverview);
            GrdMain.Children.Add(seasonOverview);
        }
 public void RemoveDiscipline(IDiscipline discipline)
 {
     try
     {
         disciplineRepository.RemoveDiscipline(discipline.Name);
     }
     catch (DatabaseException ex)
     {
         throw new ConnectionException(ex.Message);
     }
 }
Пример #3
0
        public static List<ITeacher> GetTeachersByDiscipline(IDiscipline discipline)
        {
            var result = new List<ITeacher>();

            foreach (var dis in disciplines)
            {
                if (dis.Name == discipline.Name)
                {
                    result.AddRange(dis.Teachers);
                }
            }

            return result;
        }
Пример #4
0
        public static List <ITeacher> GetTeachersByDiscipline(IDiscipline discipline)
        {
            var result = new List <ITeacher>();

            foreach (var dis in disciplines)
            {
                if (dis.Name == discipline.Name)
                {
                    result.AddRange(dis.Teachers);
                }
            }

            return(result);
        }
Пример #5
0
        /// <summary>
        /// Creates the edit discipling view.
        /// </summary>
        /// <param name="discipline">The discipline.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="queryStatusCollecction">The query status collecction.</param>
        /// <param name="actionTaken">The action taken.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// queryStatusCollecction
        /// or
        /// actionTaken
        /// or
        /// employeeCollection
        /// </exception>
        public IDisciplineView CreateEditDisciplingView(IDiscipline discipline, IList <IEmployee> employeeCollection, IList <IQueryStatus> queryStatusCollecction, IList <IActionTaken> actionTaken)
        {
            if (queryStatusCollecction == null)
            {
                throw new ArgumentNullException(nameof(queryStatusCollecction));
            }

            if (actionTaken == null)
            {
                throw new ArgumentNullException(nameof(actionTaken));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }


            var queryDDL = GetDropDownList.QueryStatusListItem(queryStatusCollecction, discipline.QueryStatusId);

            var actionTakenDDL = GetDropDownList.ActionTakenListItem(actionTaken, discipline.ActionTakenId);

            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, discipline.EmployeeId);

            var result = new DisciplineView
            {
                DisciplineId        = discipline.DisciplineId,
                EmployeeId          = discipline.EmployeeId,
                QueryStatusId       = discipline.QueryStatusId,
                QueryDate           = discipline.QueryDate,
                Offence             = discipline.Offence,
                QueryInitiator      = discipline.QueryInitiator,
                Investigator        = discipline.Investigator,
                Response            = discipline.Response,
                InvestigatorReport  = discipline.InvestigatorReport,
                RecommendedSanction = discipline.RecommendedSanction,
                DisciplineCommitteeRecommendation = discipline.DisciplineCommitteeRecommendation,
                ActionTakenId         = discipline.ActionTakenId,
                EvidenceDigitalFileId = discipline.EvidenceDigitalFileId,
                DateCreated           = discipline.DateCreated,
                CompanyId             = discipline.CompanyId,
                QueryDropDown         = queryDDL,
                ActionTakenDropDown   = actionTakenDDL,
                EmployeeDropDown      = employeeDDL,
                ProcessingMessage     = string.Empty
            };

            return(result);
        }
        private void BtnRemoveDiscipline_Click(object sender, RoutedEventArgs e)
        {
            if (LvDisciplines.SelectedIndex >= 0)
            {
                IDiscipline selectedDiscipline = LvDisciplines.SelectedItem as IDiscipline;
                try
                {
                    disciplineCollection.RemoveDiscipline(selectedDiscipline);
                }
                catch (Exception exception)
                {
                    MessageBox.Show($"Could not remove the disciplines\nError: {exception.Message}", "Error",
                                    MessageBoxButton.OK, MessageBoxImage.Error);
                }

                UpdateUi();
            }
        }
Пример #7
0
        public static List <IClassroom> GetClassroomsByDiscipline(IDiscipline discipline)
        {
            var result = new List <IClassroom>();

            foreach (var classroom in classrooms)
            {
                foreach (var dis in classroom.Disciplines)
                {
                    if (dis.Name != discipline.Name)
                    {
                        continue;
                    }

                    result.Add(classroom);
                    break;
                }
            }

            return(result);
        }
Пример #8
0
        public static List<IClassroom> GetClassroomsByDiscipline(IDiscipline discipline)
        {
            var result = new List<IClassroom>();

            foreach (var classroom in classrooms)
            {
                foreach (var dis in classroom.Disciplines)
                {
                    if (dis.Name != discipline.Name)
                    {
                        continue;
                    }

                    result.Add(classroom);
                    break;
                }
            }

            return result;
        }
Пример #9
0
 public static void AddDisciplineToDatabase(IDiscipline discipline)
 {
     disciplines.Add(discipline);
 }
Пример #10
0
 public void AddDiscipline(IDiscipline discipline)
 {
     this.disciplines.Add(discipline);
 }
Пример #11
0
 public Classroom(string identifier, IDiscipline discipline)
     : this(identifier, new List<IDiscipline>() { discipline })
 {
 }
Пример #12
0
 public QuestionAnswerController(IDiscipline_QuestionAnswer idiscipline_QuestionAnswer, IDiscipline idiscipline)
 {
     _idiscipline_QuestionAnswer = idiscipline_QuestionAnswer;
     _idiscipline = idiscipline;
 }
Пример #13
0
 public Teacher(string name, IDiscipline discipline, string details = null)
     : this(name, new List <IDiscipline>() { discipline }, details)
 {
 }
Пример #14
0
 public void AddDiscipline(IDiscipline discipline)
 {
     this.disciplines.Add(discipline);
 }
Пример #15
0
 public Classroom(string identifier, IDiscipline discipline)
     : this(identifier, new List <IDiscipline>() { discipline })
 {
 }
Пример #16
0
 public DisciplineController(IDiscipline idiscipline)
 {
     _idiscipline = idiscipline;
 }
Пример #17
0
 public Teacher(string name, IDiscipline discipline, string details = null)
     : this(name, new List<IDiscipline>() { discipline }, details)
 {
 }
Пример #18
0
 public void AddDiscipline(IDiscipline disciplines)
 {
     _disciplines.Add(disciplines);
 }
Пример #19
0
 public static void AddDisciplineToDatabase(IDiscipline discipline)
 {
     disciplines.Add(discipline);
 }