Ejemplo n.º 1
0
 public int PostConsignee([FromBody] Directory_Consignee value)
 {
     try
     {
         this.ef_dir.Add(value);
         return(ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Ejemplo n.º 2
0
 public int PutConsignee(int code, [FromBody] Directory_Consignee value)
 {
     try
     {
         this.ef_dir.Update(value);
         return(this.ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Ejemplo n.º 3
0
 public IHttpActionResult GetConsigneeOfID(int code)
 {
     try
     {
         Directory_Consignee ens = this.ef_dir
                                   .Context
                                   .Where(w => w.code == code)
                                   .ToList()
                                   .Select(m => m.GetDirectory_Consignee()).FirstOrDefault();
         return(Ok(ens));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }