Exemple #1
0
        //crudoperations

        //1 get purchase details using sellerid
        public static IEnumerable <PURCHASES> GetSellerPurchase(int sellerid)
        {
            IEnumerable <PURCHASES> purchases = PURCHASESDDAL.GetAll();
            var list = from p in purchases where p.SELLERID.Equals(sellerid) select p;

            return(list);
        }
        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>());
        }
        //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);
        }
Exemple #4
0
 //4 insert purchase
 public static bool InsertCustomer(PURCHASES product) => PURCHASESDDAL.InsertPurchase(product);
Exemple #5
0
 //2 getAll purchase
 public static List <PURCHASES> GetPuchases() => PURCHASESDDAL.GetAll();