public OnlineStoreMembershipUser CreateUser(string username,
           string password,
           string email,
           string passwordQuestion,
           string passwordAnswer,
           bool isApproved,
           object providerUserKey,
           string contact,
           string phoneNumber,
           AddressDto contactAddress,
           AddressDto deliveryAddress,
           out MembershipCreateStatus status)
        {
            var args = new ValidatePasswordEventArgs(username, password, true);
            OnValidatingPassword(args);
            if (args.Cancel)
            {
                status = MembershipCreateStatus.InvalidPassword;
                return null;
            }
            if (RequiresUniqueEmail && !string.IsNullOrEmpty(GetUserNameByEmail(email)))
            {
                status = MembershipCreateStatus.DuplicateEmail;
                return null;
            }
            var user = GetUser(username, true) as OnlineStoreMembershipUser;
            if (user == null)
            {
                using (var proxy = new UserServiceClient())
                {
                    List<UserDto> userDtos = new List<UserDto>
                    {
                        new UserDto
                        {
                            UserName = username,
                            Password = password,
                            Contact = contact,
                            LastLogonDate = null,
                            RegisteredDate = DateTime.Now,
                            Email = email,
                            IsDisabled = false,
                            PhoneNumber = phoneNumber,
                            ContactAddress = contactAddress,
                            DeliveryAddress = deliveryAddress
                        }
                    };

                    proxy.CreateUsers(userDtos.ToArray());
                }

                status = MembershipCreateStatus.Success;
                return GetUser(username, true) as OnlineStoreMembershipUser;
            }
            else
            {
                status = MembershipCreateStatus.DuplicateUserName;
                return null;
            }
        }
예제 #2
0
파일: TestAddress.cs 프로젝트: nbIxMaN/EMKT
 public static List<TestAddress> BuildAdressesFromDataBaseData(string idPerson)
 {
     List<TestAddress> addresses = new List<TestAddress>();
     using (SqlConnection connection = Global.GetSqlConnection())
     {
         foreach (int i in Enum.GetValues(typeof(AddressId)))
         {
             string findIdAdresses = "SELECT TOP(1) * FROM mm_Person2Address WHERE IdAddress = (SELECT MAX(IdAddress) FROM mm_Person2Address WHERE IdPerson = '" + idPerson + "' AND IdAddressType = '" + i + "')";
             SqlCommand IdAddresses = new SqlCommand(findIdAdresses, connection);
             using (SqlDataReader addressesIdReader = IdAddresses.ExecuteReader())
             {
                 while (addressesIdReader.Read())
                 {
                     string id = (Convert.ToString(addressesIdReader["IdAddress"]));
                     using (SqlConnection connection2 = Global.GetSqlConnection())
                     {
                         string findIdAdresses2 = "SELECT TOP(1) * FROM Address WHERE IdAddress = '" + id + "'";
                         SqlCommand IdAddresses2 = new SqlCommand(findIdAdresses2, connection2);
                         using (SqlDataReader addressesReader = IdAddresses2.ExecuteReader())
                         {
                             while (addressesReader.Read())
                             {
                                 AddressDto address = new AddressDto();
                                 if (addressesIdReader["IdAddressType"].ToString() != "")
                                     address.IdAddressType = Convert.ToByte(addressesIdReader["IdAddressType"]);
                                 if (addressesReader["StringAddress"].ToString() != "")
                                     address.StringAddress = Convert.ToString(addressesReader["StringAddress"]);
                                 if (addressesReader["IdKladrCity"].ToString() != "")
                                     address.City = Convert.ToString(addressesReader["IdKladrCity"]);
                                 if (addressesReader["IdKladrStreet"].ToString() != "")
                                     address.Street = Convert.ToString(addressesReader["IdKladrStreet"]);
                                 if (addressesReader["Building"].ToString() != "")
                                     address.Building = Convert.ToString(addressesReader["Building"]);
                                 if (addressesReader["Appartment"].ToString() != "")
                                     address.Appartment = Convert.ToString(addressesReader["Appartment"]);
                                 if (addressesReader["PostalCode"].ToString() != "")
                                     address.PostalCode = Convert.ToInt32(addressesReader["PostalCode"]);
                                 if (addressesReader["GeoData"].ToString() != "")
                                     address.GeoData = Convert.ToString(addressesReader["GeoData"]);
                                 TestAddress a = new TestAddress(address);
                                 addresses.Add(a);
                             }
                         }
                     }
                 }
             }
         }
     }
     if (addresses.Count != 0)
         return addresses;
     else
         return null;
 }
