Пример #1
0
        public void CustomersFuncsTest()
        {
            FlightDAOMSSQL flight = new FlightDAOMSSQL();

            flight.RemoveAll();
            CountryDAOMSSQL c = new CountryDAOMSSQL();

            c.RemoveAll();
            AirlineDAOMSSQL airline = new AirlineDAOMSSQL();

            airline.RemoveAll();
            Customer         cust1    = new Customer("gal", "mazana", "userrr", "123", "afula", "0526614430", "4580982574849111");
            Customer         cust2    = new Customer("hamody", "zoubi", "hahaaaaa", "321", "ein harod", "0954542323521", "6528429299292");
            CustomerDAOMSSQL customer = new CustomerDAOMSSQL();

            customer.RemoveAll();
            customer.Add(cust1);
            customer.Add(cust2);
            customer.Remove(cust2);
            Customer upddatedCust = customer.Get(cust1.Id); upddatedCust.UserName = "******";

            customer.Update(upddatedCust);
            IList <Customer> customers = customer.GetAll();

            Assert.AreEqual(customers[0], customer.Get(cust1.Id));
        }
Пример #2
0
 public void UpdateCustomerDetails(LoginToken <Administrator> token, Customer customer)
 {
     if (token != null)
     {
         _customerDAO = new CustomerDAOMSSQL();
         _customerDAO.Update(customer);
     }
 }