public void Fill(ExchangeRequestAddress exchangeRequestAddress)
 {
     if (this.m_ExchangeRequestAddress != exchangeRequestAddress)
     {
         this.m_ExchangeRequestAddress = exchangeRequestAddress;
         if (this.m_ExchangeRequestAddress == ExchangeRequestAddress.Null)
         {
             this.Clear();
         }
         else
         {
             this.bsExchangeRequestResidents.set_DataSource(this.m_ExchangeRequestAddress.Residents);
         }
     }
 }
 private bool GetFlagComparison(LocalAddress localAddress, ExchangeRequestAddress exchangeRequestAddress)
 {
     return (bool) (((((exchangeRequestAddress.Flat == string.Empty) && (exchangeRequestAddress.House == string.Empty)) && ((exchangeRequestAddress.Street == string.Empty) && (exchangeRequestAddress.Region != string.Empty))) && (localAddress.Level == AddressLevel.MinAddress)) || ((bool) ((((exchangeRequestAddress.Flat == string.Empty) && (exchangeRequestAddress.House == string.Empty)) && ((exchangeRequestAddress.Street != string.Empty) && (localAddress.Level == AddressLevel.Улица))) || ((bool) ((((exchangeRequestAddress.Flat == string.Empty) && (exchangeRequestAddress.House != string.Empty)) && (localAddress.Level == AddressLevel.Дом)) || ((exchangeRequestAddress.Flat != string.Empty) && (localAddress.Level == AddressLevel.MaxAddress)))))));
 }
 protected override void Fill(ObjectWithId obj)
 {
     this.m_ExchangeRequestAddress = (ExchangeRequestAddress) obj;
     this.tbxAddress.set_Text(string.Format("г. {0} ул. {1} д. {2} кв. {3}", new object[] { this.m_ExchangeRequestAddress.Region, this.m_ExchangeRequestAddress.Street, this.m_ExchangeRequestAddress.House, this.m_ExchangeRequestAddress.Flat }));
     this.tbxOwnerFio.set_Text(string.Format("{0} {1} {2}", this.m_ExchangeRequestAddress.OwnerLastName, this.m_ExchangeRequestAddress.OwnerFirstName, this.m_ExchangeRequestAddress.OwnerMiddleName));
     this.exchangeRequestResidentsView.Fill(this.m_ExchangeRequestAddress);
     try
     {
         System.Collections.Generic.List<ExchangeRequestAddress> restFlatCardsByFlatCardId = ExchangeRequestAddress.GetRestFlatCardsByFlatCardId(this.m_ExchangeRequestAddress.FlatCardId);
         this.m_initiated = false;
         this.cbxFlatCards.set_DataSource(restFlatCardsByFlatCardId);
         ExchangeRequestAddress address = null;
         foreach (ExchangeRequestAddress address2 in restFlatCardsByFlatCardId)
         {
             if (this.m_ExchangeRequestAddress.FlatCardId == address2.FlatCardId)
             {
                 address = address2;
                 break;
             }
         }
         if (address != null)
         {
             this.cbxFlatCards.set_SelectedItem(address);
             this.cbxFlatCards.set_Text(address.ToString());
         }
     }
     catch (System.Exception exception)
     {
         Messages.ShowMessage("Нет доступа к веб сервису, обратитесь к администратору системы" + System.Environment.get_NewLine() + exception);
     }
     this.m_initiated = true;
     if (this.m_ExchangeRequestAddress.LocalAddressId != LocalAddress.Null.Id)
     {
         this.localAddressSelector.SelectAddress(this.m_ExchangeRequestAddress.LocalAddressId);
         this.btnCompare.set_Enabled(false);
         this.btnUnCompare.set_Enabled(!this.btnCompare.get_Enabled());
         this.LoadApartmentsByAddress();
         this.SelectApartment();
     }
     else
     {
         LocalAddress localAddress = this.GetLocalAddress(this.m_ExchangeRequestAddress.Region, this.m_ExchangeRequestAddress.Street, this.m_ExchangeRequestAddress.House, this.m_ExchangeRequestAddress.Flat);
         if (localAddress == LocalAddress.Null)
         {
             this.localAddressSelector.Clear();
         }
         else
         {
             this.localAddressSelector.SelectAddress(localAddress.Id);
         }
         if (this.GetFlagComparison(localAddress, this.m_ExchangeRequestAddress))
         {
             this.btnCompare.PerformClick();
         }
         else
         {
             this.btnCompare.set_Enabled(true);
             this.btnUnCompare.set_Enabled(!this.btnCompare.get_Enabled());
             this.apartmentResidentsView.Clear();
         }
     }
 }
 public void Clear()
 {
     this.m_ExchangeRequestAddress = ExchangeRequestAddress.Null;
     this.bsExchangeRequestResidents.Clear();
 }