public async Task <IHttpActionResult> ChangeStatus(ChangeStatusRequest dto) { Lobby template = new Lobby() { Id = dto.Id, Status = (enLobbyStatus)Enum.Parse(typeof(enLobbyStatus), dto.Status) }; try { string[] arProp = new string[] { "Id", "Status", "GameGroups", "Template" }; var entry = ctx.Entry <Lobby>(template); entry.State = EntityState.Modified; typeof(Lobby).GetProperties().Select(o => o.Name).Where(o => !arProp.Contains(o)).ToList() .ForEach(o => entry.Property(o).IsModified = false); await ctx.SaveChangesAsync(); } catch (Exception ex) { ex = ex.InnerException ?? ex; Logger.Exception_Error(ex); return(InternalServerError(ex)); } return(Ok()); }
public void ChangeStatus(ClientStatus status) { this.socket.NotNull(); const ClientCapabilities flags = ClientCapabilities.MSNC8 | ClientCapabilities.DirectIM | ClientCapabilities.InkAsGif | ClientCapabilities.MultiPacketMessaging | ClientCapabilities.Search | ClientCapabilities.SharingFolders | ClientCapabilities.SIPInvitations | ClientCapabilities.VoiceClips | ClientCapabilities.WebCam | ClientCapabilities.Winks; PackageRequest r1 = new ChangeStatusRequest(status, flags, string.Empty); PackageRequest r2 = new InitialPresenceNotificationRequest(status, flags, string.Empty) { Account = this.Account }; PackageRequest[] request = new PackageRequest[] { //r2, r1 }; Dictionary <int, PackageTransaction> response = this.socket.SendRangeAndBlock(request); //PackageResponse response = this.socket.SendAndBlock(request); }
public async Task <IHttpActionResult> Post(Guid?id, [FromBody] ChangeStatusRequest request) { if (!id.HasValue) { return(BadRequest("Invalid Id")); } var application = await _db.Applications.FindAsync(id); if (application == null) { return(NotFound()); } var status = await _db.ApplicationStatus.FindAsync(request.Status); if (status == null) { return(BadRequest($"Status {request.Status} is invalid")); } application.ApplicationStatusId = status.Id; _db.Entry(application).State = EntityState.Modified; _db.SaveChanges(); return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.NoContent))); }
public Model.Client ChangeStatus(int id, ChangeStatusRequest request) { var entity = _context.Client.Find(id); entity.Inactive = request.Inactive; _context.SaveChanges(); return(_mapper.Map <Model.Client>(entity)); }
public async Task ChangeProjectStatusDetach() { var groupShareClient = await Helper.GetGroupShareClient(); var projectStatusRequest = new ChangeStatusRequest("5afaf0b5-05c8-4401-920c-d3366096cfc6", ChangeStatusRequest.ProjectStatus.Completed); await groupShareClient.Project.ChangeProjectStatusDetach(projectStatusRequest); var project = await groupShareClient.Project.Get("5afaf0b5-05c8-4401-920c-d3366096cfc6"); Assert.Equal(4, project.Status); }
public async Task ChangeProjectStatus() { var groupShareClient = await Helper.GetGroupShareClient(); var projectStatusRequest = new ChangeStatusRequest("c1f47d9c-a9dd-4069-b636-3405d4fb98a8", ChangeStatusRequest.ProjectStatus.Completed); await groupShareClient.Project.ChangeProjectStatus(projectStatusRequest); var project = await groupShareClient.Project.Get("c1f47d9c-a9dd-4069-b636-3405d4fb98a8"); Assert.Equal(4, project.Status); }
public async Task <IActionResult> DispatchConfirmed(ChangeStatusRequest request) { await _endpoint.Publish <ConfirmCourierDispatch>(new() { CourierId = request.CourierId, OrderId = request.OrderId, CustomerId = request.CustomerId, RestaurantId = request.RestaurantId }); return(Ok()); }
public async Task <IActionResult> EnRouteToCustomer(ChangeStatusRequest request) { await _endpoint.Publish <CourierEnRouteToCustomer>(new() { CourierId = request.CourierId, OrderId = request.OrderId, CustomerId = request.CustomerId, RestaurantId = request.RestaurantId }); return(Ok()); }
public async Task ChangeProjectStatusDetach() { var groupShareClient = Helper.GsClient; var projectStatusRequest = new ChangeStatusRequest(ProjectId, ChangeStatusRequest.ProjectStatus.Completed); await groupShareClient.Project.ChangeProjectStatusDetach(projectStatusRequest); var project = await groupShareClient.Project.Get(ProjectId); Assert.Equal(4, project.Status); projectStatusRequest = new ChangeStatusRequest(ProjectId, ChangeStatusRequest.ProjectStatus.Started); await groupShareClient.Project.ChangeProjectStatus(projectStatusRequest); }
public async Task <ActionResult <bool> > ChangeStatus([FromBody] ChangeStatusRequest request) { var order = await orderRepository.GetByIdAsync(request.Id); if (order == null) { return(NotFound()); } order.Status = request.Status; await orderRepository.UpdateAsync(order); return(Ok(true)); }
public void ChangeTaskStatus([FromBody] ChangeStatusRequest changeStatusRequest) { //var task = testData.FirstOrDefault(x => x.Id == changeStatusRequest.Id); //if (task == null) //{ // throw new Exception("Task with id " + changeStatusRequest.Id + " not found"); //} //task.Status = changeStatusRequest.TaskStatus; //AddOrUpdateTask(task); //SaveTestData(); _taskService.ChangeTaskStatus(changeStatusRequest.Id, changeStatusRequest.TaskStatus); }
private void skinContextMenuStrip_State_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { ToolStripItem item = e.ClickedItem; skinButton_State.Image = item.Image; ChangeStatusRequest request = new ChangeStatusRequest(); request.UserID = GlobalResourceManager.CurrentUser.UserID; Int32.TryParse(item.Tag.ToString(), out Int32 status); request.Status = status <= 0 ? 1 : status; TCPClient.Singleton.SendProtoMessage(CMD.ChangeStatusRequestCMD, request); }
public SuccessResponse ChangeStatus(ChangeStatusRequest request) { try { var department = _departmentRepository.FindBy(request.Id); department.ThrowExceptionIfRecordIsNull(); department.Status.ThrowExceptionIfIsSameStatus(request.Status); department.Status = request.Status; _departmentRepository.Update(department); return(new SuccessResponse { IsSuccess = true }); } catch (DataAccessException) { throw new ApplicationException(); } }
public SuccessResponse ChangeStatus(ChangeStatusRequest request) { try { var ingredientGroup = _ingredientGroupRepository.FindBy(request.Id); ingredientGroup.ThrowExceptionIfRecordIsNull(); ingredientGroup.Status.ThrowExceptionIfIsSameStatus(request.Status); ingredientGroup.Status = request.Status; _ingredientGroupRepository.Update(ingredientGroup); return(new SuccessResponse { IsSuccess = true }); } catch (DataAccessException) { throw new ApplicationException(); } }
public SuccessResponse ChangeStatus(ChangeStatusRequest request) { try { var saucerConfiguration = _saucerConfigurationRepository.FindBy(request.Id); saucerConfiguration.ThrowExceptionIfRecordIsNull(); saucerConfiguration.Status.ThrowExceptionIfIsSameStatus(request.Status); saucerConfiguration.Status = request.Status; _saucerConfigurationRepository.Update(saucerConfiguration); return(new SuccessResponse { IsSuccess = true }); } catch (DataAccessException) { throw new ApplicationException(); } }
public SuccessResponse ChangeStatus(ChangeStatusRequest request) { try { var company = _companyRepository.FindBy(request.Id); company.ThrowExceptionIfRecordIsNull(); company.Status.ThrowExceptionIfIsSameStatus(request.Status); company.Status = request.Status; _companyRepository.Update(company); return(new SuccessResponse { IsSuccess = true }); } catch (DataAccessException) { throw new ApplicationException(); } }
public SuccessResponse ChangeStatus(ChangeStatusRequest request) { try { var role = _roleRepository.FindBy(request.Id); role.ThrowExceptionIfRecordIsNull(); role.Status.ThrowExceptionIfIsSameStatus(request.Status); _roleValidator.ValidateAndThrowException(role, "Base"); role.Status = request.Status; _roleRepository.Update(role); return(new SuccessResponse { IsSuccess = true }); } catch (DataAccessException) { throw new ApplicationException(); } }
public async Task ThenCurrentStatusIsMapped(ChangeStatusRequest request) { var result = await _mapper.Map(request); Assert.AreEqual(ApprenticeshipStatus.Completed, result.CurrentStatus); }
public SuccessResponse Put(ChangeStatusRequest request) { return(_saucerService.ChangeStatus(request)); }
public SuccessResponse Put(ChangeStatusRequest request) { return(_reservationService.ChangeStatus(request)); }
public void ChangeDistrictManagerStatus(ChangeStatusRequest request) { _districtManagerService.ChangeDistrictManagerStatus(request, UserName); }
public async Task <IActionResult> ChangeStatus(ChangeStatusRequest request) { var viewModel = await _modelMapper.Map <ChangeStatusRequestViewModel>(request); return(View(viewModel)); }
public SuccessResponse Put(ChangeStatusRequest request) { return(_ingredientService.ChangeStatus(request)); }
public SuccessResponse Put(ChangeStatusRequest request) { return(_departmentService.ChangeStatus(request)); }
public async Task ThenAccountHashedIdIsMappedCorrectly(ChangeStatusRequest request) { var result = await _mapper.Map(request); Assert.AreEqual(request.AccountHashedId, result.AccountHashedId); }
public Model.Client ChangeStatus(int id, ChangeStatusRequest request) { return(_service.ChangeStatus(id, request)); }
/// <summary> /// Returns the <see cref="Uri"/> that changes the project status /// </summary> /// <param name="statusRequest">Status request</param> public static Uri ChangeProjectStatus(ChangeStatusRequest statusRequest) { var status = Enum.GetName(typeof(ChangeStatusRequest.ProjectStatus), statusRequest.Status); return("{0}/projects/{1}/detach?status={2}".FormatUri(CurrentProjectServerUrl, statusRequest.ProjectId, status)); }