Esempio n. 1
0
 public int PutCargoETSNG(int code, [FromBody] Directory_CargoETSNG value)
 {
     try
     {
         this.ef_dir.Update(value);
         return(this.ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Esempio n. 2
0
 public int PostCargoETSNG([FromBody] Directory_CargoETSNG value)
 {
     try
     {
         this.ef_dir.Add(value);
         int res = ef_dir.Save();
         return(res > 0 ? value.id : res);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Esempio n. 3
0
 public IHttpActionResult GetCargoETSNGOfID(int id)
 {
     try
     {
         Directory_CargoETSNG ens = this.ef_dir
                                    .Context
                                    .Where(w => w.id == id)
                                    .ToList()
                                    .Select(m => m.GetDirectory_CargoETSNG()).FirstOrDefault();
         return(Ok(ens));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }