예제 #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);
     }
 }
예제 #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);
     }
 }