Exemplo n.º 1
0
 public void CreateSchool(School s)
 {
     using (var db = new HstDBContainer(_connectionString))
     {
         db.Schools.AddObject(s);
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
Arquivo: User.cs Projeto: anbro/hst
        private void FixupSchool(School previousValue)
        {
            if (previousValue != null && previousValue.Users.Contains(this))
            {
                previousValue.Users.Remove(this);
            }

            if (School != null)
            {
                if (!School.Users.Contains(this))
                {
                    School.Users.Add(this);
                }
                if (SchoolId != School.Id)
                {
                    SchoolId = School.Id;
                }
            }
            else if (!_settingFK)
            {
                SchoolId = null;
            }
        }
Exemplo n.º 3
0
Arquivo: Child.cs Projeto: anbro/hst
        private void FixupSchool(School previousValue)
        {
            if (previousValue != null && previousValue.Children.Contains(this))
            {
                previousValue.Children.Remove(this);
            }

            if (School != null)
            {
                if (!School.Children.Contains(this))
                {
                    School.Children.Add(this);
                }
                if (SchoolId != School.Id)
                {
                    SchoolId = School.Id;
                }
            }
        }