Esempio n. 1
0
        private void SelectionFormPopup(SubjectSelection selection)
        {
            SelectionForm form = new SelectionForm();

            form.SetSelection(selection);
            form.Show();

            form.FormClosed += SelectionForm_Closed;
        }
Esempio n. 2
0
        private void BuildSubjects()
        {
            int protocolId = int.Parse(BaseProtocolId);
            string datasetSQL = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]) + "";
            DataTable patients = ProtocolMgmtDa.GetPatientsByProtocol(protocolId, datasetSQL, base.ShowPatientIdentifiers(), true);

            SubjectSelection.DataSource = patients;
            SubjectSelection.DataBind();
        }
 public List <LectureTime> GetBySelection(SubjectSelection selection)
 {
     return(connection.Query <LectureTime>(
                "SELECT Id, Time FROM LectureTime WHERE Id IN " +
                "(SELECT LectureTimeId FROM Selection_Time " +
                "WHERE SelectionId = @Id)",
                new { selection.Id })
            .AsList());
 }
Esempio n. 4
0
        public bool Add_Preferred_Selection(SubjectSelection selection)
        {
            if (Add_Selection_To_Table(selection))
            {
                Preferred_Selections_Id.Add(selection.Id);
                return(true);
            }

            return(false);
        }
Esempio n. 5
0
 public void AddSubjectSelection(SubjectSelection selection)
 {
     foreach (LectureTime time in selection.Times)
     {
         for (int i = time.Start_Period; i <= time.End_Period; ++i)
         {
             Table[(int)time.Day, i - 1].Value = selection.Subject.Codename;
         }
     }
     Table.ClearSelection();
 }
Esempio n. 6
0
 private void AddToTable(SubjectSelection selection)
 {
     all_selections.Rows.Add(
         selection.Id,
         selection.Subject,
         selection.Hall,
         Lecturer.LecturersToString(selection.Lecturers),
         LectureTime.TimeListToString(selection.Times),
         selection.ToString()
         );
 }
Esempio n. 7
0
 private void Remove_Selection_From_Table(SubjectSelection selection)
 {
     foreach (LectureTime time in selection.Times)
     {
         for (int period = time.Start_Period - 1; period <= time.End_Period; ++period)
         {
             if (table[(int)time.Day, period] == selection.SubjectId)
             {
                 Set_Period(period, time.Day, 0);
             }
         }
     }
 }
Esempio n. 8
0
        public void SetSelection(SubjectSelection selection)
        {
            this.selection = selection;
            deep_copy      = new SubjectSelection(selection);
            New            = (selection.Id == 0);

            //BindData();
            SubjectCombobox.SelectedValue = selection.SubjectId;
            HallCombobox.SelectedValue    = selection.HallId;

            TimetableControl.AddSubjectAndTimes(
                selection.Subject,
                selection.Times);
        }
Esempio n. 9
0
 public void RemoveSubjectSelection(SubjectSelection selection)
 {
     foreach (LectureTime time in selection.Times)
     {
         for (int i = time.Start_Period; i <= time.End_Period; ++i)
         {
             if (Table[(int)time.Day, i].Value.ToString()
                 == selection.Subject.Codename)
             {
                 Table[(int)time.Day, i].Value = "";
             }
         }
     }
 }
Esempio n. 10
0
 private void UpdateInTable(SubjectSelection selection)
 {
     foreach (DataRow row in all_selections.Rows)
     {
         if (Convert.ToInt32(row["Id"]) == selection.Id)
         {
             row["Subject"]   = selection.Subject;
             row["Hall"]      = selection.Hall;
             row["Lecturers"] = Lecturer.LecturersToString(selection.Lecturers);
             row["Times"]     = LectureTime.TimeListToString(selection.Times);
             row["Filter"]    = selection.ToString();
         }
     }
 }
Esempio n. 11
0
        private bool Add_Selection_To_Table(SubjectSelection selection)
        {
            foreach (LectureTime time in selection.Times)
            {
                for (int period = time.Start_Period; period <= time.End_Period; ++period)
                {
                    if (Period_Used(period, time.Day))
                    {
                        return(false);
                    }
                    else
                    {
                        Set_Period(period, time.Day, selection.SubjectId);
                    }
                }
            }

            return(true);
        }
Esempio n. 12
0
 private void SetAfterInsert()
 {
     deep_copy = new SubjectSelection(selection);
     selection = new SubjectSelection();
     TimetableControl.ResetLectureTimes();
 }
 public void Remove_Preferred_Selection(SubjectSelection selection)
 {
     Generator.Remove_Preferred_Selection(selection);
 }
 public bool Add_Preferred_Selection(SubjectSelection selection)
 {
     return(Generator.Add_Preferred_Selection(selection));
 }
Esempio n. 15
0
 public void Remove_Preferred_Selection(SubjectSelection selection)
 {
     Preferred_Selections_Id.Remove(selection.Id);
     Remove_Selection_From_Table(selection);
 }
 public LectureHall GetBySelection(SubjectSelection selection)
 {
     return(connection.QueryFirst <LectureHall>(
                "SELECT * FROM LectureHall WHERE Id = @Id",
                new { selection.HallId }));
 }