コード例 #1
0
        public KeHuJieDianObj UpdateSingle(int id, KeHuJieDianObjReq data)
        {
            KeHuJieDianObj model = db.KeHuJieDianObj.Find(id);

            SetKeHuJieDianObj(model, data);
            db.SaveChanges();
            return(model);
        }
コード例 #2
0
        //[NotMapped]
        //public List<KeHuJieDianMXObj> JmsJieDianMxs { get; set; }

        public static KeHuJieDianObj TranferModelToObj(KeHuJieDianModel model, int projectId)
        {
            KeHuJieDianObj obj = new KeHuJieDianObj();

            obj.JdModelName    = model.JdName;
            obj.JdClassModelID = model.JdClassID;
            //obj.JdClassModelName=model.
            obj.JdModelID = model.id;
            obj.JdPaiXu   = model.JdPaiXu;
            obj.ProjectID = projectId;
            using (Context db = new Context())
            {
                obj.JdClassModelName = db.KeHuJieDianClassModel.Find(model.JdClassID).JdClassName;
            }

            return(obj);
        }
コード例 #3
0
 /// <summary>
 /// 设置model,如果不为空就设置,如果为空则和之前一样
 /// </summary>
 /// <param name="target"></param>
 /// <param name="source"></param>
 /// <returns></returns>
 public KeHuJieDianObj SetKeHuJieDianObj(KeHuJieDianObj model, KeHuJieDianObjReq data)
 {
     if (data.KeHuID != null)
     {
         model.KeHuID = data.KeHuID.Value;
     }
     if (!string.IsNullOrEmpty(data.KeHuName))
     {
         model.KeHuName = data.KeHuName;
     }
     if (data.JdClassModelID != null)
     {
         model.JdClassModelID = data.JdClassModelID.Value;
     }
     if (!string.IsNullOrEmpty(data.JdClassModelName))
     {
         model.JdClassModelName = data.JdClassModelName;
     }
     if (data.JdModelID != null)
     {
         model.JdModelID = data.JdModelID.Value;
     }
     if (!string.IsNullOrEmpty(data.JdModelName))
     {
         model.JdModelName = data.JdModelName;
     }
     if (data.JdPaiXu != null)
     {
         model.JdPaiXu = data.JdPaiXu.Value;
     }
     if (data.JdStateID != null)
     {
         model.JdStateID = data.JdStateID.Value;
     }
     if (data.projectid != null)
     {
         model.ProjectID = data.projectid.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.KeHuUploadFileState))
     {
         model.KeHuUploadFileState = data.KeHuUploadFileState;
     }
     if (!string.IsNullOrEmpty(data.KeHuFinishState))
     {
         model.KeHuFinishState = data.KeHuFinishState;
     }
     if (!string.IsNullOrEmpty(data.JdSpecialState))
     {
         model.JdSpecialState = data.JdSpecialState;
     }
     if (!string.IsNullOrEmpty(data.JdSpecialOptName))
     {
         model.JdSpecialOptName = data.JdSpecialOptName;
     }
     if (data.LastGenzhongDate != null && data.LastGenzhongDate != DateTime.MinValue &&
         data.LastGenzhongDate != SqlDateTime.MinValue.Value)
     {
         model.LastGenzhongDate = data.LastGenzhongDate.Value;
     }
     if (!string.IsNullOrEmpty(data.GenzongState))
     {
         model.GenzongState = data.GenzongState;
     }
     if (data.HeTongId != null)
     {
         model.HeTongId = data.HeTongId.Value;
     }
     return(model);
 }