public ViewResult EditGiftCertificate(int id)
 {
     var viewModel = new EditGiftCertificateViewModel()
       {
     Certificate = this.session.Repository<GiftCertificate>().GetAll("Sales").FirstOrDefault(c => c.Id == id)
       };
       return View(viewModel);
 }
 public ActionResult EditGiftCertificate(EditGiftCertificateViewModel viewModel)
 {
     if (!ModelState.IsValid)
     return View(viewModel);
       this.SaveEntity(viewModel.Certificate);
       return RedirectToAction("GiftCertificates");
 }
 public ViewResult CreateGiftCertificate()
 {
     var viewModel = new EditGiftCertificateViewModel()
       {
     Certificate = this.session.Repository<GiftCertificate>().Create()
       };
       viewModel.Certificate.Sales = new List<GiftCertificateSale>();
       return View("EditGiftCertificate", viewModel);
 }