public JsonResult Save(TB_WareHouse ClassWareHouse) { ClassWareHouse.Date = DateConvertion(DateTime.Now); ClassWareHouse.Time = Time(); DB.TB_WareHouse.Add(ClassWareHouse); DB.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); }
public JsonResult Update(TB_WareHouse ClassWareHouse) { var Result = DB.TB_WareHouse.SingleOrDefault(Item => Item.ID == ClassWareHouse.ID); Result.ProductID = ClassWareHouse.ProductID; Result.Price = ClassWareHouse.Price; Result.EntryNo = ClassWareHouse.EntryNo; DB.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); }