i would like to add some more functionalities to my method, such as an email to be sent once the user has successfully edited the data. i could need with some help as i do not how to approach this functionality.
[HttpPost]
public ActionResult Edit(EditPTG eptg)
{
try
{
using (ManageGrade gradLogic = new ManageGrade(ref uow))
{
foreach (var ptg in eptg.ptgForGrade)
{
ptg.Overwritten = true;
ptg.Active = true;
productToGradeLogic.Update(ptg);
}
gradLogic.Update(eptg.grade);
TempData["Success"] = "Edit Successful";
MailMessage mail = new MailMessage();
return RedirectToAction("Index");
}
}
catch
{
TempData["Failure"] = "Edit Failed, Please Review Your Selections and Try Again.";
return View(eptg);
}
}