示例#1
0
 public int PostExternalStation([FromBody] Directory_ExternalStation value)
 {
     try
     {
         this.ef_dir.Add(value);
         return(ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
示例#2
0
 public int PutExternalStation(int code, [FromBody] Directory_ExternalStation value)
 {
     try
     {
         this.ef_dir.Update(value);
         return(this.ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
示例#3
0
 public IHttpActionResult GetExternalStationOfID(int code)
 {
     try
     {
         Directory_ExternalStation ens = this.ef_dir
                                         .Context
                                         .Where(w => w.code == code)
                                         .ToList()
                                         .Select(m => m.GetDirectory_ExternalStation()).FirstOrDefault();
         return(Ok(ens));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }