Beispiel #1
0
      public IActionResult Add(NotInInventory NotInInventory)
      {
          db.NotInInventory.Add(NotInInventory);
          db.SaveChanges();

          return(RedirectToAction("Index"));
      }
Beispiel #2
0
      public IActionResult Edit(int id, NotInInventory NotInInventory)
      {
          db.Entry(NotInInventory).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
          db.SaveChanges();

          return(RedirectToAction("Index"));
      }
        public IActionResult ArrowSuperTwo(int id)
        {
            var str = db.Inventory.Where(x => x.Id == id).ToList();

            foreach (var val in str) // iterator the data from the list and insert them into the listSecond
            {
                string         Status = "NotInInventory";
                NotInInventory ls     = new NotInInventory();
                ls.Id         = val.Id;
                ls.Name       = val.Name;
                ls.Status     = Status;
                ls.Price      = val.Price;
                ls.Quantity   = val.Quantity;
                ls.Project    = val.Project;
                ls.RentedFrom = val.RentedFrom;
                ls.RentedTo   = val.RentedTo;
                db.NotInInventory.Add(ls);
            }
            db.SaveChanges();
            db.Inventory.Remove(db.Inventory.Find(id));

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }