Beispiel #1
0
        public ActionResult Edit(Recive recive)
        {
            if (ModelState.IsValid)
            {
                db.Entry(recive).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View());
        }
Beispiel #2
0
        // 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));
        }
Beispiel #3
0
    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);
    }
Beispiel #4
0
        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());
        }