Beispiel #1
0
        private void FillGrid()
        {
            table = ReqStudents.RefreshOneStudent(ProvNum);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableReqStudentOne", "Course"), 100);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableReqStudentOne", "Requirement"), 200);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableReqStudentOne", "Done"), 40);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableReqStudentOne", "Patient"), 140);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableReqStudentOne", "Appointment"), 190);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(table.Rows[i]["course"].ToString());
                row.Cells.Add(table.Rows[i]["requirement"].ToString());
                row.Cells.Add(table.Rows[i]["done"].ToString());
                row.Cells.Add(table.Rows[i]["patient"].ToString());
                row.Cells.Add(table.Rows[i]["appointment"].ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
        private void FillGrid()
        {
            if (comboClass.SelectedIndex == -1 || comboCourse.SelectedIndex == -1)
            {
                return;
            }
            long schoolClass  = _listSchoolClasses[comboClass.SelectedIndex].SchoolClassNum;
            long schoolCourse = _listSchoolCourses[comboCourse.SelectedIndex].SchoolCourseNum;

            table = ReqStudents.RefreshManyStudents(schoolClass, schoolCourse);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableReqStudentMany", "Last"), 100);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableReqStudentMany", "First"), 100);
            gridMain.Columns.Add(col);
            //col=new ODGridColumn(Lan.g("TableReqStudentMany","Total"),50);
            //gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableReqStudentMany", "Done"), 50);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(table.Rows[i]["LName"].ToString());
                row.Cells.Add(table.Rows[i]["FName"].ToString());
                //row.Cells.Add(table.Rows[i]["totalreq"].ToString());
                row.Cells.Add(table.Rows[i]["donereq"].ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Beispiel #3
0
        private void FillStudents()
        {
            if (comboClass.SelectedIndex == -1)
            {
                return;
            }
            long schoolClass = _listSchoolClasses[comboClass.SelectedIndex].SchoolClassNum;

            //int schoolCourse=SchoolCourses.List[comboCourse.SelectedIndex].SchoolCourseNum;
            StudentList = ReqStudents.GetStudents(schoolClass);
            gridStudents.BeginUpdate();
            gridStudents.ListGridColumns.Clear();
            GridColumn col = new GridColumn("", 100);

            gridStudents.ListGridColumns.Add(col);
            gridStudents.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < StudentList.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(StudentList[i].LName + ", " + StudentList[i].FName);
                gridStudents.ListGridRows.Add(row);
            }
            gridStudents.EndUpdate();
        }
Beispiel #4
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
     }
     else
     {
         string inuseby = ReqStudents.InUseBy(ReqCur.ReqNeededNum);
         if (inuseby != "")
         {
             MsgBoxCopyPaste msgBox = new MsgBoxCopyPaste(Lan.g(this, "Requirement is already in use by student(s) with grade point(s) attached."
                                                                + "\r\n" + Lan.g(this, "Delete anyway?  Student grades will not be affected."))
                                                          + "\r\n" + inuseby);
             msgBox.ShowDialog();
             if (msgBox.DialogResult != DialogResult.OK)
             {
                 return;
             }
         }
         if (!MsgBox.Show(this, true, "Delete this Requirement?"))
         {
             return;
         }
     }
     ReqCur       = null;
     DialogResult = DialogResult.OK;
 }
        private void FillReqs()
        {
            int schoolCourse = 0;

            if (comboCourse.SelectedIndex != -1)
            {
                schoolCourse = SchoolCourses.List[comboCourse.SelectedIndex].SchoolCourseNum;
            }
            gridReqs.BeginUpdate();
            gridReqs.Columns.Clear();
            ODGridColumn col = new ODGridColumn("", 100);

            gridReqs.Columns.Add(col);
            gridReqs.Rows.Clear();
            if (gridStudents.GetSelectedIndex() == -1)
            {
                gridReqs.EndUpdate();
                return;
            }
            ReqTable = ReqStudents.GetForStudent(StudentList[gridStudents.GetSelectedIndex()].ProvNum, schoolCourse);
            ODGridRow row;

            for (int i = 0; i < ReqTable.Rows.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ReqTable.Rows[i]["Descript"].ToString());
                gridReqs.Rows.Add(row);
            }
            gridReqs.EndUpdate();
        }
