コード例 #1
0
 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"));
 }
コード例 #2
0
 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"));
 }
コード例 #3
0
 public ActionResult DeleteTemplate(MailBoxSytem.Models.Template template)
 {
     return(View());
 }