Пример #1
0
 public void CreatCustomer()
 {
     Customer cus = new Customer { UserName = "******", UserPwd = "123456" };
     int id=Sqldo.CreatCustomer(cus);
     Customer customer = Sqldo.getUser(id);
     Console.WriteLine(customer.UserPwd+customer.UserName);
 }
Пример #2
0
 public void GetCustomerByIdTest()
 {
     var tempCutomer = new Customer { UserName = "******", UserPwd = "123456" };
     Sqldo.UpdateUser(tempCutomer);
     Customer user = Sqldo.getUser(1);
     int customerId = user.UserId;
     Assert.AreEqual(1, customerId);
 }
Пример #3
0
 public void saveorupdateTrn(Customer cus)
 {
     using (ITransaction itn = _isession.BeginTransaction())
     {
         try
         {
             _isession.SaveOrUpdate(cus);
             _isession.Flush();
             itn.Commit();
         }
         catch (Exception e)
         {
             itn.Rollback();
         }
     }
 }
Пример #4
0
 public void delCustomer(Customer cus)
 {
     _isession.Delete(cus);
     _isession.Flush();
 }
Пример #5
0
 public int CreatCustomer(Customer cus)
 {
     int newid = (int)_isession.Save(cus);
     _isession.Flush();
     return newid;
 }
Пример #6
0
 public void UpdateUser(Customer u)
 {
     _isession.Save(u);
     _isession.Flush();
 }
Пример #7
0
 public void UpdateCustomer(Customer cus)
 {
     _isession.Update(cus);
     _isession.Flush();
 }