Пример #1
0
 //PUT CURRENT USER
 public void PutCurrentUser(PublicProfileResponse model)
 {
     DataProvider.ExecuteNonQuery("Users_PublicProfile_UpdateByUserBaseId",
                                  inputParamMapper : delegate(SqlParameterCollection paramCollection)
     {
         paramCollection.AddWithValue("@UserBaseId", model.UserBaseId);
         paramCollection.AddWithValue("@FirstName", model.FirstName);
         paramCollection.AddWithValue("@MiddleName", model.MiddleName);
         paramCollection.AddWithValue("@LastName", model.LastName);
         paramCollection.AddWithValue("@DateOfBirth", model.DateOfBirth);
         paramCollection.AddWithValue("@Gender", model.Gender);
         paramCollection.AddWithValue("@AvatarUrl", model.AvatarUrl);
         paramCollection.AddWithValue("@BgImageUrl", model.BgImageUrl);
         paramCollection.AddWithValue("@Bio", model.Bio);
         paramCollection.AddWithValue("@StreetAddress", model.StreetAddress);
         paramCollection.AddWithValue("@PostalCode", model.PostalCode);
         paramCollection.AddWithValue("@AddressId", model.AddressId);
         paramCollection.AddWithValue("@AthleteId", model.AthleteId);
         paramCollection.AddWithValue("@Position", model.Position);
         paramCollection.AddWithValue("@IsProfessional", model.IsProfessional);
         paramCollection.AddWithValue("@Weight", model.Weight);
         paramCollection.AddWithValue("@Height", model.Height);
         paramCollection.AddWithValue("@Nickname", model.Nickname);
         paramCollection.AddWithValue("@Birthplace", model.Birthplace);
         paramCollection.AddWithValue("@Team", model.Team);
         paramCollection.AddWithValue("@FBUrl", model.FBUrl);
         paramCollection.AddWithValue("@TwitterUrl", model.TwitterUrl);
         paramCollection.AddWithValue("@IGUrl", model.IGUrl);
         paramCollection.AddWithValue("@YTUrl", model.YTUrl);
         paramCollection.AddWithValue("@AthleteTypeId", model.AthleteTypeId);
     });
 }
Пример #2
0
        //GET CURRENT USER
        public PublicProfileResponse GetByUserBaseId(int userBaseId)
        {
            PublicProfileResponse currentUser = new PublicProfileResponse();

            DataProvider.ExecuteCmd("dbo.Users_PublicProfile_SelectByUserBaseId",
                                    inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@UserBaseId", userBaseId);
            },
                                    singleRecordMapper : delegate(IDataReader reader, short set)
            {
                currentUser = DataMapper <PublicProfileResponse> .Instance.MapToObject(reader);
            });
            return(currentUser);
        }