// GET: storge/Details/5
        public ActionResult Details(int id)
        {
            storge mystore = cos.GetById(id);

            ViewBag.itemD = itemObj.GetById(mystore.itemID);
            return(View(mystore));
        }
Exemplo n.º 2
0
        public JsonResult checkQuntity(int id)
        {
            System.Diagnostics.Debug.WriteLine("JSON " + id);
            storge itemQ = storgeServeces.GetById(id);

            return(Json(itemQ.Quantity.ToString(), JsonRequestBehavior.AllowGet));
        }
        // GET: storge/Create
        public ActionResult Create(int id)
        {
            storge item = new storge();

            item.itemID = id;

            System.Diagnostics.Debug.WriteLine(item.itemID);

            return(View(item));
        }
        public ActionResult Create(storge item)
        {
            try {
                // TODO: Add insert logic here
                System.Diagnostics.Debug.WriteLine(item.itemID);
                System.Diagnostics.Debug.WriteLine(item.Quantity);
                System.Diagnostics.Debug.WriteLine(item.storeName);
                cos.Create(item);


                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);

                return(View());
            }
        }
        public ActionResult editStorge(int id, storge storgeItem)
        {
            try
            {
                // TODO: Add update logic here
                storge item = cos.GetById(id);
                //item.itemID = storgeItem.itemID;
                item.Quantity  = storgeItem.Quantity;
                item.storeName = storgeItem.storeName;

                System.Diagnostics.Debug.WriteLine(item.itemID);

                cos.Update(item);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
 public void Delete(storge item)
 {
     _storgeRepository.Delete(item);
 }
 public void Update(storge item)
 {
     _storgeRepository.Update(item);
 }
 public void Create(storge item)
 {
     _storgeRepository.Add(item);
 }