public IActionResult DeleteLocker([FromQuery] int id)
 {
     if (_contentRepo.DeleteContent(id))
     {
         return(Ok());
     }
     return(NotFound());
 }
Exemple #2
0
        public IActionResult DeleteContent([FromBody] ContentForm _cont)
        {
            TimeZoneInfo zone     = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time");
            DateTime     dateTime = TimeZoneInfo.ConvertTime(DateTime.Now, zone);

            //if deleting content success
            if (_contentRepo.DeleteContent(_cont.Id_content))
            {
                Log.Information("Delete content {id} OK. {DateTime}.", _cont.Id_content, dateTime);
                return(Ok(_cont.Id_content));
            }
            //if deleting content fail
            Log.Information("Cannot Delete content {id}. {DateTime}.", _cont.Id_content, dateTime);
            return(NotFound(_cont.Id_content));
        }
Exemple #3
0
        public bool DeleteContent(int id)
        {
            try
            {
                bool result = false;
                IContentRepository repos = new ContentRepository();

                result = repos.DeleteContent(id);

                if (result)
                {
                    Helpers.CacheHelper.RemoveObjectFromCache(Helpers.CacheHelperKeys.CK_ALL_PAGES);
                }

                return(result);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #4
0
 public bool DeleteContent(int contentID)
 {
     return(ContentRepository.DeleteContent(contentID));
 }
Exemple #5
0
 public bool Delete(int id)
 {
     return(_repo.DeleteContent(id));
 }