コード例 #1
0
ファイル: CADPack.cs プロジェクト: MrRuffles/GRP5_GRP1_AMARON
        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
ファイル: CADPack.cs プロジェクト: MrRuffles/GRP5_GRP1_AMARON
        public bool deletePack(ENPack en)
        {
            bool ok = true;

            return(ok);
        }
コード例 #3
0
ファイル: CADPack.cs プロジェクト: MrRuffles/GRP5_GRP1_AMARON
        public bool updatePack(ENPack en)
        {
            bool ok = true;

            return(ok);
        }
コード例 #4
0
ファイル: CADPack.cs プロジェクト: MrRuffles/GRP5_GRP1_AMARON
        public bool readPack(ENPack en)
        {
            bool ok = true;

            return(ok);
        }