public ActionResult UpdateTemplate(MailBoxSytem.Models.Template template) { if (!ModelState.IsValid) { return(View(template)); } dbContext.templates.Attach(template); dbContext.Entry(template).State = EntityState.Modified; dbContext.SaveChanges(); return(RedirectToAction("ListTemplates")); }
public ActionResult CreateTemplate(MailBoxSytem.Models.Template template) { if (!ModelState.IsValid) { return(View(template)); } dbContext.templates.Add(template); dbContext.SaveChanges(); dbContext.TemplateDetails.Add(new Models.TemplateDetails() { Body = "", Subject = "", TemplateId = template.Id });; dbContext.SaveChanges(); return(RedirectToAction("ListTemplates")); }
public ActionResult DeleteTemplate(MailBoxSytem.Models.Template template) { return(View()); }