public ActionResult Create(CompanyEmailTemplate companyemailtemplate)
 {
     if (ModelState.IsValid) {
         companyemailtemplateRepository.InsertOrUpdate(companyemailtemplate);
         companyemailtemplateRepository.Save();
         return RedirectToAction("Index");
     } else {
         ViewBag.PossibleTemplateCreatedByUsers = userRepository.All;
         return View(companyemailtemplate);
     }
 }
 public ViewResult Search(CompanyEmailTemplate searchCompanyEmailTemplate)
 {
     if(searchCompanyEmailTemplate!=null)
     {
                     }
                 return View("Index",companyemailtemplateRepository.AllIncluding(companyemailtemplate => companyemailtemplate.TemplateCreatedByUser));
 }
 public ActionResult Create()
 {
     CompanyEmailTemplate companyemailtemplate = new CompanyEmailTemplate();
     ViewBag.PossibleTemplateCreatedByUsers = userRepository.All;
     return View(companyemailtemplate);
 }
Ejemplo n.º 4
0
 public void InsertOrUpdate(CompanyEmailTemplate companyemailtemplate)
 {
     if (companyemailtemplate.CompanyEmailTemplateID == default(int)) {
         // New entity
         context.CompanyEmailTemplate.Add(companyemailtemplate);
     } else {
         // Existing entity
         context.Entry(companyemailtemplate).State = EntityState.Modified;
     }
 }