Пример #1
0
        public IActionResult GetById(/*[FromRoute]*/ int Id)
        {
            TypeTheme type = new TypeTheme();

            type = _typeRepo.GetById(Id);
            return(Ok(type));
        }
Пример #2
0
        public IActionResult Update([FromBody] TypeTheme typeTheme)
        {
            int success = _typeRepo.Update(typeTheme);

            if (success == 0)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Пример #3
0
        //CREATE

        public int Create(TypeTheme typetheme)
        {
            Command cmd = new Command("Create_TypeTheme", true);

            cmd.AddParameter("nom", typetheme.Nom);
            int Success = 0;

            try
            {
                _connection.ExecuteNonQuery(cmd);
            }
            catch (SqlException ex)
            {
                if (ex.Message.Contains(""))
                {
                    return(Success = 1);
                }
            }
            return(Success);
        }