Ejemplo n.º 1
0
 // POST: api/Proveedores
 public HttpResponseMessage Post(Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         supplierBL.Create(supplier);
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     else
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }
Ejemplo n.º 2
0
        protected override ResultMessage Create()
        {
            var bl = new SupplierBL();

            this.Current  = bl.Create();
            this.Original = CopyEntity(this.Current);

            var result  = this.Current != null;
            var message = result ? "" : "err";

            return(new ResultMessage(result, message));
        }