public void CreateBorrowerList() { DVDLibaryOperations oops = new DVDLibaryOperations(); List<Borrower> listOfBorrowers = oops.ReturnSmallBorrowersList(); if (listOfBorrowers.FirstOrDefault(b => b.IsOwner) != null) { Owner = listOfBorrowers.FirstOrDefault(b => b.IsOwner).FirstName; } BorrowersList = new List<SelectListItem>(); foreach (Borrower borrower in listOfBorrowers) { SelectListItem newItem = new SelectListItem(); if (borrower.IsOwner) { newItem.Text = borrower.FirstName + " " + borrower.LastName + " *"; } else { newItem.Text = borrower.FirstName + " " + borrower.LastName; } newItem.Value = borrower.BorrowerId.ToString(); BorrowersList.Add(newItem); } }
//Create a RenderAction that returns a partial view that includes Borrowers List, MovieID, etc. public List<UserNote> _RenderUserNotes(int id) { var oops = new DVDLibaryOperations(); //Need different method here return oops.ReturnUserNotes(id); }
//Post a new User Note public HttpResponseMessage Post(UserNote newNote) { var oops = new DVDLibaryOperations(); return new HttpResponseMessage(HttpStatusCode.Created); }
//Grab a dynamic list of User Notes based on the MovieID public List<UserNote> Get(int id) { var oops = new DVDLibaryOperations(); return oops.ReturnUserNotes(id); }