Exemplo n.º 1
0
 private void btnAddresses_Click(object sender, System.EventArgs e)
 {
     base.set_UseWaitCursor(true);
     AreaAddressesForm form = new AreaAddressesForm(this.addressesSource, this.addressesDest);
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         this.addressesSource = form.GetAddressesSource();
         this.addressesDest = form.GetAddressesDest();
         base.set_UseWaitCursor(false);
     }
 }
Exemplo n.º 2
0
 private void changetoolStripButton_Click(object sender, System.EventArgs e)
 {
     AreaAddressesForm form = new AreaAddressesForm(this.addressesSource, this.addressesDest);
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         this.addressesSource = form.GetAddressesSource();
         this.addressesDest = form.GetAddressesDest();
         this.bsAddress.set_DataSource(this.addressesDest);
         if (this.AddressSelected != null)
         {
             this.AddressSelected();
         }
     }
 }
Exemplo n.º 3
0
 private void btnEditAddress_Click(object sender, System.EventArgs e)
 {
     if (!this.bwLoadAddresses.get_IsBusy())
     {
         Area area = (Area) this.listAreas.get_SelectedItem();
         if (((area == null) || (area == Area.Null)) || (area.Id == -1L))
         {
             Messages.ShowError("Выберите изменяемый набор адресов");
         }
         else
         {
             AreaAddressesForm form = new AreaAddressesForm(area);
             form.ShowDialog();
             if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
             {
                 area.SaveAddresses(form.getSelectedAddresses());
                 this.listAreas_SelectedIndexChanged(sender, e);
             }
             this.btnSearchAddresses.PerformClick();
         }
     }
 }
Exemplo n.º 4
0
 private void tsbAddRestriction_Click(object sender, System.EventArgs e)
 {
     CalcPeriod period = this.bsCalcPeriods.get_Current() as CalcPeriod;
     if (period == null)
     {
         System.Windows.Forms.MessageBox.Show("Не выбран период");
     }
     else
     {
         ObjectList<LocalAddress> restrictionAddresses = period.GetRestrictionAddresses();
         AreaAddressesForm form = new AreaAddressesForm(this.addressesSource, restrictionAddresses);
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
         {
             ObjectList<LocalAddress> area = form.getSelectedAddresses();
             period.DeleteRestrictionAddresses();
             period.AddRestrictionAddresses(area);
             this.areaAddresses.Load(area, true);
         }
     }
 }