예제 #1
0
        public int AddLocation(Plocation location)
        {
            int i = 0;

            try
            {
                DBinstance.Instance.Add(location);
                i = DBinstance.Instance.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                Console.WriteLine("Insertion Gone Wrong, Pls Check your network:");
                Console.WriteLine();
            }
            catch (Exception e)
            {
                Console.WriteLine("Couldn't Insert LOCATION: ");
                Console.WriteLine(e);
                Console.WriteLine();
            }


            return(i);
        }
예제 #2
0
 public List <Pizza> GetPizzasFromLocation(Plocation location)
 {
     //if it is distinct by name, you can get an exception. This logic is not feasible
     return(GetDistinctPizzas().Where <Pizza>(r => r.SLocationId == location.LocationId).ToList());
 }
예제 #3
0
 public void voidDeleteLocation(Plocation location)
 {
 }