Beispiel #6
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
     }
     else
     {
         string inuseby = ReqStudents.InUseBy(ReqCur.ReqNeededNum);
         if (inuseby != "")
         {
             if (MessageBox.Show(Lan.g(this, "Requirement is already in use by student(s) with grade point(s) attached:")
                                 + "\r\n" + inuseby + Lan.g(this, "Delete anyway?  Student grades will not be affected."), "", MessageBoxButtons.OKCancel) != DialogResult.OK)
             {
                 return;
             }
         }
         if (!MsgBox.Show(this, true, "Delete this Requirement?"))
         {
             return;
         }
         try{
             ReqNeededs.Delete(ReqCur.ReqNeededNum);
         }
         catch (Exception ex) {
             MessageBox.Show(ex.Message);
             return;
         }
     }
     DialogResult = DialogResult.OK;
 }
        private void butOK_Click(object sender, EventArgs e)
        {
            List <int> reqNums = new List <int>();

            for (int i = 0; i < TableAttached.Rows.Count; i++)
            {
                reqNums.Add(PIn.PInt(TableAttached.Rows[i]["ReqStudentNum"].ToString()));
            }
            ReqStudents.SynchApt(AptNum, reqNums);
            DialogResult = DialogResult.OK;
        }
Beispiel #8
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     //if(!MsgBox.Show(this,true,"Delete this student requirement?  This is typically handled by using the synch feature from requirements needed.")){
     //	return;
     //}
     try{
         ReqStudents.Delete(ReqCur.ReqStudentNum);                //disallows deleting req that exists in reqNeeded.
         DialogResult = DialogResult.OK;
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #9
0
        private void gridAttached_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            if (hasChanged)
            {
                MsgBox.Show(this, "Not allowed to edit individual requirements immediately after adding or removing.");
                return;
            }
            FormReqStudentEdit FormRSE = new FormReqStudentEdit();

            FormRSE.ReqCur = reqsAttached[e.Row];
            FormRSE.ShowDialog();
            if (FormRSE.DialogResult != DialogResult.OK)
            {
                return;
            }
            reqsAttached = ReqStudents.GetForAppt(AptNum);
            FillAttached();
        }
Beispiel #10
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDateCompleted.Text != "")
     {
         try{
             DateTime.Parse(textDateCompleted.Text);
         }
         catch {
             MsgBox.Show(this, "Date is invalid.");
             return;
         }
     }
     //ReqNeededNum-not editable
     //Descript-not editable
     //SchoolCourseNum-not editable
     //ProvNum-Student not editable
     //AptNum-handled earlier
     //PatNum-handled earlier
     //InstructorNum
     if (comboInstructor.SelectedIndex == 0)
     {
         ReqCur.InstructorNum = 0;
     }
     else
     {
         ReqCur.InstructorNum = ProviderC.ListShort[comboInstructor.SelectedIndex - 1].ProvNum;
     }
     //DateCompleted
     ReqCur.DateCompleted = PIn.Date(textDateCompleted.Text);
     try{
         //if(IsNew){//inserting is always done as part of reqneededs.synch
         //	LabCases.Insert(CaseCur);
         //}
         //else{
         ReqStudents.Update(ReqCur);
         //}
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
Beispiel #11
0
 private void FormReqAppt_Load(object sender, EventArgs e)
 {
     _listSchoolClasses = SchoolClasses.GetDeepCopy();
     _listSchoolCourses = SchoolCourses.GetDeepCopy();
     for (int i = 0; i < _listSchoolClasses.Count; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(_listSchoolClasses[i]));
     }
     if (comboClass.Items.Count > 0)
     {
         comboClass.SelectedIndex = 0;
     }
     for (int i = 0; i < _listSchoolCourses.Count; i++)
     {
         comboCourse.Items.Add(SchoolCourses.GetDescript(_listSchoolCourses[i]));
     }
     if (comboCourse.Items.Count > 0)
     {
         comboCourse.SelectedIndex = 0;
     }
     comboInstructor.Items.Add(Lan.g(this, "None"));
     comboInstructor.SelectedIndex = 0;
     _listProviders = Providers.GetDeepCopy(true);
     for (int i = 0; i < _listProviders.Count; i++)
     {
         comboInstructor.Items.Add(_listProviders[i].GetLongDesc());
         //if(ProviderC.List[i].ProvNum==ReqCur.InstructorNum) {
         //	comboInstructor.SelectedIndex=i+1;
         //}
     }
     FillStudents();
     FillReqs();
     reqsAttached = ReqStudents.GetForAppt(AptNum);
     if (reqsAttached.Count > 0)
     {
         comboInstructor.SelectedIndex = Providers.GetIndex(reqsAttached[0].ProvNum) + 1;            //this will turn a -1 into a 0.
     }
     FillAttached();
 }
