Ejemplo n.º 1
0
        public async Task <int> GetLastNonce(IDbConnection context, Guid Id)
        {
            try
            {
                SignatureNotice ans = await GetByBallotId(context, Id);

                return((ans == null) ? 0 : ans.Nonce);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        public async Task <SignatureNotice> NotifyPendingSubmittal(IDbConnection context, SignatureNotice notice)
        {
            SignatureNotice result = null;

            try
            {
                result = await this.signatureService.NotifyPendingSubmittal(context, notice);
            }
            catch (Exception ex)
            {
                throw;
            }

            return(result);
        }
Ejemplo n.º 3
0
        public async Task <SignatureNotice> NotifyPending([FromBody] SignatureNotice notice)
        {
            SignatureNotice result = null;

            try
            {
                result = await this.signatureRepository.NotifyPendingSubmittal(Context, notice);
            }
            catch (Exception ex)
            {
                string err = ex.Message;
            }
            finally
            {
            }
            return(result);
        }
Ejemplo n.º 4
0
        private async Task <SignatureNotice> GetByBallotId(IDbConnection context, Guid Id)
        {
            SignatureNotice result = null;

            try
            {
                var p = new DynamicParameters();
                p.Add("@ballotid", Id, System.Data.DbType.Guid, System.Data.ParameterDirection.Input);

                result = await context.QuerySingleAsync <SignatureNotice>(sql : "SignatureNotice_GetByBallot", param : p, commandType : System.Data.CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw;
            }

            return(result);
        }
Ejemplo n.º 5
0
        public async Task <SignatureNotice> Insert(IDbConnection context, SignatureNotice notice)
        {
            try
            {
                var p = new DynamicParameters();
                p.Add("@id", Guid.NewGuid(), DbType.Guid, ParameterDirection.Input);
                p.Add("@nonce", notice.Nonce, DbType.Int32, ParameterDirection.Input);
                p.Add("@ballotid", notice.BallotId, DbType.Guid, ParameterDirection.Input);

                SignatureNotice ans = await context.QuerySingleAsync <SignatureNotice>(sql : "SignatureNotice_Insert", param : p, commandType : System.Data.CommandType.StoredProcedure);

                return(ans);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw;
            }
        }
Ejemplo n.º 6
0
        public async Task <SignatureNotice> NotifyPendingSubmittal(IDbConnection context, SignatureNotice notice)
        {
            SignatureNotice result = null;

            try
            {
                var p = new DynamicParameters();
                p.Add("@id", Guid.NewGuid(), DbType.Guid, ParameterDirection.Input);
                p.Add("@ballotid", notice.BallotId, DbType.Guid, ParameterDirection.Input);
                p.Add("@nonce", notice.Nonce, DbType.Int32, ParameterDirection.Input);
                p.Add("@ballotrequestid", notice.BallotRequestId, DbType.Guid, ParameterDirection.Input);

                result = await context.QuerySingleAsync <SignatureNotice>(sql : "SignatureNotice_Insert", param : p,
                                                                          commandType : System.Data.CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw;
            }

            return(result);
        }