Esempio n. 1
0
        public async Task <BallotRequest> BallotRequestGetById(IDbConnection context, Guid Id)
        {
            BallotRequest result = null;

            try
            {
                result = await this.ballotService.BallotRequestGetById(context, Id);
            }
            catch
            {
                throw;
            }

            return(result);
        }
Esempio n. 2
0
        public async Task <BallotRequest> BallotRequestInsert(IDbConnection context, BallotRequest ballotRequest)
        {
            BallotRequest result = null;

            try
            {
                result = await this.ballotService.BallotRequestInsert(context, ballotRequest);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw;
            }

            return(result);
        }
Esempio n. 3
0
        public async Task <BallotRequest> Insert([FromBody] BallotRequest ballotRequest)
        {
            BallotRequest result = null;

            try
            {
                result = await this.ballotRepository.BallotRequestInsert(Context, ballotRequest);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw;
            }
            finally
            {
            }
            return(result);
        }
Esempio n. 4
0
        public async Task <BallotRequest> BallotRequestInsert(IDbConnection context, BallotRequest ballot)
        {
            try
            {
                var p = new DynamicParameters();
                p.Add("@id", Guid.NewGuid(), DbType.Guid, ParameterDirection.Input);
                p.Add("@electionid", ballot.ElectionId, DbType.Guid, ParameterDirection.Input);
                p.Add("@deviceid", ballot.DeviceId, DbType.String, ParameterDirection.Input);

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

                return(ans);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw;
            }
        }
Esempio n. 5
0
        public async Task <BallotRequest> BallotRequestGetById(Guid Id)
        {
            BallotRequest result = await this.ballotRepository.BallotRequestGetById(Context, Id);

            return(result);
        }