Ejemplo n.º 1
0
 private void CreateAccountForm_Load(object sender, System.EventArgs e)
 {
     if (!base.get_DesignMode())
     {
         this.set_Font(Manager.WindowFont);
         this.m_AccountView.SetApartment(this.m_Apartment);
         this.m_AccountView.SetAccountNumber(this.m_NewAccountNumber);
         this.m_LastApartmentHouseHolder = ApartmentHouseHolder.Null;
         foreach (ApartmentHouseHolder holder in this.m_Apartment.GetApartmentHouseHolders())
         {
             if (holder.FromDate > this.m_LastApartmentHouseHolder.FromDate)
             {
                 this.m_LastApartmentHouseHolder = holder;
             }
         }
         if (this.m_LastApartmentHouseHolder != ApartmentHouseHolder.Null)
         {
             AccountHouseHolder accountHouseHolder = new AccountHouseHolder {
                 OrgId = this.m_LastApartmentHouseHolder.OrgId,
                 ShortName = this.m_LastApartmentHouseHolder.ShortName,
                 Code = this.m_LastApartmentHouseHolder.Code
             };
             this.m_AccountView.SetAccountHouseHolder(accountHouseHolder);
         }
         if (Setting.GetValueByName("Интерфейсы", "АРМ Бухгалтер. Лицевые. При заведении лицевых, по умолчанию ставить признак по переносу долгов и авансов").ToUpper() == "ДА")
         {
             this.m_MoveAvances.set_Checked(true);
         }
     }
 }
Ejemplo n.º 2
0
 public void SaveGeneral()
 {
     if (this.ValidateControls() == string.Empty)
     {
         if (this.selectType.SelectedFasetItem != FasetItem.Null)
         {
             this.SaveDataApartmentType(this.m_apartmentType, this.selectType);
         }
         if (this.selectHouseType.SelectedFasetItem != FasetItem.Null)
         {
             this.SaveDataApartmentType(this.m_houseapartmentType, this.selectHouseType);
         }
         if (this.selectAccomplishmentType.SelectedFasetItem != FasetItem.Null)
         {
             this.SaveDataApartmentType(this.m_accomplishmentType, this.selectAccomplishmentType);
         }
         if (this.selectOrganization.SelectedOrganizationOld != null)
         {
             if (this.m_apartmentTerritorial == ApartmentTerritorialSubdivision.Null)
             {
                 this.m_apartmentTerritorial = new ApartmentTerritorialSubdivision();
                 this.m_apartmentTerritorial.Id = -1L;
                 this.m_apartmentTerritorial.ApartmentId = this.m_Apartment.Id;
             }
             this.m_apartmentTerritorial.OrgId = this.selectOrganization.SelectedOrganizationOld.Id;
             this.m_apartmentTerritorial.FromDate = this.tbFromDate.Value;
             this.m_apartmentTerritorial.Created = System.DateTime.Now;
             try
             {
                 this.m_apartmentTerritorial.SaveChanges();
             }
             catch (System.Exception exception)
             {
                 System.Windows.Forms.MessageBox.Show(exception.ToString());
             }
         }
         if (this.selectHouseHolder.SelectedOrganizationOld != null)
         {
             if (this.m_apartmenthouseHolder == ApartmentHouseHolder.Null)
             {
                 this.m_apartmenthouseHolder = new ApartmentHouseHolder();
                 this.m_apartmenthouseHolder.Id = -1L;
                 this.m_apartmenthouseHolder.ApartmentId = this.m_Apartment.Id;
             }
             this.m_apartmenthouseHolder.OrgId = this.selectHouseHolder.SelectedOrganizationOld.Id;
             this.m_apartmenthouseHolder.FromDate = this.tbFromDate.Value;
             this.m_apartmenthouseHolder.SaveChanges();
         }
         if (((this.nudTotalArea.Value != 0M) || (this.nudLivingArea.Value != 0M)) || (((this.nudHeatingArea.Value != 0M) || (this.nudBalconyArea.Value != 0M)) || (this.selectOrgDocument.SelectedOrgDocument != null)))
         {
             this.ApartmentAreaAdd();
         }
         if (((this.nudFloorsCount.Value != 0M) || (this.nudDoorWay.Value != 0M)) || (((this.nudFloorHouse.Value != 0M) || (this.nudRoomsCount.Value != 0M)) || (this.tbPhone.get_Text().Trim() != string.Empty)))
         {
             this.ApartmentAdd();
         }
     }
 }
 private void tsbAdd_Click(object sender, System.EventArgs e)
 {
     ApartmentHouseHolder apartmentHouseHolder = new ApartmentHouseHolder {
         Id = -1L,
         ApartmentId = this.m_apartmentId
     };
     new ApartmentHouseHolderHistoryAddChangeForm(apartmentHouseHolder).ShowDialog(this);
     this.UpdateApartmentHouseHolderHistory();
 }
Ejemplo n.º 4
0
 public void Fill(Apartment apartment, System.DateTime fromdate, ApartmentHouseHolder apartmentHouseHolder)
 {
     if (this.m_Account == Account.Null)
     {
         bool flag;
         bool flag2;
         bool flag3;
         this.m_Account = new Account();
         this.DataSource = this.m_Account;
         if (!string.IsNullOrEmpty(Setting.GetValueByName("Дополнительные процедуры", "Функция определения следующего номера лицевого счета")))
         {
             this.DataSource.Number = Account.GetNextNumber(apartment.Id);
         }
         else
         {
             this.DataSource.Number = apartment.Number;
         }
         this.DataSource.ApartmentId = apartment.Id;
         this.SetInvisibleCheckbox();
         this.FillLocalAddress(apartment);
         this.SetApartment(apartment);
         this.DataSource.FromDate = this.DataSource.ApartmentFromDate = fromdate;
         this.m_Apartment = apartment;
         this.cbNeedPrintNotice.set_Visible((bool) (flag = false));
         this.m_ToDateLabel.set_Visible(flag2 = flag);
         this.m_ToDate.set_Visible(flag3 = flag2);
         this.cbCloseInPaymentsystem.set_Visible(flag3);
     }
     if ((apartmentHouseHolder != ApartmentHouseHolder.Null) && (this.m_AccountHouseHolder == AIS.SN.Model.DomainObjects.AccountHouseHolder.Null))
     {
         AIS.SN.Model.DomainObjects.AccountHouseHolder accountHouseHolder = new AIS.SN.Model.DomainObjects.AccountHouseHolder {
             OrgId = apartmentHouseHolder.OrgId,
             ShortName = apartmentHouseHolder.ShortName,
             Code = apartmentHouseHolder.Code,
             FromDate = apartmentHouseHolder.FromDate
         };
         this.SetAccountHouseHolder(accountHouseHolder);
         this.m_LastApartmentHouseHolder = apartmentHouseHolder;
     }
 }
 public ApartmentHouseHolderHistoryAddChangeForm(ApartmentHouseHolder ApartmentHouseHolder)
     : this()
 {
     this.m_ApartmentHouseHolder = ApartmentHouseHolder;
 }