Exemplo n.º 1
0
        // Adds a new user to the DB
        public void AddLocation(string name, string address)
        {
            var newLocation = new TblLocation
            {
                Name    = name,
                Address = address
            };

            _db.Add(newLocation);
        }
        // Adds a new user to the DB
        public void AddUser(string given, string surname)
        {
            var newUser = new TblUsers
            {
                FirstName = given,
                LastName  = surname
            };

            _db.Add(newUser);
        }
        // Adds a new Order to the DB
        public void AddOrder(int custID, string ordLocation, DateTime?orderTime, decimal orderCost, int?locID)
        {
            var newOrder = new TblOrders
            {
                CustomerId    = custID,
                OrderLocation = ordLocation,
                OrderTime     = orderTime,
                OrderCost     = orderCost,
                LocationId    = locID
            };

            _db.Add(newOrder);
        }