public ActionResult SelectPrintTemplate(int certificateId)
 {
     List<LetterTemplate> templates = _letterTemplateService.GetAllLetterTemplate();
     ViewBag.Templates = new SelectList(templates.OrderBy(p => p.Name),"LetterTemplateID", "Name");
     var model = new PrintCertificateModel();
     model.SelectedCertificateId = certificateId;
     return PartialView("SelectTemplatePartial", model);
 }
        public ActionResult SelectPrintTemplate(PrintCertificateModel model)
        {
            if (ModelState.IsValid)
            {

                return RedirectToAction("LetterPreview",new {certificateId = model.SelectedCertificateId, templateId = model.SelctedTemplateId});
            }
            return PartialView("SelectTemplatePartial", model);
        }
 public ActionResult LetterPreview(int certificateId)
 {
     List<LetterTemplate> templates = _letterTemplateService.GetAllLetterTemplate();
     ViewBag.Templates = new SelectList(templates.OrderBy(p => p.Name), "LetterTemplateID", "Name");
     PrintCertificateModel model = new PrintCertificateModel();
     model.SelectedCertificateId = certificateId;
     return View("LetterPreview", model);
 }