Ejemplo n.º 1
0
        public static List<ProductInformation> GetData()
        {
            EntitiesModel superMarketDb = new EntitiesModel();
            var test = (from p in superMarketDb.Products
                        select new ProductInformation()
                        {
                            ProductName = p.ProductName,
                            MeasureId = p.Measure.IdMeasures,
                            VendorId = p.Vendor.IdVendors,
                            BasePrice = p.BasePrice
                        }).ToList();

            return test;

            ////Console.WriteLine(test);
            //foreach (var item in test)
            //{
            //    Console.WriteLine("--------------------------------------");
            //    Console.WriteLine(item.BasePrice);
            //    Console.WriteLine(item.Measure);
            //    Console.WriteLine(item.ProductName);
            //    Console.WriteLine(item.VendorName);
            //    Console.WriteLine("--------------------------------------");
            //}
        }
Ejemplo n.º 2
0
 public static List<VendorInformation> GetVendors()
 {
     EntitiesModel superMarketDb = new EntitiesModel();
     var test = (from v in superMarketDb.Vendors
                 select new VendorInformation()
                 {
                     VendorId = v.IdVendors,
                     VendorName = v.VendorName
                 }).ToList();
     return test;
 }
Ejemplo n.º 3
0
 public static List<MeasureInformation> GetMeasures()
 {
     EntitiesModel superMarketDb = new EntitiesModel();
     var test = (from m in superMarketDb.Measures
                 select new MeasureInformation()
                 {
                     MeasureId = m.IdMeasures,
                     MeasureName = m.MeasureName
                 }).ToList();
     return test;
 }