Ejemplo n.º 1
0
 public ActionResult Edit(VMCostType vm)
 {
     using (ISession session = Hook.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             try
             {
                 session.SaveOrUpdate(vm);
                 transaction.Commit();
             }
             catch (Exception e)
             {
                 transaction.Rollback();
                 return(View());
             }
         }
         return(RedirectToAction("Index"));
     }
 }
Ejemplo n.º 2
0
 public virtual void SetCostType(VMCostType costType)
 {
     costType.Entries.Add(this);
     CostType = costType;
 }