Ejemplo n.º 1
0
 public static Customer Login(string id, string password)
 {
     using (myProjectEntities db = new myProjectEntities())
     {
         try
         {
             Customer cust = db.Customers.Where(c => c.tz == id && c.password == c.password).First();
             return(cust);
         }
         catch (Exception e)
         {
             return(null);
         }
     }
 }
Ejemplo n.º 2
0
 public static List <Dish> Menu(int statusMeal)
 {
     using (myProjectEntities db = new myProjectEntities())
     {
         try
         {
             List <Dish> dish = db.Dishes.Where(d => d.statusMeal == statusMeal).ToList();
             return(dish);
         }
         catch (Exception e)
         {
             return(null);
         }
     }
 }
Ejemplo n.º 3
0
 public static bool Register(Customer cust)
 {
     using (myProjectEntities db = new myProjectEntities())
     {
         try
         {
             db.Customers.Add(cust);
             db.SaveChanges();
         }
         catch (Exception e)
         {
             return(false);
         }
         return(true);
     }
 }