Example #1
0
        public async Task <TaskNotificationTypeDto> PutTaskNotificationType(int id, TaskNotificationTypeDto model)
        {
            var url    = CRMApiUri + "/TaskNotificationType/" + id;
            var result = await PutRequestToApi(url, model);

            return(result);
        }
Example #2
0
        public async Task <BaseEntity> SaveAndReturnEntityAsync(TaskNotificationTypeDto entityDto)
        {
            var entity = _mapper.Map <TaskNotificationType>(entityDto);
            var result = await _repository.SaveAndReturnEntityAsync(entity);

            return(result);
        }
Example #3
0
        public async Task <TaskNotificationTypeDto> PostTaskNotificationType(TaskNotificationTypeDto model)
        {
            var url    = CRMApiUri + "/TaskNotificationType";
            var result = await PostRequestToApi(url, model);

            return(result);
        }
Example #4
0
        public async Task <IActionResult> Put(int id, [FromBody] TaskNotificationTypeDto taskNotificationType)
        {
            if (id == 0 || taskNotificationType.Id == 0)
            {
                return(StatusCode(StatusCodes.Status400BadRequest, "Id needs to be greater than 0."));
            }

            return(await SaveAndReturnEntityAsync(async() => await _taskNotificationTypeService.SaveAndReturnEntityAsync(taskNotificationType)));
        }
Example #5
0
        public async Task <IActionResult> Post([FromBody] TaskNotificationTypeDto taskNotificationType)
        {
            if (taskNotificationType.Id != 0)
            {
                return(StatusCode(StatusCodes.Status400BadRequest, "Identity insert is not permitted."));
            }

            return(await SaveAndReturnEntityAsync(async() => await _taskNotificationTypeService.SaveAndReturnEntityAsync(taskNotificationType)));
        }
Example #6
0
        public IActionResult Save(TaskNotificationTypeDto model)
        {
            UpdateAuditInformation(model);
            if (!ModelState.IsValid)
            {
                GetStateSettings(ViewState.Write);
                return(PartialView("Edit", model));
            }
            model = model.Id > 0
                ? _lookupFacadeApiClient.PutTaskNotificationType(model.Id, model).Result
                : _lookupFacadeApiClient.PostTaskNotificationType(model).Result;

            if (!string.IsNullOrWhiteSpace(model.ErrorMessage))
            {
                return(PartialView("Edit", model));
            }
            return(Json(new { message = model.SuccessMessage }));
        }
Example #7
0
        public async Task <int> SaveAsync(TaskNotificationTypeDto entityDto)
        {
            var result = await SaveAndReturnEntityAsync(entityDto);

            return(result.Id);
        }
Example #8
0
 public async Task <TaskNotificationTypeDto> PutTaskNotificationType(int id, TaskNotificationTypeDto model)
 {
     return(await _taskNotificationTypeApiClient.PutTaskNotificationType(id, model));
 }
Example #9
0
 public async Task <TaskNotificationTypeDto> PostTaskNotificationType(TaskNotificationTypeDto model)
 {
     return(await _taskNotificationTypeApiClient.PostTaskNotificationType(model));
 }