private static void LoadChildren(System.Windows.Forms.BindingSource parentBS, System.Windows.Forms.BindingSource childBS)
 {
     if (!parentBS.get_IsBindingSuspended())
     {
         LocalAddress parent = parentBS.get_Current() as LocalAddress;
         if (parent != null)
         {
             childBS.SuspendBinding();
             if (parent == LocalAddress.Null)
             {
                 childBS.Clear();
             }
             else
             {
                 childBS.set_DataSource(House.GetChildrenAddress(parent));
             }
             int num = childBS.Add(LocalAddress.Null);
             childBS.ResumeBinding();
             childBS.set_Position((childBS.get_Count() == 2) ? ((int) 0) : num);
         }
     }
 }
 private void GlobalCheck(System.Collections.Generic.List<string> errors, System.Collections.Generic.List<string> warnings)
 {
     int num5;
     if (this.dtpSplitDate.Value <= System.DateTime.MinValue)
     {
         errors.Add((errors.get_Count() + 1) + ". Не введена дата разделения на вкладке \"0.Начало\"" + System.Environment.get_NewLine());
     }
     else if (this.dtpSplitDate.Value < System.DateTime.Now.AddYears(-10))
     {
         errors.Add((errors.get_Count() + 1) + ". Введена неправдоподобная дата разделения на вкладке \"0.Начало\"" + System.Environment.get_NewLine());
     }
     decimal num = 0M;
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvAccounts.Rows)
     {
         num += System.Convert.ToDecimal(row.Cells.get_Item("clmnShare").get_Value());
     }
     if (this.lblTotalSquare.ForeColor == System.Drawing.Color.DarkRed)
     {
         errors.Add((warnings.get_Count() + 1) + ". На вкладе \"0.Начало\" сумма указаных общих площадей квартир не равна общей площади разделяемого жилья" + System.Environment.get_NewLine());
     }
     if ((this.lblLivingSquare.ForeColor == System.Drawing.Color.DarkRed) && (num != 1M))
     {
         errors.Add((errors.get_Count() + 1) + ". Сумма долей, указанных на вкладке \"0.Начало\", не равна 1" + System.Environment.get_NewLine());
     }
     bool flag = true;
     bool flag2 = true;
     foreach (System.Windows.Forms.DataGridViewRow row2 in (System.Collections.IEnumerable) this.dgvAccounts.Rows)
     {
         if ((row2.Cells.get_Item("clmnFlatName").get_Value() == null) || string.IsNullOrEmpty(row2.Cells.get_Item("clmnFlatName").get_Value().ToString()))
         {
             flag = false;
         }
         else
         {
             int num2;
             flag2 = false;
             if (!int.TryParse(((char) row2.Cells.get_Item("clmnFlatName").get_Value().ToString().get_Chars(0)).ToString(), ref num2) || (num2 == 0))
             {
                 errors.Add(string.Concat((object[]) new object[] { (errors.get_Count() + 1), ". На вкладке \"0.Начало\" Для паспорта жилья №", (row2.get_Index() + 1), " введено неверное обозначение номера квартиры.", System.Environment.get_NewLine() }));
             }
         }
     }
     if ((this.m_IsHouse && !flag2) && !flag)
     {
         errors.Add((errors.get_Count() + 1) + ". На вкладке \"0.Начало\" Номера новых квартир введены не для всех новых паспортов жилья." + System.Environment.get_NewLine());
     }
     if (!this.m_IsHouse && !flag)
     {
         errors.Add((errors.get_Count() + 1) + ". Для всех новых паспортов жилья должны быть заданы номера квартир на вкладке \"0.Начало\"" + System.Environment.get_NewLine());
     }
     int index = 1;
     foreach (Account account in this.bsNewAccounts)
     {
         if (string.IsNullOrEmpty(account.OwnerName))
         {
             errors.Add(string.Concat((object[]) new object[] { (errors.get_Count() + 1), ". Для лицевого счёта на ПЖ №", ((int) index), " не указано имя владельца. Вкладка \"1.Лицевые счета\"", System.Environment.get_NewLine() }));
         }
         if (account.FromDate <= System.DateTime.MinValue)
         {
             errors.Add(string.Concat((object[]) new object[] { (errors.get_Count() + 1), ". Для лицевого счёта на ПЖ №", ((int) index), " задана неверная дата начала действия. Вкладка \"1.Лицевые счета\"", System.Environment.get_NewLine() }));
         }
         index = (int) (index + 1);
     }
     index = 1;
     foreach (ObjectList<ApartmentOwner> list in this.m_NewApartmentOwners)
     {
         if (list.get_Count() == 0)
         {
             errors.Add(string.Concat((object[]) new object[] { (errors.get_Count() + 1), ". Для ПЖ №", ((int) index), " не указаны права собственности. Вкладка \"2.Владельцы ПЖ\"", System.Environment.get_NewLine() }));
         }
         index = (int) (index + 1);
     }
     if ((this.dtpSplitDate.Value < System.DateTime.Now.AddMonths(-3)) || (this.dtpSplitDate.Value > System.DateTime.Now.AddMonths(3)))
     {
         warnings.Add((warnings.get_Count() + 1) + ". Дата разделения паспорта жилья, указанная на вкладке \"0.Начало\", более чем на три месяца отличается от сегодняшней" + System.Environment.get_NewLine());
     }
     if (this.m_IsHouse && flag)
     {
         warnings.Add((warnings.get_Count() + 1) + ". На вкладе \"0.Начало\" указаны номера квартир. При разделении в адресный план будут добавлены новые квартиры" + System.Environment.get_NewLine());
     }
     if (this.lblLivingSquare.ForeColor == System.Drawing.Color.DarkRed)
     {
         warnings.Add((warnings.get_Count() + 1) + ". На вкладе \"0.Начало\" сумма указаных жилых площадей квартир не равна жилой площади разделяемого жилья" + System.Environment.get_NewLine());
     }
     if (this.lblHeatingSquare.ForeColor == System.Drawing.Color.DarkRed)
     {
         warnings.Add((warnings.get_Count() + 1) + ". На вкладе \"0.Начало\" сумма указаных отапливаемых площадей квартир не равна отапливаемой площади разделяемого жилья" + System.Environment.get_NewLine());
     }
     if (this.lblBalconySquare.ForeColor == System.Drawing.Color.DarkRed)
     {
         warnings.Add((warnings.get_Count() + 1) + ". На вкладе \"0.Начало\" сумма указаных площадей балконов квартир не равна площади балконов разделяемого жилья" + System.Environment.get_NewLine());
     }
     int[] numArray = new int[System.Convert.ToInt32(this.numApartmentCount.Value)];
     foreach (System.Windows.Forms.DataGridViewRow row3 in (System.Collections.IEnumerable) this.dgvNewApartmentResidents.Rows)
     {
         string str = (string) ((row3.Cells.get_Item("clmnNumberAprtment") as System.Windows.Forms.DataGridViewComboBoxCell).get_Value() as string);
         int num4 = 0;
         if (int.TryParse(str, ref num4))
         {
             numArray[num4 - 1]++;
         }
     }
     for (index = 0; index < numArray.Length; index = (int) (index + 1))
     {
         if (numArray[index] == 0)
         {
             warnings.Add(string.Concat((object[]) new object[] { (warnings.get_Count() + 1), ". Для паспорта жилья №", (index + 1), " не указаны проживающие. Вкладка \"3.Проживающие\"", System.Environment.get_NewLine() }));
         }
     }
     if (this.cbCashlessAccounts.get_Enabled() && ((this.cbCashlessAccounts.get_SelectedItem() == null) || !int.TryParse(this.cbCashlessAccounts.get_SelectedItem().ToString(), ref num5)))
     {
         warnings.Add((warnings.get_Count() + 1) + ". Для разделяемого лицевого счёта существуют настройки безналичной оплаты. Если эти настройки необходимо перенести, то следует выбрать лицевой счёт на вкладке \"1.Лицевые счета\"" + System.Environment.get_NewLine());
     }
 }
 private static void LoadChildren(System.Windows.Forms.BindingSource parentBS, System.Windows.Forms.BindingSource childBS)
 {
     if (!parentBS.get_IsBindingSuspended())
     {
         LocalAddress parent = parentBS.get_Current() as LocalAddress;
         if (parent != null)
         {
             childBS.SuspendBinding();
             if (parent == LocalAddress.Null)
             {
                 childBS.Clear();
             }
             else
             {
                 childBS.set_DataSource(Mappers.LocalAddressMapper.GetChildren(parent));
             }
             int num = childBS.Add(LocalAddress.Null);
             childBS.ResumeBinding();
             childBS.set_Position(((childBS.get_Count() == 2) && !((LocalAddress) childBS.get_Item(0)).Name.Equals(string.Empty)) ? ((int) 0) : num);
         }
     }
 }
 private static void LoadChildren(System.Windows.Forms.BindingSource parentBS, System.Windows.Forms.BindingSource childBS)
 {
     if (!parentBS.get_IsBindingSuspended())
     {
         LocalAddress parent = parentBS.get_Current() as LocalAddress;
         if (parent != null)
         {
             childBS.SuspendBinding();
             if (parent == LocalAddress.Null)
             {
                 childBS.Clear();
                 childBS.Add(LocalAddress.Null);
             }
             else
             {
                 ObjectList<LocalAddress> list = new ObjectList<LocalAddress>();
                 ObjectList<LocalAddress> children = Mappers.LocalAddressMapper.GetChildren(parent);
                 if (children.get_Count() == 1)
                 {
                     list.AddRange(children);
                     list.Add(LocalAddress.Null);
                 }
                 else
                 {
                     list.Add(LocalAddress.Null);
                     list.AddRange(children);
                 }
                 childBS.set_DataSource(list);
             }
             int index = childBS.IndexOf(LocalAddress.Null);
             childBS.ResumeBinding();
             childBS.set_Position(((childBS.get_Count() == 2) && !((LocalAddress) childBS.get_Item(0)).Name.Equals(string.Empty)) ? ((int) 0) : index);
         }
     }
 }
 private bool ToDateVerify(System.Collections.Generic.IList<ApartmentResidentBenefit> laprb)
 {
     if (laprb == null)
     {
         return false;
     }
     if (laprb.get_Count() == 0)
     {
         return false;
     }
     if (laprb.get_Count() != 1)
     {
         System.DateTime toDate = laprb.get_Item(0).ToDate;
         for (int i = 1; i < laprb.get_Count(); i = (int) (i + 1))
         {
             if (toDate != laprb.get_Item(i).ToDate)
             {
                 return false;
             }
         }
     }
     return true;
 }