Exemple #1
0
        void ISchool.Setup(CheckIn.Model.School school)
        {
            SchoolEntity entity = new SchoolEntity();

            entity.Address         = school.Address;
            entity.Name            = school.Name;
            entity.Telephone       = school.Telephone;
            entity.PresidentId     = school.President.User.UserId;
            entity.AdministratorId = school.Administrator.User.UserId;

            _db.Save(entity);
        }
Exemple #2
0
        void ISchool.SaveSchool(CheckIn.Model.School school)
        {
            var list = _db.Fetch <SchoolEntity>("select top 1 * from SchoolInfo");

            if (list.Count == 0)
            {
                throw new Exception("未配置学校基本信息!");
            }
            SchoolEntity entity = list[0];

            entity.Address         = school.Address;
            entity.Name            = school.Name;
            entity.Telephone       = school.Telephone;
            entity.PresidentId     = school.President.User.UserId;
            entity.AdministratorId = school.Administrator.User.UserId;

            _db.Save(entity);
        }