Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 //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);
 }
Esempio n. 3
0
        //Post a new User Note
        public HttpResponseMessage Post(UserNote newNote)
        {
            var oops = new DVDLibaryOperations();

            return new HttpResponseMessage(HttpStatusCode.Created);
        }
Esempio n. 4
0
        //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);
        }