Ejemplo n.º 1
0
 public async Task AddChargeLocationAsync(ChargeLocationModel CLC)
 {
     using (var s = HibernateSession.GetCurrentSession()) {
         using (var tx = s.BeginTransaction()) {
             s.Save(CLC);
             tx.Commit();
             s.Flush();
         }
     }
 }
 // POST api/<controller>
 public async Task Post(ChargeLocationViewModel value)
 {
     var nhus           = new NHibernateUserStore();
     var nhcs           = new NHibernateCompanyStore();
     var chargeLocation = new ChargeLocationModel {
         ChargeLocationCode = value.ChargeLocationCode,
         ChargeLocationName = value.ChargeLocationName,
         CreatedBy          = await nhus.FindByStampAsync(value.SecurityStamp)
     };
     await nhcs.AddChargeLocationAsync(chargeLocation);
 }