Ejemplo n.º 1
0
        // GET: Default
        public ActionResult Home()
        {
            VolunteerApplicationVM volunteerApplication = new VolunteerApplicationVM();

            ViewBag.GenderList = LoadGenderDDl();
            return(View(volunteerApplication));
        }
Ejemplo n.º 2
0
        public bool AddVolunteer(VolunteerApplicationVM volunteerApplication)
        {
            bool isSuccess = false;

            if (volunteerApplication != null)
            {
                Volunteers_Application volunteers_Application = new Volunteers_Application();
                volunteers_Application.City               = volunteerApplication.City;
                volunteers_Application.Email              = volunteerApplication.Email;
                volunteers_Application.Gender             = volunteerApplication.Gender;
                volunteers_Application.MessageDescription = volunteerApplication.MessageDescription;
                volunteers_Application.Name               = volunteerApplication.Name;

                try
                {
                    _dbContext.Volunteers_Application.Add(volunteers_Application);
                    _dbContext.SaveChanges();
                    isSuccess = true;
                }
                catch (Exception ex)
                {
                    isSuccess = false;
                }
            }
            return(isSuccess);
        }
Ejemplo n.º 3
0
 public ActionResult PostVolunteerData(VolunteerApplicationVM volunteerApplication)
 {
     if (ModelState.IsValid)
     {
         _accountRepo.AddVolunteer(volunteerApplication);
     }
     return(View("Home"));
 }