コード例 #1
0
        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);
        }
コード例 #2
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);
        }
コード例 #3
0
        // 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);
        }
コード例 #4
0
 public Customer GetCustomerByMail(string email)
 {
     return(customerDB.Get("email", email));
 }
コード例 #5
0
 /// <summary>
 /// Lấy 1 Customer
 /// </summary>
 /// <param name="CustomerID"></param>
 /// <returns></returns>
 public static Customer Customer_Get(string customerID)
 {
     return(CustomerDB.Get(customerID));
 }
コード例 #6
0
 /// <summary>
 /// GET ONE CUSTOMER
 /// </summary>
 /// <param name="customerID"></param>
 /// <returns></returns>
 public static Customer getCustomer(string customerID)
 {
     return(CustomerDB.Get(customerID));
 }
コード例 #7
0
 public static Customer GetCustomer(string CustomerID)
 {
     return(CustomerDB.Get(CustomerID));
 }
コード例 #8
0
 public static Customer GetCustomer(string customerId)
 {
     return(CustomerDB.Get(customerId));
 }