Beispiel #1
0
		public void Update(Customer customer)
		{
			Customer dest = WebSiteDB.MyNorthwind.Customers.FirstOrDefault(c => c.CustomerID == customer.CustomerID);
			if( dest != null ) {
				dest.CustomerName = customer.CustomerName;
				dest.Address = customer.Address;
				dest.ContactName = customer.ContactName;
				dest.PostalCode = customer.PostalCode;
				dest.Tel = customer.Tel;
			}
		}
Beispiel #2
0
		public void Update(Customer customer)
		{
			customer.EnsureItemIsOK();

			BllFactory.GetCustomerBLL().Update(customer);
		}
Beispiel #3
0
		public void Insert(Customer customer)
		{
			int maxId = WebSiteDB.MyNorthwind.Customers.Max(x => x.CustomerID);
			customer.CustomerID = maxId + 1;
			WebSiteDB.MyNorthwind.Customers.Add(customer);
		}
Beispiel #4
0
		public void Insert(Customer customer)
		{
			customer.EnsureItemIsOK();

			BllFactory.GetCustomerBLL().Insert(customer);
		}