/// <summary>
        /// 设置model,如果不为空就设置,如果为空则和之前一样
        /// </summary>
        /// <param name="target"></param>
        /// <param name="source"></param>
        /// <returns></returns>
        public KeHuJieDianClassModel SetKeHuJieDianClassModel(KeHuJieDianClassModel model, KeHuJieDianClassModelReq data)
        {
            if (!string.IsNullOrEmpty(data.JdClassName))
            {
                model.JdClassName = data.JdClassName;
            }
            if (data.JdClassPaiXu != null)
            {
                model.JdClassPaiXu = data.JdClassPaiXu.Value;
            }
            if (data.JdClassStateID != null)
            {
                model.JdClassStateID = data.JdClassStateID.Value;
            }
            if (!string.IsNullOrEmpty(data.optName))
            {
                model.optName = data.optName;
            }
            if (data.optDateTime != null && data.optDateTime != DateTime.MinValue && data.optDateTime != SqlDateTime.MinValue.Value)
            {
                model.optDateTime = data.optDateTime.Value;
            }
            if (!string.IsNullOrEmpty(data.JdSpecialState))
            {
                model.JdSpecialState = data.JdSpecialState;
            }

            return(model);
        }
        public KeHuJieDianClassModel UpdateSingle(int id, KeHuJieDianClassModelReq data)
        {
            KeHuJieDianClassModel model = db.KeHuJieDianClassModel.Find(id);

            SetKeHuJieDianClassModel(model, data);
            db.SaveChanges();
            return(model);
        }
        public static KeHuJieDianClassObj TranferModelToObj(KeHuJieDianClassModel model, int projectId)
        {
            KeHuJieDianClassObj obj = new KeHuJieDianClassObj();

            obj.JdClassModelName = model.JdClassName;
            obj.JdClassModelID   = model.id;
            obj.JdClassPaiXu     = model.JdClassPaiXu;
            obj.ProjectID        = projectId;
            return(obj);
        }