Exemplo n.º 1
0
        public static IEnumerable <PURCHASEDETAILS> SellerOrderDetails(int sellerId)
        {
            List <PURCHASES>       purchases       = PURCHASESDDAL.GetPurchase(sellerId);
            List <PURCHASEDETAILS> purchaseDetails = PURCHASEDETAILSDAL.GetAll();

            foreach (PURCHASES ps in purchases)
            {
                var details = from pd in purchaseDetails where pd.PURCHASENO.Equals(ps.PURCHASENO) select pd;
                return(details);
            }

            return(new List <PURCHASEDETAILS>());
        }
Exemplo n.º 2
0
        //special operations
        public static SELLERS SellerAllData(int id)
        {
            SELLERS seller = null;

            try
            {
                seller           = SELLERSDAL.Get(id);
                seller.ADDRESS   = SELLERSADDRESSDAL.GetAll(id);
                seller.PURCHASES = PURCHASESDDAL.GetPurchase(id);
            }
            catch (NullReferenceException nex)
            {
                seller.ADDRESS   = new List <SELLERSADDRESS>();
                seller.PURCHASES = new List <PURCHASES>();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(seller);
        }