예제 #1
0
        public Supplier getSupplierByName(string name)
        {
            supplier s = ctx.suppliers.FirstOrDefault(x => x.name == name);
               Supplier supp = new Supplier();

               supp.SupplierId = s.supplierId;
               supp.SupplierName = s.name;
               supp.ContactName = s.contactName;
               return supp;
        }
예제 #2
0
 public List<Supplier> getAllSupplier()
 {
     var su = from ss in ctx.suppliers
             select ss;
        List<Supplier> slist = new List<Supplier>();
     foreach(supplier supp in su.ToList())
     {
         Supplier s = new Supplier();
         s.SupplierId = supp.supplierId;
         s.SupplierName = supp.name;
         s.ContactName = supp.contactName;
         slist.Add(s);
     }
     return slist;
 }