コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Do any additional setup after loading the view.
            var listHours = new List <string>(new string[] { "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16" });
            var students  = Backendoptions.GetAllStudents();
            var subjects  = Backendoptions.GetSubjects();
            var classes   = Backendoptions.GetClasses();
            var parents   = Backendoptions.GetAllParents();
            var teachers  = Backendoptions.GetTeachers();
            var rooms     = Backendoptions.GetRooms();
            var units     = Backendoptions.GetUnits();
            var profiles  = Backendoptions.GetProfiles();
            var status    = Backendoptions.GetStatuses();

            if (Backendoptions.IsParent())
            {
                string stringinfo = "dzieci pod moją opieką:\n";
                var    child      = Backendoptions.GetChildren();
                foreach (var ch in child)
                {
                    stringinfo = stringinfo + " " + ch + ",";
                }
                PMyInfo.StringValue       = stringinfo.Remove(stringinfo.Length - 1);
                PChildList.UsesDataSource = true;
                PChildList.DataSource     = new MyCombo(child);
                PChildList.Editable       = false;
                PChildList.SelectItem(0);
                if (Backendoptions.IsChildSet())
                {
                    PNotes.StringValue         = Backendoptions.GetMyChildPresance(); //Yes, presance - i've done a mistake while creating names in a builder
                    PPresance.StringValue      = Backendoptions.GetMyChildNotes();    //so here are notes
                    PWarnings.StringValue      = Backendoptions.GetMyChildWarnings();
                    PLegitimize.UsesDataSource = true;
                    PLegitimize.DataSource     = new MyCombo(Backendoptions.GetAbsence());
                }
            }
            else
            {
                if (Backendoptions.IsAdmin())
                {
                    AStList.StringValue  = Backendoptions.GetAllStudentsData();
                    AParList.StringValue = Backendoptions.GetAllParentsData();

                    ATeaList.StringValue   = Backendoptions.GetAllTeachersData();
                    AAUnitH.UsesDataSource = true;
                    AAUnitH.DataSource     = new MyCombo(listHours);
                    AAUnitH.Editable       = false;
                    AAUnitH.SelectItem(0);
                    AAddStClass.UsesDataSource   = true;
                    AAddStClass.DataSource       = new MyCombo(classes);
                    AAddStClass.Editable         = false;
                    AGrillParent.UsesDataSource  = true;
                    AGrillStudent.UsesDataSource = true;
                    AGrillStudent.DataSource     = new MyCombo(students);
                    AGrillStudent.Editable       = false;
                    AGrillParent.DataSource      = new MyCombo(parents);
                    AGrillParent.Editable        = false;

                    ACForm.UsesDataSource  = true;
                    ACClass.UsesDataSource = true;
                    ACForm.DataSource      = new MyCombo(teachers);
                    ACForm.Editable        = false;

                    ACClass.DataSource       = new MyCombo(classes);
                    ACClass.Editable         = false;
                    AALessSub.UsesDataSource = true;
                    AALessUH.UsesDataSource  = true;
                    AALessRR.UsesDataSource  = true;
                    AALessDay.UsesDataSource = true;
                    AALessClL.UsesDataSource = true;
                    var listDay = new List <string>(new string[] { "1", "2", "3", "4", "5", "6" });
                    AALessDay.DataSource = new MyCombo(listDay);
                    AALessDay.Editable   = false;
                    AALessDay.SelectItem(0);
                    AALessSub.DataSource = new MyCombo(subjects);
                    AALessSub.Editable   = false;
                    AALessRR.DataSource  = new MyCombo(rooms);
                    AALessRR.Editable    = false;
                    if (rooms.Count > 0)
                    {
                        AALessRR.SelectItem(0);
                    }
                    AALessUH.DataSource = new MyCombo(units);
                    AALessUH.Editable   = false;
                    AALessUH.SelectItem(0);
                    AALessClL.DataSource          = new MyCombo(classes);
                    AALessClL.Editable            = false;
                    AAClassProfile.UsesDataSource = true;
                    AAClassProfile.DataSource     = new MyCombo(profiles);
                    AAClassProfile.Editable       = false;

                    AAClassForm.UsesDataSource = true;
                    AAClassForm.DataSource     = new MyCombo(teachers);
                    AAClassForm.Editable       = false;
                    ADelPar.UsesDataSource     = true;
                    ADelPar.DataSource         = new MyCombo(parents);
                    ADelPar.Editable           = false;
                    ADelSt.UsesDataSource      = true;
                    ADelSt.DataSource          = new MyCombo(students);
                    ADelSt.Editable            = false;

                    ADelTea.UsesDataSource = true;
                    ADelTea.DataSource     = new MyCombo(teachers);
                    ADelTea.Editable       = false;

                    AChSt.UsesDataSource = true;
                    AChSt.DataSource     = new MyCombo(students);
                    AChSt.Editable       = false;

                    AchCl.UsesDataSource        = true;
                    AchCl.DataSource            = new MyCombo(classes);
                    AchCl.Editable              = false;
                    ADelGrillPar.UsesDataSource = true;
                    ADelGrillPar.DataSource     = new MyCombo(parents);
                    ADelGrillPar.Editable       = false;
                    ADelGrillSt.UsesDataSource  = true;
                    ADelGrillSt.DataSource      = new MyCombo(students);
                    ADelGrillSt.Editable        = false;
                    if (classes.Count > 0)
                    {
                        AAddStClass.SelectItem(0);
                        ACClass.SelectItem(0);
                        AALessClL.SelectItem(0);
                        AchCl.SelectItem(0);
                    }
                    if (students.Count > 0)
                    {
                        AGrillStudent.SelectItem(0);
                        ADelGrillSt.SelectItem(0);
                        AChSt.SelectItem(0);
                        ADelSt.SelectItem(0);
                    }
                    if (parents.Count > 0)
                    {
                        AGrillParent.SelectItem(0);
                        ADelPar.SelectItem(0);
                        ADelGrillPar.SelectItem(0);
                    }
                    if (teachers.Count > 0)
                    {
                        ADelTea.SelectItem(0);
                        ACForm.SelectItem(0);
                        AAClassForm.SelectItem(0);
                    }
                }
                else
                {
                    if (Backendoptions.IsTeacher())
                    {
                        TClass.UsesDataSource = true;
                        TClass.DataSource     = new MyCombo(classes);
                        TClass.Editable       = false;
                        if (Backendoptions.IsClassSet())
                        {
                            if (Backendoptions.GetStudents().Count != 0)
                            {
                                var classstudents = Backendoptions.GetStudents();
                                TWSt.UsesDataSource   = true;
                                TWSt.DataSource       = new MyCombo(classstudents);
                                TWSt.Editable         = false;
                                TNSt.UsesDataSource   = true;
                                TNSt.DataSource       = new MyCombo(classstudents);
                                TNSt.Editable         = false;
                                TPreSt.UsesDataSource = true;
                                TPreSt.DataSource     = new MyCombo(classstudents);
                                TPreSt.Editable       = false;
                                TWSt.SelectItem(0);
                                TNSt.SelectItem(0);
                                TPreSt.SelectItem(0);
                                TCNSt.UsesDataSource = true;
                                TCNSt.DataSource     = new MyCombo(classstudents);
                                TCNSt.Editable       = false;
                                TCNSt.SelectItem(0);
                                string studentsstring = "", presance = "";
                                foreach (var st in classstudents)
                                {
                                    studentsstring = studentsstring + st + "\n";
                                }
                                TCheckStudent.StringValue  = studentsstring;
                                TCheckStudent.Editable     = false;
                                TCheckPresance.StringValue = presance;
                                TCNDesc.UsesDataSource     = true;
                                TCNDesc.DataSource         = new MyCombo(Backendoptions.GetLastNotes());
                                TCNDesc.Editable           = false;
                                var best = Backendoptions.GetTopThree();
                                TBest1.StringValue      = best;
                                TPreUnit.UsesDataSource = true;
                                TPreUnit.DataSource     = new MyCombo(Backendoptions.LastLessonsForClass());
                                TPreUnit.Editable       = false;
                            }
                        }
                        TNVal.UsesDataSource = true;
                        TNCat.UsesDataSource = true;
                        TNSub.UsesDataSource = true;
                        var values = new List <string>(new string[] { "1", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6" });
                        TNVal.DataSource        = new MyCombo(values);
                        TNVal.Editable          = false;
                        TCNVal.UsesDataSource   = true;
                        TCNVal.DataSource       = new MyCombo(values);
                        TCNVal.Editable         = false;
                        TNSub.DataSource        = new MyCombo(subjects);
                        TNSub.Editable          = false;
                        TNCat.DataSource        = new MyCombo(Backendoptions.GetCategories());
                        TNCat.Editable          = false;
                        TPreStat.UsesDataSource = true;
                        TPrUnit.UsesDataSource  = true;
                        TPrUnit.DataSource      = new MyCombo(units);
                        TPrUnit.Editable        = false;
                        TPreStat.DataSource     = new MyCombo(status);
                        TPreStat.Editable       = false;
                        TClass.SelectItem(0);
                        TNVal.SelectItem(0);
                        TNSub.SelectItem(0);
                        TNCat.SelectItem(0);
                        TPreStat.SelectItem(0);
                        TPrUnit.SelectItem(0);
                        TCNVal.SelectItem(0);
                    }
                    else
                    {
                        if (Backendoptions.IsStudent())
                        {
                            var warning = Backendoptions.GetMydWarnings();
                            SWarnings.StringValue = warning.Item1;
                            SPoints.StringValue   = warning.Item2.ToString();
                            SNotes.StringValue    = Backendoptions.GetMyNotes();
                            SPresance.StringValue = Backendoptions.GetMyPresance();
                            SyInfo.StringValue    = Backendoptions.GetMyStudentInfo();
                        }
                    }
                }
            }
        }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (AStList != null)
            {
                AStList.Dispose();
                AStList = null;
            }

            if (AParList != null)
            {
                AParList.Dispose();
                AParList = null;
            }

            if (ATeaList != null)
            {
                ATeaList.Dispose();
                ATeaList = null;
            }

            if (AAClassForm != null)
            {
                AAClassForm.Dispose();
                AAClassForm = null;
            }

            if (AAClassLetter != null)
            {
                AAClassLetter.Dispose();
                AAClassLetter = null;
            }

            if (AAClassProfile != null)
            {
                AAClassProfile.Dispose();
                AAClassProfile = null;
            }

            if (AAClassYear != null)
            {
                AAClassYear.Dispose();
                AAClassYear = null;
            }

            if (AAddClErr != null)
            {
                AAddClErr.Dispose();
                AAddClErr = null;
            }

            if (AAddGrillErr != null)
            {
                AAddGrillErr.Dispose();
                AAddGrillErr = null;
            }

            if (AAddLessErr != null)
            {
                AAddLessErr.Dispose();
                AAddLessErr = null;
            }

            if (AAddParErr != null)
            {
                AAddParErr.Dispose();
                AAddParErr = null;
            }

            if (AAddProfile != null)
            {
                AAddProfile.Dispose();
                AAddProfile = null;
            }

            if (AAddProfileErr != null)
            {
                AAddProfileErr.Dispose();
                AAddProfileErr = null;
            }

            if (AAddRoomErr != null)
            {
                AAddRoomErr.Dispose();
                AAddRoomErr = null;
            }

            if (AAddStClass != null)
            {
                AAddStClass.Dispose();
                AAddStClass = null;
            }

            if (AAddStErr != null)
            {
                AAddStErr.Dispose();
                AAddStErr = null;
            }

            if (AAddStHome != null)
            {
                AAddStHome.Dispose();
                AAddStHome = null;
            }

            if (AAddStLast != null)
            {
                AAddStLast.Dispose();
                AAddStLast = null;
            }

            if (AAddStMail != null)
            {
                AAddStMail.Dispose();
                AAddStMail = null;
            }

            if (AAddStName != null)
            {
                AAddStName.Dispose();
                AAddStName = null;
            }

            if (AAddStNum != null)
            {
                AAddStNum.Dispose();
                AAddStNum = null;
            }

            if (AAddStPesel != null)
            {
                AAddStPesel.Dispose();
                AAddStPesel = null;
            }

            if (AAddStRegNum != null)
            {
                AAddStRegNum.Dispose();
                AAddStRegNum = null;
            }

            if (AAddSubErr != null)
            {
                AAddSubErr.Dispose();
                AAddSubErr = null;
            }

            if (AAddTeaErr != null)
            {
                AAddTeaErr.Dispose();
                AAddTeaErr = null;
            }

            if (AAddUnitErr != null)
            {
                AAddUnitErr.Dispose();
                AAddUnitErr = null;
            }

            if (AALessClL != null)
            {
                AALessClL.Dispose();
                AALessClL = null;
            }

            if (AALessClY != null)
            {
                AALessClY.Dispose();
                AALessClY = null;
            }

            if (AALessDay != null)
            {
                AALessDay.Dispose();
                AALessDay = null;
            }

            if (AALessRF != null)
            {
                AALessRF.Dispose();
                AALessRF = null;
            }

            if (AALessRR != null)
            {
                AALessRR.Dispose();
                AALessRR = null;
            }

            if (AALessSub != null)
            {
                AALessSub.Dispose();
                AALessSub = null;
            }

            if (AALessUH != null)
            {
                AALessUH.Dispose();
                AALessUH = null;
            }

            if (AALessUM != null)
            {
                AALessUM.Dispose();
                AALessUM = null;
            }

            if (AAParHome != null)
            {
                AAParHome.Dispose();
                AAParHome = null;
            }

            if (AAParLast != null)
            {
                AAParLast.Dispose();
                AAParLast = null;
            }

            if (AAParMail != null)
            {
                AAParMail.Dispose();
                AAParMail = null;
            }

            if (AAParMoney != null)
            {
                AAParMoney.Dispose();
                AAParMoney = null;
            }

            if (AAParNa != null)
            {
                AAParNa.Dispose();
                AAParNa = null;
            }

            if (AAParNum != null)
            {
                AAParNum.Dispose();
                AAParNum = null;
            }

            if (AAParPe != null)
            {
                AAParPe.Dispose();
                AAParPe = null;
            }

            if (AARoomChairs != null)
            {
                AARoomChairs.Dispose();
                AARoomChairs = null;
            }

            if (AARoomFloor != null)
            {
                AARoomFloor.Dispose();
                AARoomFloor = null;
            }

            if (AARoomRoom != null)
            {
                AARoomRoom.Dispose();
                AARoomRoom = null;
            }

            if (AASub != null)
            {
                AASub.Dispose();
                AASub = null;
            }

            if (AATaNa != null)
            {
                AATaNa.Dispose();
                AATaNa = null;
            }

            if (AATeaHome != null)
            {
                AATeaHome.Dispose();
                AATeaHome = null;
            }

            if (AATeaLast != null)
            {
                AATeaLast.Dispose();
                AATeaLast = null;
            }

            if (AATeaMail != null)
            {
                AATeaMail.Dispose();
                AATeaMail = null;
            }

            if (AATeaName != null)
            {
                AATeaName.Dispose();
                AATeaName = null;
            }

            if (AATeaPe != null)
            {
                AATeaPe.Dispose();
                AATeaPe = null;
            }

            if (AATeaPhone != null)
            {
                AATeaPhone.Dispose();
                AATeaPhone = null;
            }

            if (AATeaWork != null)
            {
                AATeaWork.Dispose();
                AATeaWork = null;
            }

            if (AAUnitH != null)
            {
                AAUnitH.Dispose();
                AAUnitH = null;
            }

            if (AAUnitM != null)
            {
                AAUnitM.Dispose();
                AAUnitM = null;
            }

            if (ACClass != null)
            {
                ACClass.Dispose();
                ACClass = null;
            }

            if (ACForm != null)
            {
                ACForm.Dispose();
                ACForm = null;
            }

            if (AchCl != null)
            {
                AchCl.Dispose();
                AchCl = null;
            }

            if (AChClass != null)
            {
                AChClass.Dispose();
                AChClass = null;
            }

            if (AChClErr != null)
            {
                AChClErr.Dispose();
                AChClErr = null;
            }

            if (AChFormEr != null)
            {
                AChFormEr.Dispose();
                AChFormEr = null;
            }

            if (AChFormErr != null)
            {
                AChFormErr.Dispose();
                AChFormErr = null;
            }

            if (AChSt != null)
            {
                AChSt.Dispose();
                AChSt = null;
            }

            if (ADelgrillErr != null)
            {
                ADelgrillErr.Dispose();
                ADelgrillErr = null;
            }

            if (ADelGrillPar != null)
            {
                ADelGrillPar.Dispose();
                ADelGrillPar = null;
            }

            if (ADelGrillSt != null)
            {
                ADelGrillSt.Dispose();
                ADelGrillSt = null;
            }

            if (ADelPar != null)
            {
                ADelPar.Dispose();
                ADelPar = null;
            }

            if (ADelParErr != null)
            {
                ADelParErr.Dispose();
                ADelParErr = null;
            }

            if (ADelSt != null)
            {
                ADelSt.Dispose();
                ADelSt = null;
            }

            if (ADelStErr != null)
            {
                ADelStErr.Dispose();
                ADelStErr = null;
            }

            if (ADelTea != null)
            {
                ADelTea.Dispose();
                ADelTea = null;
            }

            if (ADelteaErr != null)
            {
                ADelteaErr.Dispose();
                ADelteaErr = null;
            }

            if (AGrillParent != null)
            {
                AGrillParent.Dispose();
                AGrillParent = null;
            }

            if (AGrillStudent != null)
            {
                AGrillStudent.Dispose();
                AGrillStudent = null;
            }

            if (PChildList != null)
            {
                PChildList.Dispose();
                PChildList = null;
            }

            if (PeselInput != null)
            {
                PeselInput.Dispose();
                PeselInput = null;
            }

            if (PLegitimize != null)
            {
                PLegitimize.Dispose();
                PLegitimize = null;
            }

            if (PLegitimizeErr != null)
            {
                PLegitimizeErr.Dispose();
                PLegitimizeErr = null;
            }

            if (PMyInfo != null)
            {
                PMyInfo.Dispose();
                PMyInfo = null;
            }

            if (PNotes != null)
            {
                PNotes.Dispose();
                PNotes = null;
            }

            if (PPresance != null)
            {
                PPresance.Dispose();
                PPresance = null;
            }

            if (PWarnings != null)
            {
                PWarnings.Dispose();
                PWarnings = null;
            }

            if (SNotes != null)
            {
                SNotes.Dispose();
                SNotes = null;
            }

            if (SPoints != null)
            {
                SPoints.Dispose();
                SPoints = null;
            }

            if (SPresance != null)
            {
                SPresance.Dispose();
                SPresance = null;
            }

            if (SWarnings != null)
            {
                SWarnings.Dispose();
                SWarnings = null;
            }

            if (SyInfo != null)
            {
                SyInfo.Dispose();
                SyInfo = null;
            }

            if (TAddCatErr != null)
            {
                TAddCatErr.Dispose();
                TAddCatErr = null;
            }

            if (TBest1 != null)
            {
                TBest1.Dispose();
                TBest1 = null;
            }

            if (TCatNam != null)
            {
                TCatNam.Dispose();
                TCatNam = null;
            }

            if (TCatWeight != null)
            {
                TCatWeight.Dispose();
                TCatWeight = null;
            }

            if (TChaPrErr != null)
            {
                TChaPrErr.Dispose();
                TChaPrErr = null;
            }

            if (TCheckPresance != null)
            {
                TCheckPresance.Dispose();
                TCheckPresance = null;
            }

            if (TCheckStudent != null)
            {
                TCheckStudent.Dispose();
                TCheckStudent = null;
            }

            if (TChePrErr != null)
            {
                TChePrErr.Dispose();
                TChePrErr = null;
            }

            if (TClass != null)
            {
                TClass.Dispose();
                TClass = null;
            }

            if (TCNDesc != null)
            {
                TCNDesc.Dispose();
                TCNDesc = null;
            }

            if (TCNSt != null)
            {
                TCNSt.Dispose();
                TCNSt = null;
            }

            if (TCNVal != null)
            {
                TCNVal.Dispose();
                TCNVal = null;
            }

            if (TErrNote != null)
            {
                TErrNote.Dispose();
                TErrNote = null;
            }

            if (TErrNoteChange != null)
            {
                TErrNoteChange.Dispose();
                TErrNoteChange = null;
            }

            if (TErrWar != null)
            {
                TErrWar.Dispose();
                TErrWar = null;
            }

            if (TextOnFirstPage != null)
            {
                TextOnFirstPage.Dispose();
                TextOnFirstPage = null;
            }

            if (TMyInfo != null)
            {
                TMyInfo.Dispose();
                TMyInfo = null;
            }

            if (TNCat != null)
            {
                TNCat.Dispose();
                TNCat = null;
            }

            if (TNDesc != null)
            {
                TNDesc.Dispose();
                TNDesc = null;
            }

            if (TNSt != null)
            {
                TNSt.Dispose();
                TNSt = null;
            }

            if (TNSub != null)
            {
                TNSub.Dispose();
                TNSub = null;
            }

            if (TNVal != null)
            {
                TNVal.Dispose();
                TNVal = null;
            }

            if (TPreSt != null)
            {
                TPreSt.Dispose();
                TPreSt = null;
            }

            if (TPreStat != null)
            {
                TPreStat.Dispose();
                TPreStat = null;
            }

            if (TPreUnit != null)
            {
                TPreUnit.Dispose();
                TPreUnit = null;
            }

            if (TPrUnit != null)
            {
                TPrUnit.Dispose();
                TPrUnit = null;
            }

            if (TWDesc != null)
            {
                TWDesc.Dispose();
                TWDesc = null;
            }

            if (TWPoints != null)
            {
                TWPoints.Dispose();
                TWPoints = null;
            }

            if (TWSt != null)
            {
                TWSt.Dispose();
                TWSt = null;
            }
        }