public ActionResult Edit(Recive recive) { if (ModelState.IsValid) { db.Entry(recive).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
// GET: Recive/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Recive recive = db.Recives.Find(id); if (recive == null) { return(HttpNotFound()); } return(View(recive)); }
void Start() { GameObject sco = GameObject.Find("SceneHandlerO"); sceneHandler = sco.GetComponent <SceneHandler>(); GameObject conn = GameObject.Find("ConnectionHandler"); recive = conn.GetComponent <Recive>(); testmode = false; // auto every fifth secound InvokeRepeating("Save", 5, 5); InvokeRepeating("SendResults", 5, 5); }
public ActionResult Create(POSCreateViewModel model) { if (ModelState.IsValid) { var recive = new Recive { ProductId = model.ProductId, Date = DateTime.UtcNow, Customer = model.ClientName, Quantity = model.Quantity }; var product = db.Products.Find(model.ProductId); product.Quantity = product.Quantity - recive.Quantity; db.Recives.Add(recive); db.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }