Example #1
0
        public object getfeedingLocation(MM_FEEDING_LOCATION_QueryParam definitions)
        {
            IList <MM_FEEDING_LOCATION> list = new List <MM_FEEDING_LOCATION>();

            try
            {
                list = definitionBO.GetEntities(definitions);
                return(list);
            }
            catch (Exception e)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, "查询失败:" + e.Message));
            }
        }
Example #2
0
 public HttpResponseMessage Addfeedinglocation(MM_FEEDING_LOCATION definitions)
 {
     definitions.UpdatedOn = DateTime.Now;
     try
     {
         MM_FEEDING_LOCATION_QueryParam feeQueray = new MM_FEEDING_LOCATION_QueryParam();
         feeQueray.FeedingLocation = definitions.FeedingLocation;
         IList <MM_FEEDING_LOCATION> list = definitionBO.GetEntities(feeQueray);
         if (list.Count != 0)
         {
             //return Request.CreateResponse(HttpStatusCode.OK, "投料口ID已经存在");
             return(Request.CreateResponse(HttpStatusCode.InternalServerError, "投料口ID已经存在"));
         }
         else
         {
             MM_FEEDING_LOCATION mmExt = definitionBO.Insert(definitions);
             return(Request.CreateResponse(HttpStatusCode.OK, "新增成功"));
         }
     }
     catch (Exception e)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, "新增失败:" + e.Message));
     }
 }