Exemplo n.º 1
0
 public void InsertContributors(InviteContributor model)
 {
     _dataProvider.ExecuteNonQuery("dbo.EventContributors_Insert",
                                   inputParamMapper : delegate(SqlParameterCollection paramCol)
     {
         paramCol.AddWithValue("@EventId", model.EventId);
         paramCol.AddWithValue("@Contributor", model.Contributor);
         paramCol.AddWithValue("@ContributionTypeId", model.ContributionTypeId);
     }
                                   );
 }
Exemplo n.º 2
0
        private static InviteContributor MapContributor(IDataReader reader)
        {
            InviteContributor model = new InviteContributor();
            int index = 0;

            model.Id                 = reader.GetSafeInt32(index++);
            model.EventId            = reader.GetSafeInt32(index++);
            model.Contributor        = reader.GetSafeInt32(index++);
            model.ContributionTypeId = reader.GetSafeInt32(index++);
            return(model);
        }
Exemplo n.º 3
0
        public InviteContributor ConfirmContributor(string token)
        {
            InviteContributor model = null;

            _dataProvider.ExecuteCmd("dbo.Contributors_SelectByToken",
                                     inputParamMapper : delegate(SqlParameterCollection paramCol)
            {
                paramCol.AddWithValue("@Token", token);
            },
                                     singleRecordMapper : delegate(IDataReader reader, short set)
            {
                model = MapContributor(reader);
            }
                                     );
            return(model);
        }
Exemplo n.º 4
0
        public ActionResult <SuccessResponse> Confirm(string token)

        {
            try
            {
                InviteContributor model = _tokenService.ConfirmContributor(token);
                _contributorService.UpdateConfirmStatus(model.Id);
                _contributorService.InsertContributors(model);
                SuccessResponse response = new SuccessResponse();
                return(Ok200(response));
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.ToString());
                return(StatusCode(500, new ErrorResponse(ex.Message)));
            }
        }