public void CreateOrderWithReturnedPrimaryKey() { Customer c = customerDB.Get("email", "*****@*****.**"); Order o = new Order(c); o.Orderlines.Add(new OrderLine(2, 200, productDB.Get("productID", 1.ToString()))); o = orderDB.Create(o); Assert.IsTrue(o.ID > 0); }
// Gets an order with customer and orderlines public Order GetOrder(int id) { Order o = orderDB.Get(id); o.Customer = customerDB.Get("customerID", o.Customer.ID.ToString()); o.Orderlines = orderLineDB.GetOrderlinesByOrderID(o.ID); return(o); }
// Khai báo các chức năng xử lý nghiệp vụ /// <summary> /// Hiển thị customers /// </summary> /// <param name="page"></param> /// <param name="pageSize"></param> /// <param name="searchValue"></param> /// <param name="rowCount"></param> /// <returns></returns> public static List <Order> ListOfOrders(int page, int pageSize, string searchValue, string status, out int rowCount) { if (page < 1) { page = 1; } if (pageSize < 0) { pageSize = 20; } rowCount = OrderDB.Count(searchValue, status); List <Order> listOrders = OrderDB.List(page, pageSize, searchValue, status); foreach (var order in listOrders) { order.Customer = CustomerDB.Get(order.CustomerID); order.Employee = EmployeeDB.Get(order.EmployeeID); } return(listOrders); }
public Customer GetCustomerByMail(string email) { return(customerDB.Get("email", email)); }
/// <summary> /// Lấy 1 Customer /// </summary> /// <param name="CustomerID"></param> /// <returns></returns> public static Customer Customer_Get(string customerID) { return(CustomerDB.Get(customerID)); }
/// <summary> /// GET ONE CUSTOMER /// </summary> /// <param name="customerID"></param> /// <returns></returns> public static Customer getCustomer(string customerID) { return(CustomerDB.Get(customerID)); }
public static Customer GetCustomer(string CustomerID) { return(CustomerDB.Get(CustomerID)); }
public static Customer GetCustomer(string customerId) { return(CustomerDB.Get(customerId)); }