예제 #3
0
 public UpsellSubmissionDto(string subId, string subName, AddressDto subAddress, string tn, string submittedBy, string authorizedBy)
 {
     SubscriberId = subId;
     SubscriberName = subName;
     SubscriberAddress = subAddress;
     TelephoneNumber = tn;
     SubmittedBy = submittedBy;
     AuthorizedBy = authorizedBy;
     Status = UpsellStatus.New;
     LastTouchedBy = string.Empty;
     LastTouchedAt = null;
     BillingOrderNumber = string.Empty;
 }
예제 #4
0
        /// <summary>
        /// Update With Attach the AddressEntiy.
        /// </summary>
        /// <param name="Entiy">The Entiy.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</return
        public bool UpdateWithAttachEntiy(AddressDto t)
        {
            var dbentity = typeAdapter.ConvertDtoToEntities(t);

            if (StateHelpers.GetEquivalentEntityState(dbentity.State) == StateHelpers.GetEquivalentEntityState(State.Detached))
            {
                entiesrepository.Attach(dbentity);
            }

            dbentity.State = State.Modified;
            context.ChangeObjectState <Address>(dbentity, StateHelpers.GetEquivalentEntityState(dbentity.State));

            uow.Save();
            return(true);
        }
예제 #5
0
        public async Task <ActionResult <AddressDto> > UpdateUserAddress(AddressDto addressDto)
        {
            var user = await _userManager.FindUserByClaimsPrincipalWithAddressAsync(User);

            user.Address = _mapper.Map <AddressDto, Address>(addressDto);

            var result = await _userManager.UpdateAsync(user);

            if (!result.Succeeded)
            {
                return(BadRequest("Error updating user"));
            }

            return(_mapper.Map <Address, AddressDto>(user.Address));
        }
예제 #6
0
        public static Address Create(IRepositoryLocator locator, AddressDto operation)
        {
            var customer = locator.GetById <Customer>(operation.CustomerId);
            var instance = new Address
            {
                Customer = customer,
                Street   = operation.Street,
                City     = operation.City,
                PostCode = operation.PostCode,
                Country  = operation.Country
            };

            locator.Save(instance);
            return(instance);
        }
예제 #7
0
        public OperationResult CreateItem(AddressDto dto)
        {
            var parentPropertyName = dto.AddressItem.GetParentPropertyName();
            var parentEl           = DynamicGetFromRepository(parentPropertyName, dto.ParentId);

            var addressElement = AddressExtensions.CreateAddressElement(dto.AddressItem)
                                 .UpdateName(dto.Name)
                                 .UpdateParent(parentPropertyName, parentEl);

            var element = _repository.Create(addressElement);

            return(element == null
                                ? new OperationResult(false, "Failed to create element.")
                                : new OperationResult(true, element));
        }
예제 #8
0
        public AddressDto MapToAddressDto(SqlDataReader sqlDataReader)
        {
            AddressDto addressDto = new AddressDto();

            addressDto.Id           = sqlDataReader["Id"].ToInteger();
            addressDto.ProvinceId   = sqlDataReader["ProvinceId"].ToInteger();
            addressDto.CountryId    = sqlDataReader["CountryId"].ToInteger();
            addressDto.EditUserId   = sqlDataReader["EditUserId"].ToInteger();
            addressDto.CreateUserId = sqlDataReader["CreateUserId"].ToInteger();
            addressDto.EditDate     = sqlDataReader["EditDate"].ToDateTime();
            addressDto.CreatDate    = sqlDataReader["CreatDate"].ToDateTime();
            addressDto.StatusId     = sqlDataReader["StatusId"].ToInteger();

            return(addressDto);
        }
        public async Task <ActionResult <AddressDto> > UpdateUserAddress(AddressDto address)
        {
            var user = await _userManager.FindByEmailWithAddressAsync(HttpContext.User);

            user.Address = _mapper.Map <AddressDto, Address>(address);

            var result = await _userManager.UpdateAsync(user);

            if (result.Succeeded)
            {
                return(Ok(_mapper.Map <Address, AddressDto>(user.Address)));
            }

            return(BadRequest("Updating failed"));
        }
