public ActionResult Create(int memberID, FormCollection coll)
        {
            var member = Utilities.Members.getMember(Session, memberID, Utilities.Members.MemberType.Staff);
            if (!member.IsLibrarian) throw new Exception("You do not have permissions to this page");
            var journals = Utilities.Inventory.GetAllInventory(Session, Utilities.Inventory.InventoryTypes.Journals);
            var journal = new Journal(Utilities.Inventory.getNextID(journals)) { Author = coll["Author"], Title = coll["Title"], JournalIssues = new List<LibrarySystem.Areas.Inventory.Models.Journal.Issue>() };

            journals.Add(journal);
            Dictionary<String, List<InventoryItemBase>> inventory = Session["Inventory"] as Dictionary<String, List<InventoryItemBase>>;
            inventory[Utilities.Inventory.InventoryTypes.Journals.ToString()] = journals;
            Session["Inventory"] = inventory;
            return RedirectToAction(Utilities.Members.MemberType.Staff.ToString(), "Default", new { mid = memberID });
        }
Exemplo n.º 2
0
 public Issue(int id, Journal journal)
     : this(id, journal, false)
 {
 }
Exemplo n.º 3
0
 public Issue(int id, Journal journal, bool isAvailable)
 {
     this.isAvailable = isAvailable;
     this.isBorrowed = false;
     this.journal = journal;
     this.id = id;
 }