public AddStudentViewModel()
        {
            Schools.Add(new SchoolViewModel()
            {
                Id = 1, Name = "IIA"
            });
            Schools.Add(new SchoolViewModel()
            {
                Id = 2, Name = "XXX"
            });

            Student = new StudentViewModel();
        }
        public async void Get()
        {
            var jData = await DataService.Get($"School/{Preferences.Get("TeamId", "")}");

            if (jData == "ConnectionError")
            {
                StandardMessagesDisplay.NoConnectionToast();
            }
            else if (jData == "null")
            {
                StandardMessagesDisplay.NoDataDisplayMessage();
            }
            else if (jData == "Error")
            {
                StandardMessagesDisplay.Error();
            }
            else if (jData == "ErrorTracked")
            {
                StandardMessagesDisplay.ErrorTracked();
            }
            else
            {
                try
                {
                    var data = JsonConvert.DeserializeObject <Dictionary <string, SchoolModel> >(jData);

                    if (data != null)
                    {
                        foreach (KeyValuePair <string, SchoolModel> item in data)
                        {
                            Schools?.Add(
                                new SchoolModel
                            {
                                FId           = item.Key.ToString(),
                                Id            = item.Value.Id,
                                KeyInfluencer = item.Value.KeyInfluencer,
                                SchoolName    = item.Value.SchoolName,
                                Longitude     = item.Value.Longitude,
                                Latitude      = item.Value.Latitude
                            }
                                );
                        }
                    }
                }
                catch (Exception ex)
                {
                    Crashes.TrackError(ex);
                    StandardMessagesDisplay.InputToast(ex.Message);
                }
            }
        }
示例#3
0
        public Warrior()
        {
            ID          = 1;
            Name        = "Warrior";
            ClassColour = "red";
            Description = "Born and bred for war, this class excels in all things physical. Using their brute MIGHT and CONSTITUTION the Warrior can cleave a path wherever they so desire";

            Schools.Add(new Warfare()
            {
            });
            Schools.Add(new Pyromancy()
            {
            });
        }
示例#4
0
        public SchoolProgressViewModel()
        {
            ViewSource        = new CollectionViewSource();
            ViewSource.Source = Schools;

            SelectedYear = Years[0];
            _bigMargin   = new Thickness(26, 0, 26, 0);
            _smallMargin = new Thickness(20, 0, 20, 0);
            Margin       = SmallMargin;
            Schools.Add(School);

            StationManager.RefreshYearListEvent += () =>
            {
                Years = StationManager.DataStorage.GetYears();
                OnPropertyChanged("StYears");
            };
        }
示例#5
0
        public Mage()
        {
            ID          = 3;
            Name        = "Mage";
            ClassColour = "blue";
            Description = "Calling upon their WISDOM and INTELLIGENCE, the Mage can diffuse any situation with a carefully cast spell or apt potion";

            Schools.Add(new Pyromancy()
            {
            });
            Schools.Add(new Hydromancy()
            {
            });
            Schools.Add(new Geomancy()
            {
            });
            Schools.Add(new Aeromancy()
            {
            });
            Schools.Add(new Arcana()
            {
            });
        }
示例#6
0
 public virtual void AddSchool(School newSchool)
 {
     //newSchool.Users.Add(this);
     Schools.Add(newSchool);
 }
示例#7
0
        public VSContext(DbContextOptions options) : base(options)
        {
            Database.EnsureCreated();

            //инициализация стартовыми данными
            if (Schools.Count() == 0)
            {
                Object math = new Object()
                {
                    ObjectName = "Математика"
                };
                Object russ = new Object()
                {
                    ObjectName = "Русский язык"
                };
                Object info = new Object()
                {
                    ObjectName = "Информатика"
                };
                Object physic = new Object()
                {
                    ObjectName = "Физика"
                };
                Object window = new Object()
                {
                    ObjectName = "Окно"
                };

                Role student = new Role()
                {
                    RoleName = "student"
                };
                Role admin = new Role()
                {
                    RoleName = "admin"
                };

                School school = new School()
                {
                    SchoolNumber = 9,
                };

                Class _class = new Class()
                {
                    ClassChar   = "А",
                    ClassNumber = 10,
                    School      = school,
                };

                Schools.Add(school);
                Classes.Add(_class);

                Objects.Add(info);
                Objects.Add(window);
                Objects.Add(physic);
                Objects.Add(math);
                Objects.Add(russ);

                Roles.Add(student);
                Roles.Add(admin);
                SaveChanges();
            }
        }