예제 #10
0
        public async Task <ActionResult <AddressDto> > UpdateUserAddress(AddressDto address)
        {
            var user = await _userManager.FindUserByClaimsPrincipleWithAddressAsync(User);

            user.Address = this._mapper.Map <AddressDto, Address>(address);

            var result = await _userManager.UpdateAsync(user);

            if (result.Succeeded)
            {
                return(Ok(_mapper.Map <Address, AddressDto>(user.Address)));
            }

            return(BadRequest("Problem occured while updating user address"));
        }
        public async Task <ActionResult <AddressDto> > UpdateAddress(AddressDto address)
        {
            var user = await _userManager.FindByEmailWithAddressAsync(HttpContext.User);

            user.Address = Mapping.Map <Address>(address);

            var result = await _userManager.UpdateAsync(user);

            if (result.Succeeded)
            {
                return(Ok(address));
            }

            return(BadRequest("Problem updating the user"));
        }
        public async Task <AddressDto> UpdateAsync(int userId, AddressDto dto)
        {
            var model = await _addressRepository.GetAsync(userId, dto.Id);

            if (model == null)
            {
                return(null);
            }

            AddressMapper.Map(dto, model);
            await _addressRepository.SaveChangesAsync(userId);

            // Return a fresh copy of the saved object.
            return(await GetAsync(userId, model.Id));
        }
예제 #13
0
        public async Task <ActionResult <AddressDto> > UpdateAddress(AddressDto addressDto)
        {
            var user = await _userManager.FindUserByClaimPrincipalWithAddressAsync(HttpContext.User);

            user.Address = _mapper.Map <AddressDto, Address>(addressDto);

            var result = await _userManager.UpdateAsync(user);

            if (!result.Succeeded)
            {
                return(BadRequest(new ApiResponse(400)));
            }

            return(Ok(_mapper.Map <Address, AddressDto>(user.Address)));
        }
