public ActionResult Index([Bind(Include = "Type, Reason, Amount")] NewGrant ng)
        {
            GrantApplication g = new GrantApplication();

            g.GrantApplicationReason        = ng.Reason;
            g.GrantApplicationRequestAmount = ng.Amount;
            g.GrantAppicationDate           = DateTime.Now;

            db.GrantApplications.Add(g);
            db.SaveChanges();

            MessageClass m = new MessageClass();

            m.MessageText = "Thank you, the book has been added";

            return(View("Result", m));
        }
Beispiel #2
0
        public ActionResult Index([Bind(Include = "GrantTypeKey, GrantApplicationRequestAmount, GrantApplicationReason")] NewGrant ng)
        {
            GrantApplication grant = new GrantApplication();

            grant.PersonKey                     = (int)Session["personKey"];
            grant.GrantAppicationDate           = DateTime.Now;
            grant.GrantTypeKey                  = ng.GrantTypeKey;
            grant.GrantApplicationRequestAmount = ng.GrantApplicationRequestAmount;
            grant.GrantApplicationReason        = ng.GrantApplicationReason;
            db.GrantApplications.Add(grant);
            db.SaveChanges();

            Message m = new Message();

            m.MessageText = "Thank you for applying! We will get back to you shortly.";

            return(View("Result", m));
        }