public async Task CreateNewChecklistCategoryAsync(ChecklistCategoryModel checklistCategory, int unitId)
 {
     try
     {
         await _repository.CreateNewChecklistCategoryAsync(checklistCategory, unitId);
     }
     catch (OzoneException ex)
     {
         throw new OzoneException(ex.Message, ex.InnerException);
     }
 }
        public async Task <bool> UpdateChecklistCategory(ChecklistCategoryModel CategoryModel)
        {
            try
            {
                var status = await _repository.UpdateChecklistCategory(CategoryModel);

                return(status);
            }
            catch (OzoneException ex)
            {
                throw new OzoneException(ex.Message, ex.InnerException);
            }
        }
Example #3
0
        // Checklist Categories Section

        public async Task CreateNewChecklistCategoryAsync(ChecklistCategoryModel checklistCategory, int unitId)
        {
            try
            {
                checklistCategory.UnitChecklistId = unitId;
                await _db.ChecklistCategoriesTable.AddAsync(checklistCategory);

                await _db.SaveChangesAsync();
            }
            catch (OzoneException ex)
            {
                throw new OzoneException("Error in Creating New Checklist Category", ex);
            }
        }
Example #4
0
        public async Task <bool> UpdateChecklistCategory(ChecklistCategoryModel CategoryModel)
        {
            try
            {
                await GetSingleChecklistCategoryByIdAsync(CategoryModel.Id);

                //
                checklistCategoryModel.Name          = CategoryModel.Name;
                checklistCategoryModel.PublicVisible = CategoryModel.PublicVisible;
                checklistCategoryModel.Description   = CategoryModel.Description;
                return(await _db.SaveChangesAsync() > 0);
            }
            catch (OzoneException ex)
            {
                throw new OzoneException("Error in Updating Checklist Data in Database", ex);
            }
        }