예제 #1
0
 private void btnSynhron_Click(object sender, System.EventArgs e)
 {
     Apartment apart = (this.bsApartments.get_Current() as Apartment) ?? Apartment.Null;
     if (apart != Apartment.Null)
     {
         ExchangeRequestAddress exchangeRequestAddress = this.m_ExchangeRequestAddress;
         try
         {
             exchangeRequestAddress = ExchangeRequestAddress.GetFlatCard(this.m_ExchangeRequestAddress.FlatCardId);
         }
         catch (System.Exception exception)
         {
             Messages.ShowMessage("Нет доступа к веб сервису, обратитесь к администратору системы" + System.Environment.get_NewLine() + exception);
         }
         SidResponse sidResponse = exchangeRequestAddress.GetSidResponse();
         SidPersonChangesRequestForm form = new SidPersonChangesRequestForm(apart, sidResponse);
         form.ShowDialog(this);
         if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             this.apartmentResidentsView.ReLoad();
         }
     }
 }
예제 #2
0
 private void btnSynchronwithPS_Click(object sender, System.EventArgs e)
 {
     if (this.m_Apartment != Apartment.Null)
     {
         ExchangeRequestAddress flatCardByLocalAddress;
         try
         {
             flatCardByLocalAddress = ExchangeRequestAddress.GetFlatCardByLocalAddress(this.m_Apartment.AdrId);
         }
         catch (System.Exception exception)
         {
             Messages.ShowMessage("Нет доступа к веб сервису, обратитесь к администратору системы." + System.Environment.get_NewLine() + exception.get_Message());
             return;
         }
         if (flatCardByLocalAddress != ExchangeRequestAddress.Null)
         {
             flatCardByLocalAddress.ExchangeRequestId = 0L;
             flatCardByLocalAddress.Address = string.Format("{0} {1} {2}", flatCardByLocalAddress.OwnerLastName, flatCardByLocalAddress.OwnerFirstName, flatCardByLocalAddress.OwnerMiddleName);
             ExchangeRequestAddress address2 = flatCardByLocalAddress;
             SidResponse sidResponse = ExchangeRequestAddress.GetFlatCard(flatCardByLocalAddress.FlatCardId).GetSidResponse();
             SidPersonChangesRequestForm form = new SidPersonChangesRequestForm(this.m_Apartment, sidResponse);
             form.ShowDialog(this);
             if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
             {
                 this.UpdateBindingSourceApartmentResidents();
             }
         }
         else
         {
             Messages.ShowWarning("Не найдено сопоставление для адреса в паспортном столе");
         }
     }
 }