Пример #1
0
        public string saveProducts(string Name, double Price, string description, string category)
        {
            string Outcome = "";

            string query = "INSERT INTO `productos`(`Nombre`, `Precio`, `Categoria`, `Descripcion`) VALUES('" + Name + "','" + Price + "','" + category + "','" + description + "')";


            string Answer = dataBase.SaveData(query);

            if (Answer == "True")
            {
                Outcome = "Se han guardado los datos";
            }
            else if (Answer == "False")
            {
                Outcome = "Error, no se han insertado los datos";
            }
            else
            {
                Outcome = Answer;
            }



            return(Outcome);
        }