public IActionResult Edit(DangerousViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var entity = _dbContext.DangerousGoods.FirstOrDefault(x => x.MentallyUuid == model.MentallyUuid);
                entity.Name              = model.Name;
                entity.OwningGrid        = model.OwningGrid;
                entity.Sex               = model.Sex;
                entity.DateBirth         = model.DateBirth;
                entity.IdCard            = model.IdCard;
                entity.Danger            = model.Danger;
                entity.Employer          = model.Employer;
                entity.Attention         = model.Attention;
                entity.LegalPerson       = model.LegalPerson;
                entity.LegalPersonPhone  = model.LegalPersonPhone;
                entity.CorporatePhone    = model.CorporatePhone;
                entity.ResidenceAddress  = model.ResidenceAddress;
                entity.RegisteredAddress = model.RegisteredAddress;
                entity.PoliceStation     = model.PoliceStation;
                entity.HousesNumber      = model.HousesNumber;
                entity.CurrentAddress    = model.CurrentAddress;
                entity.RoomReason        = model.RoomReason;
                entity.OtherAddress      = model.OtherAddress;
                entity.FormerName        = model.FormerName;
                entity.Phone             = model.Phone;
                entity.ContactPhone      = model.ContactPhone;
                entity.Email             = model.Email;
                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.Religious         = model.Religious;
                entity.Height            = model.Height;
                entity.Work              = model.Work;
                entity.WorkNumber        = model.WorkNumber;
                entity.EffectiveTime     = model.EffectiveTime;
                entity.EndTime           = model.EndTime;
                entity.Waiter            = model.Waiter;
                entity.ServiceHours      = model.ServiceHours;
                entity.Remarks           = model.Remarks;
                int res = _dbContext.SaveChanges();
                if (res > 0)
                {
                    ToLog.AddLog("编辑", "成功:编辑:危险品从业人口信息一条数据", _dbContext);
                }
                response.SetSuccess("修改成功");
                return(Ok(response));
            }
        }
        public IActionResult Create(DangerousViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            using (_dbContext)
            {
                var entity = new DangerousGoods();
                entity.MentallyUuid      = Guid.NewGuid();
                entity.Name              = model.Name;
                entity.OwningGrid        = model.OwningGrid;
                entity.Sex               = model.Sex;
                entity.DateBirth         = model.DateBirth;
                entity.IdCard            = model.IdCard;
                entity.Danger            = model.Danger;
                entity.Employer          = model.Employer;
                entity.Attention         = model.Attention;
                entity.LegalPerson       = model.LegalPerson;
                entity.LegalPersonPhone  = model.LegalPersonPhone;
                entity.CorporatePhone    = model.CorporatePhone;
                entity.ResidenceAddress  = model.ResidenceAddress;
                entity.RegisteredAddress = model.RegisteredAddress;
                entity.PoliceStation     = model.PoliceStation;
                entity.HousesNumber      = model.HousesNumber;
                entity.CurrentAddress    = model.CurrentAddress;
                entity.RoomReason        = model.RoomReason;
                entity.OtherAddress      = model.OtherAddress;
                entity.FormerName        = model.FormerName;
                entity.Phone             = model.Phone;
                entity.ContactPhone      = model.ContactPhone;
                entity.Email             = model.Email;
                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.Religious         = model.Religious;
                entity.Height            = model.Height;
                entity.Work              = model.Work;
                entity.WorkNumber        = model.WorkNumber;
                entity.EffectiveTime     = model.EffectiveTime;
                entity.EndTime           = model.EndTime;
                entity.Waiter            = model.Waiter;
                entity.ServiceHours      = model.ServiceHours;
                entity.Remarks           = model.Remarks;
                entity.IsDeleted         = 0;
                _dbContext.DangerousGoods.Add(entity);
                int res = _dbContext.SaveChanges();
                if (res > 0)
                {
                    ToLog.AddLog("添加", "成功:添加:危险品从业人口信息一条数据", _dbContext);
                }
                response.SetSuccess("添加成功");
                return(Ok(response));
            }
        }