Пример #1
0
        public bool readRatting(ENRatting en)
        {
            bool correct = true;


            return(correct);
        }
Пример #2
0
        public bool createRatting(ENRatting en)
        {
            bool          correct   = true;
            SqlConnection conection = new SqlConnection(constring);

            try
            {
                conection.Open();

                using (SqlCommand cmd = new SqlCommand("", conection))
                {
                    cmd.CommandText = "INSERT INTO Rating(value, product, userID, comment) values ("
                                      + en.rvalue + "," + en.prodID + ", " + en.user + ", '" + en.commentPublic + "');";

                    cmd.ExecuteNonQuery();
                }
            }
            catch (SqlException ex)
            {
                Console.WriteLine("Error al inserta el rating en la base de datos. ", ex.Message);
                correct = false;
            }
            finally
            {
                conection.Close();
            }

            return(correct);
        }
Пример #3
0
        public bool deleteRatting(ENRatting en)
        {
            bool correct = false;

            return(correct);
        }
Пример #4
0
        public bool updateRatting(ENRatting en)
        {
            bool correct = true;

            return(correct);
        }