Esempio n. 1
0
 private void EditAddress_Click(object sender, System.EventArgs e)
 {
     try
     {
         AddressForm form = new AddressForm(this.SelectedAddress, null);
         if ((form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) && (form.EnteredAddress != null))
         {
             System.Windows.Forms.TreeNode selectedNode = base.SelectedNode;
             base.set_SelectedNode(selectedNode.Parent);
             if (base.SelectedNode == null)
             {
                 this.ShowSettlements();
             }
             else
             {
                 selectedNode.Remove();
                 this.AddAndSelectNode(form.EnteredAddress);
             }
         }
     }
     catch (System.Exception exception)
     {
         Messages.ShowException(this, exception);
     }
 }
Esempio n. 2
0
 private void AddAddressHouseClick(object sender, System.EventArgs e)
 {
     try
     {
         if (this.SelectedAddress.Level == AddressLevel.Дом)
         {
             this.AddApartmment();
         }
         else
         {
             AddressForm form = new AddressForm(null, this.SelectedAddress);
             if ((form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) && (form.EnteredAddress != null))
             {
                 if (form.EnteredAddress.Level == AddressLevel.MinAddress)
                 {
                     this.ShowSettlements();
                 }
                 else
                 {
                     this.AddAndSelectNode(form.EnteredAddress);
                 }
             }
         }
     }
     catch (System.Exception exception)
     {
         Messages.ShowException(this, exception);
     }
 }