예제 #1
0
        public async Task <ApiResponse <CaseClosedModel> > CloseCase(CloseCaseModel model)
        {
            try
            {
                var transactionCase = caseRepository
                                      .Query()
                                      .SingleOrDefault(e => e.ID == model.CaseID);
                if (transactionCase != null)
                {
                    transactionCase.Status = CaseStatus.Closed;

                    await caseRepository.SaveChanges();
                }

                var responseModel = new CaseClosedModel {
                    IsSuccess = true
                };
                var response = new ApiResponse <CaseClosedModel>(responseModel);
                return(response);
            }
            catch (Exception e)
            {
                return(HandleErrorAndReturnStatus <ApiResponse <CaseClosedModel> >(e));
            }
        }
예제 #2
0
        public async Task <HttpResponseMessage> CloseCase(CloseCaseModel model)
        {
            var response = await service.CloseCase(model);

            var setOfflineStatus = await agentService.SetAgentOffline(UserIdentityID);

            var setOnlineStatus = await agentService.SetAgentOnline(UserIdentityID);

            return(SendHttpResponse(response));
        }