コード例 #1
0
ファイル: Email.cs プロジェクト: telebovich/KosherWine
 public static void Add(Email email)
 {
     ISession session = MvcApplication.SessionFactory.OpenSession();
     using (ITransaction tx = session.BeginTransaction())
     {
         session.Save(email);
         tx.Commit();
     }
 }
コード例 #2
0
        public ActionResult Index(FormCollection collection)
        {
            try
            {
                KosherWine.Models.Email email = new KosherWine.Models.Email();
                email.Address = Request.Form["Email"];
                KosherWine.Models.Email.Add(email);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
コード例 #3
0
        public ActionResult Index(FormCollection collection)
        {
            try
            {
                KosherWine.Models.Email email = new KosherWine.Models.Email();
                email.Address = Request.Form["Email"];
                KosherWine.Models.Email.Add(email);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }