Пример #1
0
        public ActionResult CreateClass(PledgeClassModel m)
        {
            if (ModelState.IsValid)
            {

                SAE_DB _context = new SAE_DB();

                var pledgeClass = new PLEDGE_CLASS
                {
                    CO_PLEDGE_ED_FIRST_NAME = m.Co_Pledge_Educator_First_Name,
                    CO_PLEDGE_ED_LAST_NAME = m.Co_Pledge_Educator_Last_Name,
                    PLEDGE_ED_FIRST_NAME = m.Pledge_Educator_First_Name,
                    PLEDGE_ED_LAST_NAME = m.Pledge_Educator_Last_Name,
                    PLEDGE_CLASS_NAME = m.Pledge_Class_Name,
                    PLEDGE_CLASS_SEM = m.Pledge_Class_Semester,
                    PLEDGE_CLASS_YEAR = m.Pledge_Class_Year,
                    PLEDGE_COUNT = m.Pledge_Count,
                    PLEDGE_CLASS_ID = m.Pledge_Class_ID,
                    PLEDGE_DROP_COUNT = m.Pledge_Drop_Count,
                    INITIATED_COUNT = m.Pledge_Initiated_Count
                };

                _context.PLEDGE_CLASS.Add(pledgeClass);
                _context.SaveChanges();

                return RedirectToAction("CreatePledge");
            }
            return View("CreateClass");
        }
Пример #2
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");
        }