public IActionResult Create(TeenagerViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            using (_dbContext)
            {
                var entity = new HaikanSmartTownCockpit.Api.Entities.KeyYouthList();
                entity.KeyYouthListUuid = Guid.NewGuid();
                entity.Name             = model.Name;
                entity.OwnedNetwork     = model.OwnedNetwork;
                entity.Sex               = model.Sex;
                entity.DateOfBirth       = model.DateOfBirth;
                entity.IdCard            = model.IdCard;
                entity.PersonType        = model.PersonType;
                entity.Attention         = model.Attention;
                entity.ResidenceAddress  = model.ResidenceAddress;
                entity.RegisteredAddress = model.RegisteredAddress;
                entity.HouseholdRegistrationPoliceStation = model.HouseholdRegistrationPoliceStation;
                entity.NumberOfTheHouse   = model.NumberOfTheHouse;
                entity.CurrentAddress     = model.CurrentAddress;
                entity.NoRoomReason       = model.NoRoomReason;
                entity.CurrentAddress1    = model.CurrentAddress1;
                entity.OtherAddress       = model.OtherAddress;
                entity.FormerName         = model.FormerName;
                entity.Employer           = model.Employer;
                entity.ContactNumber      = model.ContactNumber;
                entity.ContactPhone       = model.ContactPhone;
                entity.Nation             = model.Nation;
                entity.PoliticalStatus    = model.PoliticalStatus;
                entity.Education          = model.Education;
                entity.Occupation         = model.Occupation;
                entity.MaritalStatus      = model.MaritalStatus;
                entity.BloodType          = model.BloodType;
                entity.ReligiousBelief    = model.ReligiousBelief;
                entity.Height             = model.Height;
                entity.Email              = model.Email;
                entity.ServiceMembers     = model.ServiceMembers;
                entity.LatestServiceHours = model.LatestServiceHours;
                entity.Remarks            = model.Remarks;



                entity.IsDeleted = 0;
                _dbContext.KeyYouthList.Add(entity);
                int res = _dbContext.SaveChanges();
                if (res > 0)
                {
                    ToLog.AddLog("添加", "成功:添加:重点青少年人员信息一条数据", _dbContext);
                }
                response.SetSuccess("添加成功");
                return(Ok(response));
            }
        }
        public IActionResult Edit(TeenagerViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var entity = _dbContext.KeyYouthList.FirstOrDefault(x => x.KeyYouthListUuid == model.KeyYouthListUuid);
                entity.Name              = model.Name;
                entity.OwnedNetwork      = model.OwnedNetwork;
                entity.Sex               = model.Sex;
                entity.DateOfBirth       = model.DateOfBirth;
                entity.IdCard            = model.IdCard;
                entity.PersonType        = model.PersonType;
                entity.Attention         = model.Attention;
                entity.ResidenceAddress  = model.ResidenceAddress;
                entity.RegisteredAddress = model.RegisteredAddress;
                entity.HouseholdRegistrationPoliceStation = model.HouseholdRegistrationPoliceStation;
                entity.NumberOfTheHouse   = model.NumberOfTheHouse;
                entity.CurrentAddress     = model.CurrentAddress;
                entity.NoRoomReason       = model.NoRoomReason;
                entity.CurrentAddress1    = model.CurrentAddress1;
                entity.OtherAddress       = model.OtherAddress;
                entity.FormerName         = model.FormerName;
                entity.Employer           = model.Employer;
                entity.ContactNumber      = model.ContactNumber;
                entity.ContactPhone       = model.ContactPhone;
                entity.Nation             = model.Nation;
                entity.PoliticalStatus    = model.PoliticalStatus;
                entity.Education          = model.Education;
                entity.Occupation         = model.Occupation;
                entity.MaritalStatus      = model.MaritalStatus;
                entity.BloodType          = model.BloodType;
                entity.ReligiousBelief    = model.ReligiousBelief;
                entity.Height             = model.Height;
                entity.Email              = model.Email;
                entity.ServiceMembers     = model.ServiceMembers;
                entity.LatestServiceHours = model.LatestServiceHours;
                entity.Remarks            = model.Remarks;
                int res = _dbContext.SaveChanges();
                if (res > 0)
                {
                    ToLog.AddLog("编辑", "成功:编辑:重点青少年人员信息一条数据", _dbContext);
                }
                response.SetSuccess("修改成功");
                return(Ok(response));
            }
        }