예제 #14
0
        public async Task <HttpResponseMessage> Delete([FromBody] AddressDto address)
        {
            try
            {
                var response = Request.CreateResponse(HttpStatusCode.OK, await logic.DeactivateAddress(address));
                logger.Info("Delete address successful");
                return(response);
            }

            catch (Exception ex)
            {
                LogHelper.ErrorLogger(logger, ex);
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
        public static Address ConvertToAddress(this AddressDto addressDto)
        {
            var address = new Address();

            address.AddressId   = addressDto.AddressDtoId;
            address.AddressType = addressDto.AddressType;
            address.Hno         = addressDto.Hno;
            address.Street      = addressDto.Street;
            address.City        = addressDto.City;
            address.State       = addressDto.State;
            address.Country     = addressDto.Country;
            address.Pincode     = addressDto.Pincode;

            return(address);
        }
예제 #16
0
        public async Task <ActionResult <AddressDto> > UpdateAddressAsync([FromBody] AddressDto addressDto)
        {
            AppUser user = await _userManager.FinByClaimsPrincipleWithAddressAsync(HttpContext.User);

            user.Address = Map <Address>(addressDto);

            IdentityResult result = await _userManager.UpdateAsync(user);

            if (!result.Succeeded)
            {
                return(BadRequest("Problem updateing the user"));
            }

            return(Map <AddressDto>(user.Address));
        }
예제 #17
0
        public async Task <ActionResult <AddressDto> > UpdateUserAddress(AddressDto address)
        {
            var user = await _userManager.FindByUserByClaimsPrincipleWithAddressAsync(HttpContext.User);

            user.Address = _mapper.Map <AddressDto, Address>(address);

            var result = await _userManager.UpdateAsync(user);

            if (result.Succeeded)
            {
                return(Ok(_mapper.Map <Address, AddressDto>(user.Address)));
            }

            return(BadRequest("Problem updating the user"));
        }
예제 #18
0
        public void LoanApplicationSubmissionService_InvalidApplication_IsNotSaved()
        {
            var operators = new InMemoryOperatorRepository(new List <Operator>
            {
                new OperatorBuilder().WithLogin("admin").Build()
            });

            var existingApplications = new InMemoryLoanApplicationRepository(new List <LoanApplication>());

            var loanApplicationSubmissionService = new LoanApplicationSubmissionService
                                                   (
                new UnitOfWorkMock(),
                existingApplications,
                operators
                                                   );

            var validApplication = new LoanApplicationDto
            {
                CustomerNationalIdentifier = "11111111119111",
                CustomerFirstName          = "Frank",
                CustomerLastName           = "Oz",
                CustomerBirthdate          = SysTime.Now().AddYears(-25),
                CustomerMonthlyIncome      = 10_000M,
                CustomerAddress            = new AddressDto
                {
                    Country = "PL",
                    City    = "Warsaw",
                    Street  = "Chłodna 52",
                    ZipCode = "00-121"
                },
                PropertyValue   = 320_000M,
                PropertyAddress = new AddressDto
                {
                    Country = "PL",
                    City    = "Warsaw",
                    Street  = "Wilcza 10",
                    ZipCode = "00-421"
                },
                LoanAmount        = 100_000M,
                LoanNumberOfYears = 25,
                InterestRate      = 1.1M
            };

            var ex = Assert.Throws <ArgumentException>(() => loanApplicationSubmissionService
                                                       .SubmitLoanApplication(validApplication, OperatorIdentity("admin")));

            Assert.Equal("National Identifier must be 11 chars long", ex.Message);
        }
        public void DeleteAddressSuccessTest()
        {
            int    id              = 1;
            string Address1        = "Test";
            string Address2        = "Test";
            string City            = "Test";
            string ZipCode         = "Test";
            bool   isDeleted       = false;
            int    AddressTypeId   = 1;
            int    CreatedByUserId = 1;

            NSI.REST.Models.AddressCreateModel address = new AddressCreateModel()
            {
                AddressId       = id,
                Address1        = Address1,
                Address2        = Address2,
                City            = City,
                ZipCode         = ZipCode,
                AddressTypeId   = AddressTypeId,
                CreatedByUserId = CreatedByUserId,
                IsDeleted       = isDeleted,
                DateCreated     = DateTime.Now,
                DateModified    = DateTime.Now
            };

            var address2 = new AddressDto
            {
                AddressId       = id,
                Address1        = Address1,
                Address2        = Address2,
                City            = City,
                ZipCode         = ZipCode,
                AddressTypeId   = AddressTypeId,
                CreatedByUserId = CreatedByUserId,
                IsDeleted       = isDeleted,
                DateCreated     = DateTime.Now,
                DateModified    = DateTime.Now
            };

            var addressRepo = new Mock <IAddressRepository>();

            addressRepo.Setup(x => x.DeleteAddressById(It.IsAny <int>())).Returns(true);
            var addressManipulation = new AddressManipulation(addressRepo.Object);
            var controller          = new AddressController(addressManipulation);
            var result = controller.DeleteAddress(1);

            Assert.IsType <OkResult>(result);
        }
예제 #20
0
        protected override void Given()
        {
            base.Given();

            _model = Addresses.First();

            _dto = new AddressDto
            {
                Id      = _model.Id,
                Line1   = GetRandom.String(50),
                Line2   = GetRandom.String(50),
                City    = GetRandom.String(50),
                StateId = GetRandom.Int32(),
                ZipCode = GetRandom.String(10)
            };
        }
예제 #21
0
 private void AddAddress(AddressViewModel models, AddressType addressType)
 {
     var apiUrl    = "https://localhost:44324";
     var method    = "/api/Address/Save";
     var dataModel = new AddressDto()
     {
         StreetAddress         = models.StreetAddress,
         ExtendedStreetAddress = models.ExtendedStreetAddress,
         Town        = models.Town,
         County      = models.County,
         PostCode    = models.PostCode,
         AddressType = (int)addressType
     };
     var apiClient = new ApiClient(apiUrl);
     var response  = apiClient.Post <ApiResult, AddressDto>(method, dataModel);
 }
        internal static AddressEntity ToEntity(this AddressDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            return(new AddressEntity
            {
                AddressType = (int)dto.AddressType,
                Street = dto.Street,
                City = dto.City,
                Zip = dto.Zip,
                StateId = dto.State.Id
            });
        }
예제 #23
0
        public async Task <IActionResult> Create(
            [FromForm(Name = "buyer")] BuyerDto buyerDto,
            [FromForm(Name = "address")] AddressDto addressDto,
            [FromForm] string comment)
        {
            try
            {
                var orderDto = await _orderService.CreateOrderAsync(buyerDto, addressDto, comment);

                return(CreatedAtAction(nameof(GetOrderById), new { id = orderDto.Id }, orderDto));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.ToString()));
            }
        }