示例#8
0
        private void Open_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var dialog = new OpenFileDialog {
                Filter = "XML Filer (*.xml)|*.xml|Alla Filer (*.*)|*.*"
            };

            if (dialog.ShowDialog() != true)
            {
                return;
            }

            filename = dialog.FileName;

            Schools.Clear();
            School      school      = null;
            SchoolClass schoolClass = null;
            Student     student     = null;

            using (var reader = XmlReader.Create(filename))
            {
                while (reader.Read())
                {
                    if (!reader.IsStartElement())
                    {
                        continue;
                    }
                    switch (reader.Name)
                    {
                    case "Box":
                        Box = new Flowers(int.Parse(reader["Small"]), int.Parse(reader["Wreaths"]), int.Parse(reader["Large"]), int.Parse(reader["Pins"]));
                        break;

                    case "Price":
                        Price = new Flowers(int.Parse(reader["Small"]), int.Parse(reader["Wreaths"]), int.Parse(reader["Large"]), int.Parse(reader["Pins"]));
                        break;

                    case "Bonus":
                        Bonus = reader.ReadElementContentAsInt();
                        break;

                    case "School":
                        school = new School(reader["Name"], reader["ID"], long.Parse(reader["Changed"]));
                        Schools.Add(school);
                        break;

                    case "Class":
                        schoolClass = new SchoolClass(reader["Name"], reader["ID"], long.Parse(reader["Changed"]));
                        school?.Classes.Add(schoolClass);
                        break;

                    case "Student":
                        student = new Student(reader["ID"], long.Parse(reader["Changed"]));
                        schoolClass?.Students.Add(student);
                        break;

                    case "Firstname":
                        student.Firstname = reader.ReadElementContentAsString();
                        break;

                    case "Surname":
                        student.Surname = reader.ReadElementContentAsString();
                        break;

                    case "Telephone":
                        student.Telephone = reader.ReadElementContentAsString();
                        break;

                    case "GivSmall":
                        student.Given.Small = reader.ReadElementContentAsInt();
                        break;

                    case "GivWreaths":
                        student.Given.Wreaths = reader.ReadElementContentAsInt();
                        break;

                    case "GivLarge":
                        student.Given.Large = reader.ReadElementContentAsInt();
                        break;

                    case "GivPins":
                        student.Given.Pins = reader.ReadElementContentAsInt();
                        break;

                    case "GivSign":
                        student.GivSign = reader.ReadElementContentAsString();
                        break;

                    case "RetSmall":
                        student.Returned.Small = reader.ReadElementContentAsInt();
                        break;

                    case "RetWreaths":
                        student.Returned.Wreaths = reader.ReadElementContentAsInt();
                        break;

                    case "RetLarge":
                        student.Returned.Large = reader.ReadElementContentAsInt();
                        break;

                    case "RetPins":
                        student.Returned.Pins = reader.ReadElementContentAsInt();
                        break;

                    case "Received":
                        student.Received = reader.ReadElementContentAsInt();
                        break;

                    case "Sign":
                        student.Sign = reader.ReadElementContentAsString();
                        break;

                    case "Note":
                        student.Note = reader.ReadElementContentAsString();
                        break;
                    }
                }
            }

            if (Schools.Count > 0)
            {
                CurrentSchool = Schools[0];
            }
        }
