public IActionResult Edit(int id, RentedFromClients RentedFromClients) { db.Entry(RentedFromClients).State = Microsoft.EntityFrameworkCore.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult Add(RentedFromClients RentedFromClients) { db.RentedFromClients.Add(RentedFromClients); db.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult ArrowSuperOne(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 = "RentedFromClients"; RentedFromClients ls = new RentedFromClients(); 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.RentedFromClients.Add(ls); } db.SaveChanges(); db.Inventory.Remove(db.Inventory.Find(id)); db.SaveChanges(); return(RedirectToAction("Index")); }