예제 #24
0
        public IActionResult AddAddress(AddressDto addressDto)
        {
            if (addressDto is null || !ModelState.IsValid)
            {
                return(BadRequest());
            }


            int id = AddressRepository.Insert(new Address()
            {
                Street = addressDto.Street,
                City   = addressDto.City
            });

            return(Ok(id));
        }
예제 #25
0
        public async Task Update(Guid id, AddressDto dto)
        {
            Address address = await _addressRepository.GetById(id);

            UpdateAddress(dto, address);

            if (!address.Validate())
            {
                NotifyDomainValidations(address.ValidationResult);
            }

            if (!_notifier.HasNotification())
            {
                _addressRepository.Update(address);
            }
        }
예제 #26
0
 public void PostAddress(AddressDto address)
 {
     using (var db = new ExtraAirContext())
     {
         db.Addresses.Add(new ExtraAirCore.Models.EFModels.Address()
         {
             AddressId    = address.AddressId,
             City         = address.City,
             Country      = address.Country,
             PostIndex    = address.PostIndex,
             Street       = address.Street,
             StreetNumber = address.StreetNumber
         });
         db.SaveChanges();
     }
 }
예제 #27
0
        public IHttpActionResult CreateAddress(AddressDto addressDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var address = Mapper.Map <AddressDto, Address>(addressDto);

            _context.Address.Add(address);
            _context.SaveChanges();

            addressDto.Id = address.Id;

            return(Created(new Uri(Request.RequestUri + "/" + address.Id), addressDto));
        }
예제 #28
0
        private static void CheckForDuplicates(IRepositoryLocator locator, AddressDto op)
        {
            var result = locator.FindAll <Address>().Where(a => a.Customer.Id == op.CustomerId &&
                                                           a.Street == op.Street &&
                                                           a.City == op.City &&
                                                           a.PostCode == op.PostCode &&
                                                           a.Country == op.Country &&
                                                           a.Id != op.Id);

            if (!result.Any())
            {
                return;
            }
            throw new BusinessException(BusinessExceptionEnum.Validation,
                                        "An address instance for this customer already exist with the same details.");
        }
 public void InsertAddress(AddressDto addressObject)
 {
     try
     {
         da.Insert <Address>(new Address()
         {
             AddressId   = addressObject.AddressId,
             FullAddress = addressObject.FullAddress,
             Town        = addressObject.Town
         });
     }
     catch (Exception)
     {
         throw;
     }
 }
        public RiskIndicatorDto(IRiskIndicator riskIndicator)
        {
            if (riskIndicator == null)
            {
                return;
            }

            DeliveryEmailAddress       = riskIndicator.DeliveryEmailAddress.ToString();
            DeliveryTimeFrameIndicator = riskIndicator.DeliveryTimeFrameIndicator.Value;
            GiftCardPurchase           = riskIndicator.GiftCardPurchase;
            PickUpAddress             = new AddressDto(riskIndicator.PickUpAddress);
            PreOrderDate              = riskIndicator.PreOrderDate.ToString(ThreeDSecureDateTimeString);
            PreOrderPurchaseIndicator = riskIndicator.PreOrderPurchaseIndicator.Value;
            ReOrderPurchaseIndicator  = riskIndicator.ReOrderPurchaseIndicator.Value;
            ShipIndicator             = riskIndicator.ShipIndicator.Value;
        }
예제 #31
0
        public async Task <ActionResult <AddressDto> > UpdateAddress(AddressDto address)
        {
            var user = await _userManager.FindByEmailByClaimsPrincipalWithAddressAsync(HttpContext.User);

            user.Address = _mapper.Map <AddressDto, Address>(address);

            // update user address
            var result = await _userManager.UpdateAsync(user);

            if (result.Succeeded)
            {
                return(Ok(_mapper.Map <Address, AddressDto>(user.Address)));
            }

            return(BadRequest("Failed to update user address"));
        }
 public CardholderDto(Cardholder cardholder)
 {
     if (cardholder == null)
     {
         return;
     }
     AccountInfo     = new AccountInfoDto(cardholder.AccountInfo);
     BillingAddress  = new AddressDto(cardholder.BillingAddress);
     Email           = cardholder.Email.ToString();
     FirstName       = cardholder.FirstName;
     HomePhoneNumber = cardholder.HomePhoneNumber.ToString();
     LastName        = cardholder.LastName;
     Msisdn          = cardholder.Msisdn.ToString();
     Shippingaddress = new AddressDto(cardholder.Shippingaddress);
     WorkPhoneNumber = cardholder.WorkPhoneNumber.ToString();
 }
