Beispiel #1
0
 public int PostShipper([FromBody] Directory_Shipper value)
 {
     try
     {
         this.ef_dir.Add(value);
         return(ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Beispiel #2
0
 public int PutShipper(int code, [FromBody] Directory_Shipper value)
 {
     try
     {
         this.ef_dir.Update(value);
         return(this.ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Beispiel #3
0
 public IHttpActionResult GetShipperOfCode(int code)
 {
     try
     {
         Directory_Shipper ens = this.ef_dir
                                 .Context
                                 .Where(w => w.code == code)
                                 .ToList()
                                 .Select(m => m.GetDirectory_Shipper()).FirstOrDefault();
         return(Ok(ens));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }