Ejemplo n.º 1
0
        public int RegisterNewOrder(int _customerID)
        {
            string query = "INSERT INTO [Orders](CustomerID) VALUES (@CustomerID); SELECT SCOPE_IDENTITY();";
            List <KeyValuePair <string, object> > parameterlist = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@CustomerID", _customerID)
            };

            return(SQL_CRUD_Methods.SQLInsert(query, parameterlist));
        }
Ejemplo n.º 2
0
        public int GetNewDelivery()
        {
            string query = "INSERT INTO Delivery(DateTime,ExternalID) VALUES (@DateTime,@ExternalID); SELECT SCOPE_IDENTITY()";
            List <KeyValuePair <string, Object> > parameterlist = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@DateTime", DateTime.Now),
                new KeyValuePair <string, object>("@ExternalID", "X")
            };

            return(SQL_CRUD_Methods.SQLInsert(query, parameterlist));
        }
Ejemplo n.º 3
0
        public int SaveNewProduct(Product _product)
        {
            string query = "INSERT INTO Product(Type,Name,Volume,VolumeType,AmountInStock,Active) VALUES (@Type,@Name,@Volume,@VolumeType,@AmountInStock,@Active)";
            List <KeyValuePair <string, object> > parameterlist = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@Type", _product.VolumeType),
                new KeyValuePair <string, object>("@Name", _product.Name),
                new KeyValuePair <string, object>("@Volume", _product.Volume),
                new KeyValuePair <string, object>("@VolumeType", _product.VolumeType),
                new KeyValuePair <string, object>("@AmountInStock", 0),
                new KeyValuePair <string, object>("@Active", _product.Active)
            };

            return(SQL_CRUD_Methods.SQLInsert(query, parameterlist));
        }