Ejemplo n.º 1
0
        public async Task <ResponseMessage> DeleteDesign(string designId)
        {
            try
            {
                //var searchFilter = new SearchFilter
                //{
                //    Filters = new List<Filter> {
                //        new Filter {
                //            PropertyName = "Designs", Operator = Operator.Equals, Value = designId
                //        }
                //    }
                //};

                //var usersCount = await _designService.GetUsersCount(searchFilter);

                //if (usersCount == 0)
                //{
                var status = await _designService.DeleteDesign(designId);

                return(new ResponseMessage {
                    Status = "Ok", Data = status
                });
                //}
                //else
                //    return new ResponseMessage { Status = "Error", Message = "HomePass cannot be deleted as there are users associated with the selected design." };
            }
            catch (Exception ex)
            {
                _logger?.LogError(ex, "Error deleting design.");
                return(new ResponseMessage {
                    Status = "Error", Message = "Error deleting design."
                });
            }
        }
Ejemplo n.º 2
0
        public async Task <object> Delete(string UID)
        {
            bool isValid = await _designService.DeleteDesign(UID);

            _notification.SetNotificationMessage(isValid, Title, UID);

            return(_notification);
        }