Beispiel #1
0
        /// <summary>
        /// Fills all fields in form with data from passed dto object.
        /// </summary>
        /// <param name="dto">UserDto which represents current user (logged or selected)</param>
        private void PopulateFields(UserDto currentUserDto,
            UserPersonalDetailsDto currentUserPersonalDetailsDto,
            UserSystemInformationDto currentUserSystemInformationDto,
            UserContactDetailsDto currentUserContactDetailsDto,
            AddressDto currentAddressDto)
        {
            //Populate all text boxes
            tbUserId.Text = currentUserDto.UserId.ToString();
            tbUserName.Text = currentUserDto.UserName;
            tbFirstName.Text = currentUserPersonalDetailsDto.FirstName;
            tbLastName.Text = currentUserPersonalDetailsDto.LastName;
            tbUserPassword.Text = currentUserDto.UserPassword;
            tbSocialSecurityNumber.Text = currentUserPersonalDetailsDto.SocSecNumber;
            tbLastSuccessfullLogIn.Text = currentUserSystemInformationDto.LastSuccessfullLogIn;
            tbUserLoggedIn.Text = currentUserSystemInformationDto.IsLoggedIn;
            tbAddress1.Text = currentAddressDto.AddressLine1;
            tbAddress2.Text = currentAddressDto.AddressLine2;
            tbAddress3.Text = currentAddressDto.AddressLine3;
            tbCity.Text = currentAddressDto.City;
            tbZip.Text = currentAddressDto.Zip;
            tbTelephone.Text = currentUserContactDetailsDto.Telephone;
            tbMobilePhone.Text = currentUserContactDetailsDto.Mobile;

            //Populate all combo boxes
            cbUserType.DataSource = UserTypeDtoList;
            cbUserType.DisplayMember = "UserTypeName";
            cbUserType.ValueMember = "id";
            cbUserType.DropDownStyle = ComboBoxStyle.DropDownList;
            cbUserType.SelectedIndex = currentUserSystemInformationDto.UserTypeId - 1;

            cbCountry.DataSource = CountryDtoList;
            cbCountry.DisplayMember = "Name";
            cbCountry.ValueMember = "id";
            cbCountry.DropDownStyle = ComboBoxStyle.DropDownList;
            cbCountry.SelectedIndex = currentAddressDto.CountryId - 1;

            cbState.DataSource = StateDtoList;
            cbState.DisplayMember = "Name";
            cbState.ValueMember = "id";
            cbState.DropDownStyle = ComboBoxStyle.DropDownList;
            cbState.SelectedIndex = currentAddressDto.StateId - 1;
        }
 /// <summary>
 /// Inserts users personal details over user personal details contract client.
 /// </summary>
 /// <param name="dto">User personal details dto which has to be inserted.</param>
 public void InsertUsersPersonalDetails(UserPersonalDetailsDto dto)
 {
     _updc.InsertUsersPersonalDetails(dto);
 }
 /// <summary>
 /// Updates user personal details over user personal details contract client.
 /// </summary>
 /// <param name="dto">User personal details dto which has to be updated.</param>
 public void UpdateUsersPersonalDetails(UserPersonalDetailsDto dto)
 {
     _updc.UpdateUsersPersonalDetails(dto);
 }
 /// <summary>
 /// Deletes user personal details over user personal details contract client.
 /// </summary>
 /// <param name="dto">User personal details dto which has to be deleted.</param>
 public void DeleteUsersPersonalDetails(UserPersonalDetailsDto dto)
 {
     _updc.DeleteUsersPersonalDetails(dto);
 }