Exemple #1
0
        public List <ClaimStateDTO> GetAllClaimStates(long periodId)
        {
            List <ClaimStateDTO> stateList = new List <ClaimStateDTO>();

            foreach (ClaimState state in ClaimState.GetAll <ClaimState>())
            {
                var stateDto = claimStateDTOMapper.MapToModel(state);
                stateList.Add(stateDto);
            }
            return(stateList);
        }
Exemple #2
0
        public void SetState(ClaimState newState)
        {
            if (newState == ClaimState.Hidden)
            {
                MakeBramble();
                GetComponent <Tween>().Flip(10);
            }
            else if (newState == ClaimState.Visible)
            {
                GetComponent <Tween>().Flip(10);
            }
            else if (newState == ClaimState.Owned)
            {
                RemoveBramble();
            }

            this.claimState = newState;
        }
        private async Task SendEmail(Claim claim, ClaimState claimState)
        {
            try {
                if (claim == null)
                {
                    return;
                }
                if (claimState == null)
                {
                    return;
                }

                string message = string.Empty;
                if (claimState.Id == (long)ClaimState.eId.Rechazado_Mejores_Datos_com)
                {
                    message = $"El trámite { claim.Id } ha sido rechazado para mejores datos. Verfique por favor";
                }

                if (claimState.Id == (long)ClaimState.eId.Rechazado_Mejores_Datos_ui)
                {
                    message = $"El trámite { claim.Id } ha sido rechazado para mejores datos. Verfique por favor";
                }

                if (claimState.Id == (long)ClaimState.eId.Nuevo_Ofrecimiento)
                {
                    message = $"El trámite { claim.Id } ha recibido un nuevo ofrecimiento.";
                }

                if (claimState.Id == (long)ClaimState.eId.Firmar_Convenio)
                {
                    message = $"El trámite { claim.Id } posee un convenio para firmar.";
                }


                if (!string.IsNullOrEmpty(message))
                {
                    await emailSender.SendEmailAsync(claim.UserName, $"Sr. productor, el trámite { claim.Id } requiere de su atención", message);
                }
            }
            catch (Exception) {
                //Log
            }
        }
Exemple #4
0
        public Claim ChangeClaimState(PeriodId periodId, ClaimId claimId, string message, ClaimState claimState)
        {
            if (claimState == ClaimState.Accepted)
            {
                return(AcceptClaim(claimId, DateTime.Now, message));
            }

            if (claimState == ClaimState.Rejected)
            {
                return(RejectClaim(claimId, DateTime.Now, message));
            }

            if (claimState == ClaimState.Canceled)
            {
                return(CancelClaim(claimId));
            }

            throw new ClaimException((int)ApiExceptionCode.InvalidClaimState, ApiExceptionCode.InvalidClaimState.DisplayName);
        }
Exemple #5
0
        public static GenericExtrinsicCall UpdateClaim(string mogwaicoinAddress, string account, ClaimState claimState, RawBalance balanceAmount)
        {
            var address = new Vec <U8>();

            address.Create(
                Encoding.ASCII.GetBytes(mogwaicoinAddress).ToList().Select(p => {
                var u = new U8(); u.Create(p); return(u);
            }).ToList()
                );

            var accountId = new RawAccountId();

            accountId.Create(Utils.GetPublicKeyFrom(account));

            var state = new EnumType <ClaimState>();

            state.Create(claimState);

            return(UpdateClaim(address, accountId, state, balanceAmount));
        }