Пример #1
0
 public int PostCargoGroup([FromBody] Directory_CargoGroup value)
 {
     try
     {
         this.ef_dir.Add(value);
         return(ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Пример #2
0
 public int PutCargoGroup(int id, [FromBody] Directory_CargoGroup value)
 {
     try
     {
         this.ef_dir.Update(value);
         return(this.ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Пример #3
0
 public IHttpActionResult GetCargoGroupOfID(int id)
 {
     try
     {
         Directory_CargoGroup ens = this.ef_dir
                                    .Context
                                    .Where(w => w.id == id)
                                    .ToList()
                                    .Select(m => m.GetDirectory_CargoGroup()).FirstOrDefault();
         return(Ok(ens));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }