Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var item = CashDrawer.Find(id);

            try {
                using (var scope = new TransactionScope()) {
                    item.DeleteAndFlush();
                }
                return(PartialView("_DeleteSuccesful", item));
            } catch (Exception) {
                return(PartialView("DeleteUnsuccessful"));
            }
            //CashDrawer CashDrawers = CashDrawer.Find(id);
            //CashDrawers.Delete();
            //return RedirectToAction("Index");
        }
Exemplo n.º 2
0
        public ActionResult Edit(CashDrawer item)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView("_Edit", item));
            }

            var entity = CashDrawer.Find(item.Id);

            entity.Code    = item.Code;
            entity.Name    = item.Name;
            entity.Comment = item.Comment;

            using (var scope = new TransactionScope()) {
                entity.UpdateAndFlush();
            }

            return(PartialView("_Refresh"));
        }
Exemplo n.º 3
0
        //
        // GET: /CashDrawers/Delete/5

        public ActionResult Delete(int id)
        {
            var item = CashDrawer.Find(id);

            return(PartialView("_Delete", item));
        }
Exemplo n.º 4
0
        //
        // GET: /CashDrawers/Edit/5

        public ActionResult Edit(int id)
        {
            var item = CashDrawer.Find(id);

            return(PartialView("_Edit", item));
        }