Exemple #1
0
        public Customer GetCustomerByName(string name)
        {
            var Customer = context.Customers.Where(x => x.Name == name).FirstOrDefault();

            if (Customer == null)
            {
                context.Add(mapper.Map(new Domain.Models.Customer {
                    Name = name
                }));
                context.SaveChanges();

                Customer = context.Customers.Where(x => x.Name == name).FirstOrDefault();
            }

            return(mapper.Map(Customer));
        }
 public void AddUser(User x)
 {
     _db.Person.Add(Mapper.Map(x));
     _db.SaveChanges();
 }
 public void AddTopping(Topping t)
 {
     _db.Topping.Add(Mapper.Map(t));
     _db.SaveChanges();
 }
 public void AddRestaurant(Restaurant x)
 {
     _db.Restaurant.Add(Mapper.Map(x));
     _db.SaveChanges();
 }
 public void AddOrder(Order Order)
 {
     Order.TimePlaced = System.DateTime.Now;
     context.Add(mapper.Map(Order));
     context.SaveChanges();
 }
Exemple #6
0
 public void AddPizza(Pizza Pizza)
 {
     context.Add(mapper.Map(Pizza));
     context.SaveChanges();
 }
 public void AddPizza(Pizza x)
 {
     _db.Pizza.Add(Mapper.Map(x));
     _db.SaveChanges();
 }
 public void AddLocation(Location t)
 {
     DbInstance.Instance.StoreLocation.Add(Mapper.Map(t));
     _db.SaveChanges();
 }
 public void AddInventory(Inventory x)
 {
     _db.Inventory.Add(Mapper.Map(x));
     _db.SaveChanges();
 }
Exemple #10
0
 public void AddOrder(Order x)
 {
     _db.Requisition.Add(Mapper.Map(x));
     _db.SaveChanges();
 }
 public void AddCustomer(Customer customer)
 {
     context.Add(customer);
     context.SaveChanges();
 }