예제 #33
0
        public void AddAddress()
        {
            CreateCustomer();
            var dto = new AddressDto
            {
                CustomerId = CustomerInstance.Id,
                Street     = "101 Thames Street",
                City       = "Dublin",
                PostCode   = "16",
                Country    = "Ireland"
            };

            var address = CustomerInstance.AddAddress(RepositoryLocator, dto);

            Assert.AreEqual(1, CustomerInstance.Addresses().Count, "Incorrect number of addresses were found at the customer");
        }
예제 #34
0
 public static List<TestAddress> BuildAdressesFromDataBaseData(string idPerson)
 {
     List<TestAddress> addresses = new List<TestAddress>();
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string findIdAdresses = "SELECT * FROM public.address WHERE id_person = '" + idPerson + "'";
         NpgsqlCommand IdAddresses = new NpgsqlCommand(findIdAdresses, connection);
         using (NpgsqlDataReader addressesReader = IdAddresses.ExecuteReader())
         {
             while (addressesReader.Read())
             {
                 AddressDto address = new AddressDto();
                 if (addressesReader["address"] != DBNull.Value)
                     address.StringAddress = Convert.ToString(addressesReader["address"]);
                 TestAddress a = new TestAddress(address);
                 if (addressesReader["id_address_type"] != DBNull.Value)
                     a.addressType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(addressesReader["id_address_type"]));
                 addresses.Add(a);
             }
         }
     }
     return (addresses.Count != 0) ? addresses : null;
 }
 public OnlineStoreMembershipUser(string providerName,
     string name,
     object providerUserKey,
     string email,
     string passwordQuestion,
     string comment,
     bool isApproved,
     bool isLockedOut,
     DateTime creationDate,
     DateTime lastLoginDate,
     DateTime lastActivityDate,
     DateTime lastPasswordChangedDate,
     DateTime lastLockoutDate,
     string contact,
     string phoneNumber,
     AddressDto contactAddress,
     AddressDto deliveryAddress)
     : this(
         providerName, name, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut,
         creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockoutDate, contact,
         phoneNumber,
         contactAddress == null ? null : contactAddress.Country,
         contactAddress == null ? null : contactAddress.State,
         contactAddress == null ? null : contactAddress.City,
         contactAddress == null ? null : contactAddress.Street,
         contactAddress == null ? null : contactAddress.Zip,
         deliveryAddress == null ? null : deliveryAddress.Country,
         deliveryAddress == null ? null : deliveryAddress.State,
         deliveryAddress == null ? null : deliveryAddress.City,
         deliveryAddress == null ? null : deliveryAddress.Street,
         deliveryAddress == null ? null : deliveryAddress.Zip)
 {
 }
예제 #36
0
 public TestAddress(AddressDto a)
 {
     if (a == null) return;
     address = a;
     addressType = new TestCoding(address.AddressType);
 }
예제 #37
0
 /// <summary>
 /// Updates address over address contract client.
 /// </summary>
 /// <param name="dto">Address dto which has to be updated.</param>
 public void UpdateAddress(AddressDto dto)
 {
     _acc.UpdateAddress(dto);
 }
예제 #38
0
 /// <summary>
 /// Inserts address over address contract client.
 /// </summary>
 /// <param name="dto">Address dto which has to be inserted.</param>
 public void InsertAddress(AddressDto dto)
 {
     _acc.InsertAddress(dto);
 }
예제 #39
0
 /// <summary>
 /// Deletes address over address contract client.
 /// </summary>
 /// <param name="dto">Address dto which has to be deleted.</param>
 public void DeleteAddress(AddressDto dto)
 {
     _acc.DeleteAddress(dto);
 }
예제 #40
0
파일: User.cs 프로젝트: boskomijin/SGApp
        /// <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;
        }
예제 #41
0
파일: TestAddress.cs 프로젝트: nbIxMaN/EMKT
 public TestAddress(AddressDto a)
 {
     address = a;
 }