Beispiel #1
0
 public List <Product> AllProducts()
 {
     using (var db = new InveTimeContext())
     {
         var products = db.Products.ToList();
         return(products);
     }
 }
Beispiel #2
0
 public List <TypeProduct> AllTypeProducts()
 {
     using (var db = new InveTimeContext())
     {
         var typeProducst = db.TypeProducts.ToList();
         return(typeProducst);
     }
 }
Beispiel #3
0
 public List <User> AllUsers()
 {
     using (var db = new InveTimeContext())
     {
         var users = db.Users.ToList();
         return(users);
     }
 }
Beispiel #4
0
        public void AddTypeProduct(string _name)
        {
            var typeProduct = new TypeProduct(_name);

            using (var db = new InveTimeContext())
            {
                db.TypeProducts.Add(typeProduct);
                db.SaveChanges();
            }
        }
Beispiel #5
0
        public void AddProduct(string _EAC, string _name, int _amount, double?_cost)
        {
            var product = new Product(_EAC, _name, _amount, _cost);

            using (var db = new InveTimeContext())
            {
                db.Products.Add(product);
                db.SaveChanges();
            }
        }
Beispiel #6
0
        public void AddPositionUser(string _position, int _acsessLevel)
        {
            var positionUser = new PositionUser(_position, _acsessLevel);

            using (var db = new InveTimeContext())
            {
                db.PositionUsers.Add(positionUser);
                db.SaveChanges();
            }
        }
Beispiel #7
0
        public void AddUser(string _login, string _password, string _name, string _secondName, string _email)
        {
            var user = new User(_login, _password, _name, _secondName, _email);

            using (var db = new InveTimeContext())
            {
                db.Users.Add(user);
                db.SaveChanges();
            }
        }