示例#9
0
        public void Init()
        {
            Developer developper = new Developer()
            {
                DeveloperId     = 1,
                DeveloperName   = "jean",
                DeveloperSalary = 1000,
                DeveloperSkills = new List <Skill>(),
                Hired           = false,
                ImageUrl        = "https://dev.azure.com/martinbalme/_apis/GraphProfile/MemberAvatars/aad.MzIzMDEyNjEtYjIxMS03NWJiLWIzYTgtZGE2NDEyOTQzNGEz"
            };

            Developer developper1 = new Developer()
            {
                DeveloperId     = 1,
                DeveloperName   = "kevin",
                DeveloperSalary = 10000000,
                DeveloperSkills = new List <Skill>(),
                Hired           = true,
                ImageUrl        = "https://dev.azure.com/martinbalme/_apis/GraphProfile/MemberAvatars/aad.MzIzMDEyNjEtYjIxMS03NWJiLWIzYTgtZGE2NDEyOTQzNGEz"
            };

            Developer developper2 = new Developer()
            {
                DeveloperId     = 1,
                DeveloperName   = "poplololopo",
                DeveloperSalary = 10000,
                DeveloperSkills = new List <Skill>(),
                Hired           = false,
                ImageUrl        = "https://dev.azure.com/martinbalme/_apis/GraphProfile/MemberAvatars/aad.MzIzMDEyNjEtYjIxMS03NWJiLWIzYTgtZGE2NDEyOTQzNGEz"
            };

            Skill java = new Skill()
            {
                SkillId    = 1,
                SkillLevel = 3,
                SkillName  = "java"
            };

            Skill csharp = new Skill()
            {
                SkillId    = 2,
                SkillLevel = 1,
                SkillName  = "csharp"
            };

            Skill jquery = new Skill()
            {
                SkillId    = 3,
                SkillLevel = 2,
                SkillName  = "jquery"
            };

            developper.DeveloperSkills.Add(java);
            developper.DeveloperSkills.Add(jquery);
            developper.DeveloperSkills.Add(csharp);
            developper1.DeveloperSkills.Add(csharp);

            Company company = new Company()
            {
                CompanyId  = 1,
                Developers = new List <Developer>(),
                Projects   = new List <Project>(),
                Funds      = 10000,
                Username   = "******"
            };

            Company company1 = new Company()
            {
                CompanyId  = 2,
                Developers = new List <Developer>(),
                Funds      = 100000,
                Username   = "******"
            };

            company.Developers.Add(developper1);

            Project project = new Project()
            {
                ProjectDuration     = 2,
                ProjectID           = 1,
                ProjectName         = "app wib",
                ProjectPenality     = 0,
                ProjectRemuneration = 10,
                Skills     = new List <Skill>(),
                Developers = new List <Developer>(),
                Company    = null,
                ImageUrl   = "https://massif-du-jura.developpement-edf.com/images/icones-projet/edf-projet-process00.png"
            };

            project.Skills.Add(java);
            project.Skills.Add(jquery);

            School school = new School()
            {
                SchoolId               = 1,
                SchoolName             = "Diiage",
                SchoolTrainingSessions = new List <TrainingSession>(),
                ImageUrl               = "http://diiage.cucdb.fr/wp-content/uploads/sites/4/2014/10/diiage-couleur1.png"
            };

            TrainingSession trainingSession = new TrainingSession()
            {
                Name   = "Formation Cobol",
                School = school,
                TrainingSessionDevelopers = new List <Developer>(),
                TrainingSessionDuration   = 2,
                TrainingSessionId         = 1,
                TrainingSessionSkill      = null,
                TraningSessionCost        = 100
            };

            TrainingSession trainingSession1 = new TrainingSession()
            {
                Name   = "Formation C#",
                School = school,
                TrainingSessionDevelopers = new List <Developer>(),
                TrainingSessionDuration   = 2,
                TrainingSessionId         = 2,
                TrainingSessionSkill      = null,
                TraningSessionCost        = 1000
            };

            Skill cobol = new Skill()
            {
                SkillId    = 4,
                SkillLevel = 1,
                SkillName  = "cobol"
            };

            trainingSession.TrainingSessionSkill  = cobol;
            trainingSession1.TrainingSessionSkill = csharp;
            school.SchoolTrainingSessions.Add(trainingSession);
            school.SchoolTrainingSessions.Add(trainingSession1);

            LocalPlayer = company;
            Companies.Add(company);
            Companies.Add(company1);
            Developers.Add(developper);
            Developers.Add(developper1);
            Developers.Add(developper2);
            Projects.Add(project);
            Schools.Add(school);
        }
        public void ReadTeamsAndSchools( )
        {
            Schools.Clear( );
            Teams.Clear( );
            Athletes.Clear( );

            doc.Load(FilePath);

            foreach (XmlElement teams in doc.SelectSingleNode("EntryForm").SelectSingleNode("Teams").ChildNodes)
            {
                IIdentityStorage t = new IIdentityStorage();

                t.ShortName = teams.InnerText;

                t.item      = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.Team> ( ).Where(te => te.ShortName.Trim( ) == t.ShortName.Trim( )).FirstOrDefault( );
                t.processor = this;
                Teams.Add(t);
            }

            foreach (XmlElement school in doc.SelectSingleNode("EntryForm").SelectSingleNode("Schools").ChildNodes)
            {
                IIdentityStorage t = new IIdentityStorage();

                t.ShortName = school.InnerText;

                t.item = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.School> ( ).Where(te => te.ShortName.Trim() == t.ShortName.Trim()).FirstOrDefault( );

                t.isSchool  = true;
                t.processor = this;
                Schools.Add(t);
            }

            foreach (XmlElement athlete in doc.SelectSingleNode("EntryForm").SelectSingleNode("Entries").ChildNodes)
            {
                try
                {
                    AthleteStorage a = new AthleteStorage();

                    a.Name        = athlete.Attributes["Name"].Value.ToString( ).Replace("  ", " ");
                    a.DateOfBirth = DateTime.Parse(athlete.Attributes["DateOfBirth"].Value);

                    a.School = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.School> ( ).Where(te => te.ShortName.Trim( ) == athlete.Attributes["SchoolCode"].Value.Trim( )).FirstOrDefault( );
                    a.Team   = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.Team> ( ).Where(te => te.ShortName.Trim( ) == athlete.Attributes["TeamCode"].Value.Trim( )).FirstOrDefault( );

                    if (athlete.Attributes["GlobalID"].Value != "")
                    {
                        a.GlobalID = int.Parse(athlete.Attributes["GlobalID"].Value);
                    }

                    if (athlete.Attributes["CategoryCode"].Value.Contains("B"))
                    {
                        a.Gender = DM.Gender.Male;
                    }
                    else
                    {
                        a.Gender = DM.Gender.Female;
                    }

                    a.EventCodes = new List <string> ( );

                    if (athlete.SelectSingleNode("Events").HasChildNodes)
                    {
                        foreach (XmlElement ev in athlete.SelectSingleNode("Events").ChildNodes)
                        {
                            a.EventCodes.Add(ev.Attributes["EventCode"].Value);
                        }
                    }

                    Athletes.Add(a);

                    Console.WriteLine("Athlete Read: " + a.Name);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Failed to read " + athlete.Attributes["Name"].Value.ToString( ) + "\n" + ex.Message);
                    continue;
                }
            }

            Wizard.changeHappend( );
        }