public ApartmentAnimalAddChangeForm(ApartmentProperty apartProp)
     : this()
 {
     this.m_ApartmentProperty = apartProp;
     this.btnAddChange.set_Text("Изменить");
     this.nudPropertyValue.set_Value((decimal) this.m_ApartmentProperty.PropertyValue);
     this.dbFromDate.Value = this.m_ApartmentProperty.FromDate;
     this.lParametr.set_Text(this.m_ApartmentProperty.PropertyName);
 }
 private void btnAddChange_Click(object sender, System.EventArgs e)
 {
     if (this.dbFromDate.IsNull)
     {
         new BalloonWindow("Не введена дата начала действия.").Show(this.btnAddChange);
     }
     else
     {
         if (this.m_ApartmentProperty == ApartmentProperty.Null)
         {
             this.m_ApartmentProperty = new ApartmentProperty();
             this.m_ApartmentProperty.Id = -1L;
             this.m_ApartmentProperty.ApartmentId = this.m_apartmentId;
             this.m_ApartmentProperty.PropertyId = this.m_propertyId;
         }
         this.m_ApartmentProperty.FromDate = this.dbFromDate.Value;
         this.m_ApartmentProperty.PropertyValue = System.Convert.ToInt32(this.nudPropertyValue.Value);
         this.m_ApartmentProperty.SaveChanges();
         base.set_DialogResult(System.Windows.Forms.DialogResult.OK);
         base.Close();
     }
 }
 public ApartmentAnimalAddChangeForm()
 {
     this.m_ApartmentProperty = ApartmentProperty.Null;
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
 }
 public ApartmentPropertyHistoryForm(ApartmentProperty apartProp)
     : this()
 {
     this.m_ApartmentProperty = apartProp;
     this.bsApartmentPropertyHistory.set_DataSource(ApartmentProperty.FindByPropertyId(this.m_ApartmentProperty.ApartmentId, (long) this.m_ApartmentProperty.PropertyId));
 }
 private void tsbDelete_Click(object sender, System.EventArgs e)
 {
     if ((this.bsApartmentPropertyHistory.get_Current() != null) && (Messages.QuestionYesNo(this, "Вы действительно хотите удалить?") != System.Windows.Forms.DialogResult.No))
     {
         this.m_ApartmentProperty = this.bsApartmentPropertyHistory.get_Current() as ApartmentProperty;
         if ((this.m_ApartmentProperty != null) && (this.m_ApartmentProperty != ApartmentProperty.Null))
         {
             this.m_ApartmentProperty.Delete();
             this.bsApartmentPropertyHistory.set_DataSource(ApartmentProperty.FindByPropertyId(this.m_ApartmentProperty.ApartmentId, (long) this.m_ApartmentProperty.PropertyId));
             this.update = true;
         }
     }
 }
 private void tsbChange_Click(object sender, System.EventArgs e)
 {
     this.m_ApartmentProperty = this.bsApartmentPropertyHistory.get_Current() as ApartmentProperty;
     if ((this.m_ApartmentProperty != null) && (this.m_ApartmentProperty != ApartmentProperty.Null))
     {
         ApartmentAnimalAddChangeForm form = new ApartmentAnimalAddChangeForm(this.m_ApartmentProperty);
         form.set_Text("Изменение показателя");
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
         {
             this.bsApartmentPropertyHistory.set_Sort(this.bsApartmentPropertyHistory.get_Sort());
             this.update = true;
         }
     }
 }