예제 #1
0
        public bool createPack(ENPack en)
        {
            SqlConnection con     = new SqlConnection(constring);
            bool          correct = true;

            try
            {
                con.Open();
                using (SqlCommand cmd = new SqlCommand("", con))
                {
                    cmd.CommandText = "INSERT INTO Product (name, pvp, stock, brand, type, urlImage) values ('" + en.namePack + "', " + en.pricePack + ", " + en.stockPack + ", '" + en.brandPack + "', '" + en.typePack + "', '" + en.urlPack + "');";
                    cmd.ExecuteNonQuery();
                }
            }
            catch (SqlException ex)
            {
                Console.WriteLine("User operation has failed. Error: {0}", ex.Message);
                correct = false;
            }
            finally
            {
                con.Close();
            }
            return(correct);
        }
예제 #2
0
        public bool deletePack(ENPack en)
        {
            bool ok = true;

            return(ok);
        }
예제 #3
0
        public bool updatePack(ENPack en)
        {
            bool ok = true;

            return(ok);
        }
예제 #4
0
        public bool readPack(ENPack en)
        {
            bool ok = true;

            return(ok);
        }