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

            using (var db = new InveTimeContext())
            {
                db.TypeProducts.Add(typeProduct);
                db.SaveChanges();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }