public HttpResponseMessage UpdateJob(PM_ACT_JOB_GROUP entity)
 {
     if (entity == null)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, "更新出错:实体为空"));
     }
     else
     {
         try
         {
             jgBO.UpdateSome(entity);
             return(Request.CreateResponse(HttpStatusCode.OK, "更新成功"));
         }
         catch (Exception e)
         {
             return(Request.CreateResponse(HttpStatusCode.InternalServerError, "更新出错:" + e.Message));
         }
     }
 }
        public HttpResponseMessage addJobGroup(PM_ACT_JOB_GROUP entities)
        {
            //先删再存
            IList <PM_ACT_JOB_GROUP> deleteList = new List <PM_ACT_JOB_GROUP>();
            string groupPK = entities.GroupPK.ToString();
            string JobPK   = entities.JobPK.ToString();

            deleteList = jgBO.GetEntity(groupPK, JobPK);
            foreach (var item in deleteList)
            {
                jgBO.Delete(item);
            }
            try
            {
                entities.CreatedOn = SSGlobalConfig.Now;
                jgBO.Insert(entities);

                return(Request.CreateResponse(HttpStatusCode.OK, "新增成功"));
            }
            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "addJobGroup失败:" + e.Message));
            }
        }