Пример #1
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);
        }
Пример #2
0
 /* EMPLOYEE*/
 /// <summary>
 /// Lấy 1 Employee
 /// </summary>
 /// <param name="EmployeeID"></param>
 /// <returns></returns>
 public static Employee GetEmployee(int EmployeeID)
 {
     return(EmployeeDB.Get(EmployeeID));
 }
Пример #3
0
 public static Employee GetEmployee(int employeeId)
 {
     return(EmployeeDB.Get(employeeId));
 }