public HttpResponseMessage AddStock(Stock_Detail stockdetail) { try { var x = db.Items.Find(stockdetail.Itemno); if (x == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } else { x.Quantity = x.Quantity + stockdetail.Quantity; db.Entry(x).State = EntityState.Modified; var abc = stockdetail; db.Stock_Detail.Add(stockdetail); db.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK, x)); } } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public bool Update(int id, Stock_Detail model) { throw new NotImplementedException(); }
public bool Insert(Stock_Detail model) { throw new NotImplementedException(); }