Exemple #1
0
        public object UpdateModelBasicInfo(ModelBasicInfoUpdateDTO dto)
        {
            DmeModel model = base.Db.Queryable <DmeModel>().Single(m => m.SysCode == dto.SysCode);

            if (null == model)
            {
                throw new BusinessException((int)EnumSystemStatusCode.DME_ERROR, $"模型[{dto.SysCode}]不存在");
            }
            DmeModelType modelType = base.Db.Queryable <DmeModelType>().Single(mt => mt.SysCode == dto.TypeCode);

            if (null == modelType)
            {
                throw new BusinessException((int)EnumSystemStatusCode.DME_ERROR, $"模型类型[{dto.TypeCode}]不存在");
            }
            model.Name          = dto.Name;
            model.Remark        = dto.Remark;
            model.ModelTypeId   = modelType.Id;
            model.ModelTypeCode = modelType.SysCode;
            base.Db.Updateable <DmeModel>(model).ExecuteCommand();
            return(true);
        }
Exemple #2
0
 public Result UpdateModelBasicInfo([FromBody] ModelBasicInfoUpdateDTO dto)
 {
     return(base.Success(base.modelService.UpdateModelBasicInfo(dto)));
 }