public ActionResult DeleteConfirmed(long id)
        {
            CheckInItem checkInItem = db.CheckInItems.Find(id);

            db.CheckInItems.Remove(checkInItem);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,ItemId,Quantity,BuyingPrice,VendorId,ReceivingDate")] CheckInItem checkInItem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(checkInItem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ItemId   = new SelectList(db.Items, "Id", "Name", checkInItem.ItemId);
     ViewBag.VendorId = new SelectList(db.Vendors, "Id", "Name", checkInItem.VendorId);
     return(View(checkInItem));
 }
        // GET: CheckInItems/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CheckInItem checkInItem = db.CheckInItems.Find(id);

            if (checkInItem == null)
            {
                return(HttpNotFound());
            }
            return(View(checkInItem));
        }
Exemple #4
0
        public async Task <APIResponse <bool> > CheckInBeerAsync(CheckInItem checkInItem)
        {
            if (checkInItem.Beer != null)
            {
                checkInItem.BeerId = checkInItem.Beer.Id;
            }
            var table = serviceClient.GetSyncTable <CheckInItem>();

            checkInItem.CheckedInBy = new Guid(checkInItem.Beer.Name).GetHashCode();
            await table.InsertAsync(checkInItem);

            await SyncAsync <CheckInItem>(checkInItem.Id.ToString());

            return(new APIResponse <bool>(true, null));
        }
        // GET: CheckInItems/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CheckInItem checkInItem = db.CheckInItems.Find(id);

            if (checkInItem == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ItemId   = new SelectList(db.Items, "Id", "Name", checkInItem.ItemId);
            ViewBag.VendorId = new SelectList(db.Vendors, "Id", "Name", checkInItem.VendorId);
            return(View(checkInItem));
        }