Ejemplo n.º 1
0
        public static List <ORDERDETAILS> CustomerOrderDetails(int custid)
        {
            List <ORDERS>       orders       = ORDERSDAL.GetOrders(custid);
            List <ORDERDETAILS> orderdetails = ORDERDETAILSDAL.GetAll();
            List <ORDERDETAILS> details      = new List <ORDERDETAILS>();

            foreach (ORDERS o in orders)
            {
                foreach (ORDERDETAILS detail in orderdetails)
                {
                    if (o.ORDERNUM == detail.ORDERNUM)
                    {
                        details.Add(detail);
                    }
                }
            }

            return(details);
        }
Ejemplo n.º 2
0
        //special operations
        public static CUSTOMERS CustomerAllData(int id)
        {
            CUSTOMERS customer = null;

            try
            {
                customer         = CUSTOMERSDAL.Get(id);
                customer.ADDRESS = CUSTOMERADDRESSDAL.GetAddress(id);
                customer.ORDERS  = ORDERSDAL.GetOrders(id);
            }
            catch (NullReferenceException nex)
            {
                customer.ADDRESS = new List <CUSTOMERADDRESS>();
                customer.ORDERS  = new List <ORDERS>();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(customer);
        }
Ejemplo n.º 3
0
 //4 insert customer
 public static bool InsertOrder(ORDERS order) => ORDERSDAL.InsertOrder(order);
Ejemplo n.º 4
0
 //2  getAll customers
 public static List <ORDERS> GetAllOrders() => ORDERSDAL.GetAll();
Ejemplo n.º 5
0
        //crudoperations

        //1 get customer details using name
        public static List <ORDERS> GetOrders(int custID) => ORDERSDAL.GetOrders(custID);