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

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

            form.FormClosed += SelectionForm_Closed;
        }
Ejemplo 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());
 }
Ejemplo 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);
        }
Ejemplo 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();
 }
Ejemplo 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()
         );
 }
Ejemplo 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);
             }
         }
     }
 }
Ejemplo 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);
        }
Ejemplo 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 = "";
             }
         }
     }
 }
Ejemplo 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();
         }
     }
 }
Ejemplo 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);
        }
Ejemplo 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));
 }
Ejemplo 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 }));
 }