示例#1
0
 public int PostOperatorsWagons([FromBody] Directory_OperatorsWagons value)
 {
     try
     {
         this.ef_ow.Add(value);
         return(ef_ow.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
示例#2
0
 public int PutExternalStation(int id, [FromBody] Directory_OperatorsWagons value)
 {
     try
     {
         this.ef_ow.Update(value);
         return(this.ef_ow.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
示例#3
0
 public IHttpActionResult GetOperatorsWagonsOfID(int id)
 {
     try
     {
         Directory_OperatorsWagons oper = this.ef_ow
                                          .Context
                                          .Where(o => o.id == id)
                                          .ToList()
                                          .Select(s => s.GetOperatorsWagons()).FirstOrDefault();
         return(Ok(oper));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }