public async Task <IActionResult> Create([Bind("CustomId,CustomName,CustomDetails,CustomLocation,CauseType,DonateLink,Username")] CustomCauses customCauses) { if (ModelState.IsValid) { _context.Add(customCauses); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customCauses)); }
public async Task <IActionResult> Create([Bind("CtypeName")] CharityType charityType) { if (ModelState.IsValid) { _context.Add(charityType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(charityType)); }
public async Task <IActionResult> Create([Bind("PostId,PostDetails,PostDate,PostTitle,UserEmail")] Posts posts) { if (ModelState.IsValid) { _context.Add(posts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(posts)); }
public async Task <IActionResult> Create([Bind("DisasterId,DisasterName,DisasterDetails,DisasterLocation,DisasterLink,Urgency,DtypeName")] Disaster disaster) { if (ModelState.IsValid) { _context.Add(disaster); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DtypeName"] = new SelectList(_context.DisasterType, "DtypeName", "DtypeName", disaster.DtypeName); return(View(disaster)); }
public async Task <IActionResult> Create([Bind("CharityId,CharityDetails,CharityName,CharityOrganization,CharityLocation,CharityLink,CtypeName")] Charity charity) { if (ModelState.IsValid) { _context.Add(charity); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CtypeName"] = new SelectList(_context.CharityType, "CtypeName", "CtypeName", charity.CtypeName); return(View(charity)); }