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); } }
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); } }
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)); } }