コード例 #1
0
        public async Task <BrokerResult> EditBrokerInfo(BrokerDto brokerDto)
        {
            var broker = await brokerRepository.GetEntityById(brokerDto.Id);

            if (broker == null)
            {
                return(BrokerResult.CanNotUpdate);
            }
            broker.Address              = brokerDto.Address.SanitizeText().Trim();
            broker.Description          = brokerDto.Description.SanitizeText().Trim();
            broker.Name                 = brokerDto.Name.SanitizeText().Trim();
            broker.Tel                  = brokerDto.Tel.SanitizeText().Trim();
            broker.Title                = brokerDto.Title.SanitizeText().Trim();
            broker.ServiceChargeAccount = brokerDto.ServiceChargeAccount;
            broker.ServiceChargeCash    = brokerDto.ServiceChargeCash;
            brokerRepository.UpdateEntity(broker);
            await brokerRepository.SaveChanges();

            return(BrokerResult.Success);
        }