示例#1
0
        public ActionResult CreatePledge(PledgeViewModel m)
        {
            if (ModelState.IsValid)
            {
                SAE_DB _context = new SAE_DB();

                var CreatePledgeVM = new PledgeViewModel();

                var pledge = new PLEDGE
                {
                    FIRST_NAME = m.FirstName,
                    LAST_NAME = m.LastName,
                    PHONE = m.PhoneNumber,
                    STREET_ADDR = m.Street_Address,
                    CITY = m.City,
                    EMAIL = m.Email,
                    ZIP = m.ZipCode,
                    BIG_BROTHER_FIRST = m.BigBro_First,
                    BIG_BROTHER_LAST = m.BigBro_Last,
                    GRAD_YEAR = m.GradYear,
                    PLEDGE_ID = m.PledgeID,
                    PLEDGE_CLASS_ID = m.Pledge_Class_ID
                };

                _context.PLEDGEs.Add(pledge);

                _context.SaveChanges();

                return RedirectToAction("CreatePledge");
            }
            return View("CreatePledge");
        }
示例#2
0
        public ActionResult EditPledge()
        {
            PledgeViewModel pvm = new PledgeViewModel();
            pvm.FirstNameDropDownList.Pledges = PledgeFirstDropDownList();
            pvm.LastNameDropDownList.Pledges = PledgeLastDropDownList();

            return View(pvm);
        }
示例#3
0
        public ActionResult CreatePledge()
        {
            PledgeViewModel cpvm = new PledgeViewModel();
            cpvm.ClassDropDownList.Classes = ClassDropDownList();

            return View(cpvm);
        }