Beispiel #12
0
        ///<summary></summary>
        public static void Synch(int schoolClassNum, int schoolCourseNum)
        {
            //get list of all reqneededs for the given class and course.
            DataTable  table = Refresh(schoolClassNum, schoolCourseNum);
            string     command;
            int        reqNeededNum;
            DataTable  tStudent;
            string     descript;
            ReqStudent req;

            //1. Delete any reqstudents that do not have gradepoint
            command = "DELETE FROM reqstudent "
                      + "WHERE NOT EXISTS(SELECT * FROM reqneeded WHERE reqstudent.ReqNeededNum=reqneeded.ReqNeededNum) "
                      + "AND reqstudent.DateCompleted < " + POut.PDate(new DateTime(1880, 1, 1));
            General.NonQ(command);
            for (int i = 0; i < table.Rows.Count; i++)
            {
                reqNeededNum = PIn.PInt(table.Rows[i]["ReqNeededNum"].ToString());
                descript     = PIn.PString(table.Rows[i]["Descript"].ToString());
                //2. Update.  Update the description for all students using this requirement.
                command = "UPDATE reqstudent SET Descript='" + POut.PString(descript) + "' "
                          + "WHERE ReqNeededNum=" + POut.PInt(reqNeededNum);
                General.NonQ(command);
                //3. Insert.  Get list of students that do not have this req.  For each student, insert.
                command = "SELECT ProvNum FROM provider WHERE SchoolClassNum=" + POut.PInt(schoolClassNum)
                          + " AND NOT EXISTS(SELECT * FROM reqstudent WHERE reqstudent.ProvNum=provider.ProvNum"
                          + " AND ReqNeededNum=" + POut.PInt(reqNeededNum) + ")";
                tStudent = General.GetTable(command);
                for (int s = 0; s < tStudent.Rows.Count; s++)
                {
                    req                 = new ReqStudent();
                    req.Descript        = descript;
                    req.ProvNum         = PIn.PInt(tStudent.Rows[s]["ProvNum"].ToString());
                    req.ReqNeededNum    = reqNeededNum;
                    req.SchoolCourseNum = PIn.PInt(table.Rows[i]["SchoolCourseNum"].ToString());
                    ReqStudents.Insert(req);
                }
            }
        }
Beispiel #13
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            //if(IsSelectionMode){
            //	if(table.Rows[e.Row]["appointment"].ToString()!=""){
            //		MsgBox.Show(this,"Already attached to an appointment.");
            //		return;
            //	}
            //	SelectedReqStudentNum=PIn.PInt(table.Rows[e.Row]["ReqStudentNum"].ToString());
            //	DialogResult=DialogResult.OK;
            //}
            //else{
            FormReqStudentEdit FormRSE = new FormReqStudentEdit();

            FormRSE.ReqCur = ReqStudents.GetOne(PIn.Long(table.Rows[e.Row]["ReqStudentNum"].ToString()));
            FormRSE.ShowDialog();
            if (FormRSE.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrid();
            //}
        }
Beispiel #14
0
 private void FormReqAppt_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < SchoolClasses.List.Length; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
     }
     if (comboClass.Items.Count > 0)
     {
         comboClass.SelectedIndex = 0;
     }
     for (int i = 0; i < SchoolCourses.List.Length; i++)
     {
         comboCourse.Items.Add(SchoolCourses.GetDescript(SchoolCourses.List[i]));
     }
     if (comboCourse.Items.Count > 0)
     {
         comboCourse.SelectedIndex = 0;
     }
     FillStudents();
     FillReqs();
     TableAttached = ReqStudents.GetForAppt(AptNum);
     FillAttached();
 }
Beispiel #15
0
        private void FillReqs()
        {
            long schoolCourse = 0;

            if (comboCourse.SelectedIndex != -1)
            {
                schoolCourse = _listSchoolCourses[comboCourse.SelectedIndex].SchoolCourseNum;
            }
            long schoolClass = 0;

            if (comboClass.SelectedIndex != -1)
            {
                schoolClass = _listSchoolClasses[comboClass.SelectedIndex].SchoolClassNum;
            }
            gridReqs.BeginUpdate();
            gridReqs.Columns.Clear();
            ODGridColumn col = new ODGridColumn("", 100);

            gridReqs.Columns.Add(col);
            gridReqs.Rows.Clear();
            if (gridStudents.GetSelectedIndex() == -1)
            {
                gridReqs.EndUpdate();
                return;
            }
            ReqTable = ReqStudents.GetForCourseClass(schoolCourse, schoolClass);
            ODGridRow row;

            for (int i = 0; i < ReqTable.Rows.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ReqTable.Rows[i]["Descript"].ToString());
                gridReqs.Rows.Add(row);
            }
            gridReqs.EndUpdate();
        }
Beispiel #16
0
 private void butOK_Click(object sender, EventArgs e)
 {
     ReqStudents.SynchApt(reqsAttached, _listReqsRemoved, AptNum);
     DialogResult = DialogResult.OK;
 }