public static string ToHumanReadable(this CongressVotingRejectionReasonEnum rejectionReason) { switch (rejectionReason) { case CongressVotingRejectionReasonEnum.NotEnoughVotes: return("not enough votes"); case CongressVotingRejectionReasonEnum.NotEnoughGoldToConstructCompany: return("not enough gold to construct company"); case CongressVotingRejectionReasonEnum.RegionIsNotYoursConstructCompany: return("region has been lost and you are unable to build a company there!"); case CongressVotingRejectionReasonEnum.CompanyIsNotYoursRemoveCompany: return("company is not longer in posess of your country!"); case CongressVotingRejectionReasonEnum.AlreadyManagerAssignManager: return("citizen is already manager of this party!"); case CongressVotingRejectionReasonEnum.CompanyOutsideNationalBordersTransferMoney: return("this company is outside national borders!"); case CongressVotingRejectionReasonEnum.NotEnoughCashTransferMoney: return("your country does not have enough cash!"); } throw new NotImplementedException(); }
public void RejectVoting(CongressVoting voting, CongressVotingRejectionReasonEnum reason) { voting.VotingStatusID = (int)VotingStatusEnum.Rejected; voting.RejectionReasonID = (int)reason; switch (voting.GetVotingType()) { case VotingTypeEnum.CreateNationalCompany: UnreserveMoneyForVoting(voting); reservedEntityNameRepository.Remove(voting.Argument1); break; case VotingTypeEnum.TransferCashToCompany: UnreserveMoneyForVoting(voting); break; default: break; } countryEventService.AddVotingEvent(voting, VotingStatusEnum.Rejected); }