Example #1
0
 public void AddTree(AreaAddressesTree areaAddressesTreeSource)
 {
     System.Collections.Generic.List<System.Windows.Forms.TreeNode> selectedNodes = areaAddressesTreeSource.SelectedNodes;
     areaAddressesTreeSource.Remove();
     foreach (System.Windows.Forms.TreeNode node in selectedNodes)
     {
         AddressesNode node2 = (AddressesNode) node;
         node2.NullDelete();
         if (node2.Nodes.get_Count() == 0)
         {
             this.RemoveNode(node2);
             this.AddNode(new AddressesNode((LocalAddress) node2.get_Tag()));
         }
         else
         {
             ObjectList<LocalAddress> addresses = new ObjectList<LocalAddress>();
             this.GetLeaves(addresses, node2);
             if (addresses.get_Count() != 0)
             {
                 foreach (LocalAddress address in addresses)
                 {
                     AddressesNode nodeByAddress = this.GetNodeByAddress(address);
                     if (nodeByAddress != null)
                     {
                         this.RemoveNode(nodeByAddress);
                     }
                     this.AddNode(new AddressesNode(address));
                 }
             }
         }
     }
     base.Sort();
     this.OnPaintRoots();
     areaAddressesTreeSource.OnPaintRoots();
     if (selectedNodes.get_Count() != 0)
     {
         System.Collections.Generic.List<System.Windows.Forms.TreeNode> list3 = new System.Collections.Generic.List<System.Windows.Forms.TreeNode>();
         foreach (System.Windows.Forms.TreeNode node4 in selectedNodes)
         {
             AddressesNode node5 = this.GetNode(this, (AddressesNode) node4);
             if (node5 != null)
             {
                 list3.Add(node5);
                 if (node5.Parent != null)
                 {
                     node5.Parent.EnsureVisible();
                     node5.Parent.Expand();
                 }
             }
         }
         base.SelectedNodes = list3;
         if (this.OnChangeSelectAddresses != null)
         {
             this.OnChangeSelectAddresses();
         }
     }
 }
Example #2
0
 public void Refresh(ObjectList<Apartment> list)
 {
     base.BeginUpdate();
     base.Nodes.Clear();
     string str = (list.get_Count() > 0) ? FormatItemsCount(list.get_Count()) : ((string) "По запросу ничего не найдено");
     System.Windows.Forms.TreeNode node = base.Nodes.Add(str);
     System.Windows.Forms.TreeNodeCollection nodes = node.Nodes;
     foreach (Apartment apartment in list)
     {
         nodes.Add(new AIS.SN.UI.Accountant.Apartments.ApartmentNode(apartment.ToString(), apartment));
     }
     base.ExpandAll();
     node.EnsureVisible();
     base.EndUpdate();
     if (node.Nodes.get_Count() == 1)
     {
         base.set_SelectedNode(node.Nodes.get_Item(0));
     }
 }
 public void SetFilter(ObjectList<Organization> FilterServiceProvider, ObjectList<ServiceTypeOld> FilterServiceTypes)
 {
     if ((FilterServiceProvider != null) && (FilterServiceProvider.get_Count() == 0))
     {
         this.m_FilterServiceProvider = null;
     }
     else
     {
         this.m_FilterServiceProvider = FilterServiceProvider;
     }
     if ((FilterServiceTypes != null) && (FilterServiceTypes.get_Count() == 0))
     {
         this.m_FilterServiceTypes = null;
     }
     else
     {
         this.m_FilterServiceTypes = FilterServiceTypes;
     }
 }
 public UjfHouseInspectionsAddChangeForm(long ordId, ObjectList<UjfApartmentHouseInspection> hil)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.orderId = ordId;
     this.HouseInspList = hil;
     this.inspectionStatusFasetData.Faset = FasetsEnum.UjfApartmentHouseInspectionStatus;
     this.inspectionStatusFasetData.RefreshValuesWithNull();
     this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.Null;
     if ((hil != null) && (hil.get_Count() > 0))
     {
         this.dtpInspectionDate.Value = hil.get_Item(0).InspectionDateTime;
         if (hil.get_Item(0).StatusId != 0)
         {
             this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.FindById(hil.get_Item(0).StatusId);
         }
         else
         {
             this.inspectionStatusFasetData.set_SelectedIndex(0);
         }
         this.tbInspector.set_Text(hil.get_Item(0).Inspector);
     }
 }
 private void btnAddShedule_Click(object sender, System.EventArgs e)
 {
     bool flag = false;
     ObjectList<UjfApartmentHouseDefect> list = new ObjectList<UjfApartmentHouseDefect>();
     foreach (System.Windows.Forms.DataGridViewRow row in this.dgvDefects.SelectedRows)
     {
         list.Add((UjfApartmentHouseDefect) row.get_DataBoundItem());
     }
     if ((list != null) && (list.get_Count() > 0))
     {
         foreach (UjfApartmentHouseDefect defect in list)
         {
             UjfApartmentHouseDefectShedule shedule = new UjfApartmentHouseDefectShedule {
                 ApartmentHouseDefectId = defect.Id,
                 InspectionId = this.m_inspectionId,
                 SheduleYear = (int) this.nudSheduleYear.Value
             };
             if (Mappers.UjfApartmentHouseDefectSheduleMapper.FindByApartmentHouseDefectIdAndSheduleYear(shedule.ApartmentHouseDefectId, shedule.SheduleYear, shedule.Id).get_Count() > 0)
             {
                 flag = true;
             }
             else
             {
                 shedule.SaveChanges();
             }
         }
     }
     else
     {
         System.Windows.Forms.MessageBox.Show("Для составления плана-графика добавьте хотя бы один дефект к текущему осмотру!");
     }
     if (flag)
     {
         System.Windows.Forms.MessageBox.Show("Некоторые планы-графики не были добавлены, так как уже присутствуют в списке!");
     }
     base.Close();
 }
Example #6
0
 private void SetGroups(ObjectList<AreaGroup> groups)
 {
     this.bsGroups.set_DataSource(new ObjectList<AreaGroup>());
     AreaGroup group = new AreaGroup {
         Id = -1L,
         Name = "<не выбрано>"
     };
     ((ObjectList<AreaGroup>) this.bsGroups.get_DataSource()).Add(group);
     ((ObjectList<AreaGroup>) this.bsGroups.get_DataSource()).AddRange(groups);
     this.lblGroupCounter.set_Text("Всего групп: " + ((int) groups.get_Count()));
 }
Example #7
0
 private ObjectList<BenefitServiceType> GetSelectRowsGrid()
 {
     ObjectList<BenefitServiceType> list = new ObjectList<BenefitServiceType>();
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvBenefitSrvTypes.Rows)
     {
         if (row.get_Selected())
         {
             list.Add((BenefitServiceType) row.get_DataBoundItem());
         }
     }
     if (list.get_Count() != 0)
     {
         return list;
     }
     return null;
 }
Example #8
0
 private void SetAreas(ObjectList<Area> areas)
 {
     this.bsAreas.set_DataSource(new ObjectList<Area>());
     Area area = new Area {
         Id = -1L,
         Name = "<не выбрано>"
     };
     ((ObjectList<Area>) this.bsAreas.get_DataSource()).Add(area);
     ((ObjectList<Area>) this.bsAreas.get_DataSource()).AddRange(areas);
     if (this.listGroups.get_SelectedValue() != null)
     {
         int num = -1;
         if (!(this.listGroups.get_SelectedValue().ToString() == ((int) num).ToString()))
         {
             this.lblAreaCounter.set_Text("Наборов в группе: " + ((int) areas.get_Count()));
             return;
         }
     }
     this.lblAreaCounter.set_Text("Всего наборов: " + ((int) areas.get_Count()));
 }
Example #9
0
 private void отчетПоОсмотрамToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     ObjectList<UjfOrders> orders = new ObjectList<UjfOrders>();
     foreach (System.Windows.Forms.DataGridViewRow row in this.dgvOrders.SelectedRows)
     {
         orders.Add(row.get_DataBoundItem() as UjfOrders);
     }
     if (orders.get_Count() <= 0)
     {
         System.Windows.Forms.MessageBox.Show("Выберите приказы для составления отчета");
     }
     else
     {
         System.Data.DataSet set = Mappers.UjfOrdersMapper.CreateOrderProtocol(orders);
         set.Tables.get_Item(0).set_TableName("dataOrderInfo");
         StiReport report = new StiReport();
         report.Load(Resources.UjfOrderInspectionProtocol);
         report.Compile();
         report.RegData((System.Data.DataSet) set);
         report.Show();
     }
 }
 private void selectServices_OnServicesSelected(ObjectList<ServiceOld> services)
 {
     ServiceOld @null = ServiceOld.Null;
     if (services.get_Count() != 0)
     {
         @null = services.get_Item(0);
     }
     this.UpdateServiceFields(@null);
 }
Example #11
0
 private void m_SearchWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     ObjectList<Apartment> list = new ObjectList<Apartment>();
     if (this.m_SearchByNumbersRadio.get_Checked())
     {
         string apartmentNumber = this.m_ApartmentNumberEdit.get_Text().Trim();
         string accountNumber = this.m_AccountEdit.get_Text().Trim();
         list = Apartment.Search(apartmentNumber, accountNumber, LocalAddress.Null.Id, string.Empty, this.chxShowClose.get_Checked(), string.Empty);
         if (string.IsNullOrEmpty(apartmentNumber) && string.IsNullOrEmpty(accountNumber))
         {
             this.addressesSearch.Clear();
             for (int i = 0; i < LocalAddress.GetUserAddresses().get_Count(); i = (int) (i + 1))
             {
                 this.addressesSearch.Add(LocalAddress.GetUserAddresses().get_Item(i));
             }
         }
         if (!string.IsNullOrEmpty(apartmentNumber) || !string.IsNullOrEmpty(accountNumber))
         {
             if (list.get_Count() == 0)
             {
                 System.Windows.Forms.MessageBox.Show("По Вашему запросу не найдено адреса.", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
                 this.flag = true;
             }
             else
             {
                 this.addressesSearch.Clear();
                 this.addressesSearch.Add(LocalAddress.FindById(list.get_Item(0).AdrId));
             }
         }
     }
     else
     {
         LocalAddress selectedAddress = this.m_LocalAddressSelector.GetSelectedAddress();
         string ownerName = this.m_OwnerNameEdit.get_Text();
         if ((selectedAddress == LocalAddress.Null) && string.IsNullOrEmpty(ownerName))
         {
             list = Apartment.Search(string.Empty, string.Empty, LocalAddress.Null.Id, string.Empty, this.chxShowClose.get_Checked(), string.Empty);
             this.addressesSearch.Clear();
             for (int j = 0; j < LocalAddress.GetUserAddresses().get_Count(); j = (int) (j + 1))
             {
                 this.addressesSearch.Add(LocalAddress.GetUserAddresses().get_Item(j));
             }
         }
         else if ((selectedAddress != LocalAddress.Null) || !string.IsNullOrEmpty(ownerName))
         {
             list = Apartment.Search(string.Empty, string.Empty, selectedAddress.Id, ownerName, this.chxShowClose.get_Checked(), string.Empty);
             if (list.get_Count() == 0)
             {
                 System.Windows.Forms.MessageBox.Show("По Вашему запросу не найдено адреса.", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
                 this.flag = true;
             }
             else
             {
                 this.addressesSearch.Clear();
                 if (selectedAddress != LocalAddress.Null)
                 {
                     this.addressesSearch.Add(selectedAddress);
                 }
                 else
                 {
                     this.addressesSearch.Add(LocalAddress.FindById(list.get_Item(0).AdrId));
                 }
             }
         }
     }
     list.ApplySort("AddressName");
     e.set_Result(list);
 }
 private ObjectList<ApartmentResidentBenefitsServiceTypesView> GetSelectRowsGrid()
 {
     ObjectList<ApartmentResidentBenefitsServiceTypesView> list = new ObjectList<ApartmentResidentBenefitsServiceTypesView>();
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvServiceTypes.Rows)
     {
         if (row.get_Selected())
         {
             list.Add((ApartmentResidentBenefitsServiceTypesView) row.get_DataBoundItem());
         }
     }
     if (list.get_Count() == 0)
     {
         return null;
     }
     return list;
 }
Example #13
0
 private void selectServiceTypes_Selected(ObjectList<ServiceTypeOld> list)
 {
     if ((list != null) && (list.get_Count() > 0))
     {
         this.selectServices.FilterServiceTypes = list.get_Item(0);
     }
     else
     {
         this.selectServices.FilterServiceTypes = null;
     }
 }
 private void SaveIndications()
 {
     this.UpdatePackNumber();
     this.dgvApartmentCounterIndicationsView.EndEdit();
     ObjectList<ApartmentCounterIndicationInputView> counterIndications = new ObjectList<ApartmentCounterIndicationInputView>();
     ObjectList<ApartmentCounterIndicationInputView> list2 = this.bsApartmentCounterIndicationInputView.get_DataSource() as ObjectList<ApartmentCounterIndicationInputView>;
     foreach (ApartmentCounterIndicationInputView view in list2)
     {
         if ((view.NewVal != view.Val) || view.IsValueChanged)
         {
             if (!this.IsCorrectIndication(view))
             {
                 view.NewValTypeName = "Контрольное (информационное)";
             }
             counterIndications.Add(view);
         }
     }
     if (counterIndications.get_Count() > 0)
     {
         if (this.tsmiConfirmSaving.get_Checked())
         {
             if (System.Windows.Forms.DialogResult.Yes != System.Windows.Forms.MessageBox.Show(null, "Сохранить показания?", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Exclamation, System.Windows.Forms.MessageBoxDefaultButton.Button1))
             {
                 return;
             }
             this.ClearAll();
             this.FocusOnBarcode();
         }
         try
         {
             ApartmentCounterIndicationInputView.SaveIndications(counterIndications);
         }
         catch (System.Data.SqlClient.SqlException exception)
         {
             Messages.ShowException(this, "Ошибка при сохранении показаний", exception);
         }
         catch (System.Exception exception2)
         {
             Messages.ShowException(this, "Неопознанная ошибка", exception2);
         }
     }
     else
     {
         Messages.ShowMessage("Нет корректных показаний для сохранения");
     }
     if (!this.m_IsFirstUpdate)
     {
         this.m_IsFirstUpdate = true;
     }
 }
 private void btnSave_Click(object sender, System.EventArgs e)
 {
     bool isSaveDuplicateIndications = this.cbSaveDuplicateIndications.get_Checked();
     if ((System.Windows.Forms.Application.OpenForms.get_Item(0).GetType().ToString() == "AIS.SN.UI.Provider.ProviderMainForm") && !User.IsMemberOf(RightsEnum.ПравоНеограниченнойРаботыСПоказаниями))
     {
         string valueByName = Setting.GetValueByName("Работа с приборами учета", "Диапазон в который разрешено редактирование в Поставщике");
         if ((System.Convert.ToInt32(valueByName.Substring(0, valueByName.IndexOf('-'))) > System.DateTime.Now.get_Day()) || (System.Convert.ToInt32(valueByName.Substring((int) (valueByName.IndexOf('-') + 1), (int) ((valueByName.get_Length() - valueByName.IndexOf('-')) - 1))) < System.DateTime.Now.get_Day()))
         {
             System.Windows.Forms.MessageBox.Show(string.Concat((string[]) new string[] { "Вам разрешено редактирование данных только с ", valueByName.Substring(0, valueByName.IndexOf('-')), " по ", valueByName.Substring((int) (valueByName.IndexOf('-') + 1), (int) ((valueByName.get_Length() - valueByName.IndexOf('-')) - 1)), " числа месяца" }), "Редактирование запрещено", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand);
             return;
         }
     }
     this.dgvApartmentCounterIndicationsView.EndEdit();
     if (System.Windows.Forms.DialogResult.No != System.Windows.Forms.MessageBox.Show(null, "Сохранить показания?", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Exclamation, System.Windows.Forms.MessageBoxDefaultButton.Button2))
     {
         ObjectList<ApartmentCounterIndicationInputView> list = (ObjectList<ApartmentCounterIndicationInputView>) this.bsApartmentCounterIndicationInputView.get_DataSource();
         ObjectList<ApartmentCounterIndicationInputView> counterIndications = new ObjectList<ApartmentCounterIndicationInputView>();
         foreach (ApartmentCounterIndicationInputView view in list)
         {
             if ((((view.Val != view.NewVal) || isSaveDuplicateIndications) || view.IsSaveDuplicateIndication) && view.ValidationMultiChangeIndication())
             {
                 counterIndications.Add(view);
             }
         }
         if (counterIndications.get_Count() > 0)
         {
             try
             {
                 DALSql.ExecuteNonQuery("begin transaction", null);
                 ApartmentCounterIndicationInputView.MultiSaveRecalc(0L, counterIndications, isSaveDuplicateIndications);
                 DALSql.ExecuteNonQuery("commit transaction", null);
                 Messages.ShowMessage("Данные успешно сохранены");
             }
             catch (System.Exception exception)
             {
                 DALSql.ExecuteNonQuery("IF (XACT_STATE()) = -1\r\n                                                BEGIN\r\n                                                    ROLLBACK TRANSACTION;\r\n                                                END;\r\n\r\n                                                -- Test whether the transaction is active and valid.\r\n                                                IF (XACT_STATE()) = 1\r\n                                                BEGIN\r\n                                                    COMMIT TRANSACTION;   \r\n                                                END;\r\n                                            ", null);
                 System.Windows.Forms.MessageBox.Show(exception.get_Message());
             }
         }
     }
 }
Example #16
0
 public static ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress> GetByStatus(ExchangeStatus status, Area filterArea)
 {
     System.Collections.Generic.List<long> addresses = new System.Collections.Generic.List<long>();
     ObjectList<ExchangeRequest> exchangeRequestsGroup = ExchangeRequest.GetExchangeRequestsGroup(ExchangeRequestType.Address, status);
     ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress> list3 = new ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress>();
     foreach (ExchangeRequest request in exchangeRequestsGroup)
     {
         AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress address = Serializer.FromXml<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress>(request.XmlIn);
         address.DateIn = request.DateIn;
         address.ExchangeRequestId = request.Id;
         address.LocalAddressId = request.AddressId;
         if (address.LocalAddressId != LocalAddress.Null.Id)
         {
             addresses.Add(address.LocalAddressId);
         }
         address.Address = string.Concat((string[]) new string[] { ((address.LastChangeDate != Constants.NullDate) ? ((string) address.LastChangeDate.ToShortDateString()) : ((string) address.DateIn.ToShortDateString())), ";", address.StreetSocr, " ", address.Street, ";", address.HouseSocr, " ", address.House, ";", address.FlatSocr, " ", address.Flat });
         list3.Add(address);
     }
     ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress> list4 = new ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress>();
     if ((filterArea == null) || (filterArea == Area.Null))
     {
         return list3.ApplySort("Address");
     }
     Area lhs = new Area {
         StatusTemporary = 1
     };
     lhs.SaveChanges();
     lhs.SaveAddresses(addresses);
     System.Collections.Generic.IList<long> filteredApartmentLocalAddresses = Area.GetFilteredApartmentLocalAddresses(lhs, filterArea);
     for (int i = 0; i < list3.get_Count(); i = (int) (i + 1))
     {
         long num2 = (list3.get_Item(i).RemoteAddressId == 0L) ? list3.get_Item(i).LocalAddressId : list3.get_Item(i).RemoteAddressId;
         if (filteredApartmentLocalAddresses.Contains(num2))
         {
             list4.Add(list3.get_Item(i));
         }
     }
     return list4.ApplySort("Address");
 }
Example #17
0
 protected void Generate(GenerationMode generationMode, AsyncOperation asyncOp)
 {
     System.DateTime time2;
     System.TimeSpan span2;
     this.IsBusy = true;
     int num = 0;
     logger.Info("Запущена операция формирования извещений");
     System.Exception ex = null;
     System.DateTime now = System.DateTime.Now;
     if (generationMode != GenerationMode.GenerateOnly)
     {
         ObjectList<NoticeNoticeTemplate> list = new ObjectList<NoticeNoticeTemplate> {
             this.Template
         };
         this.Templates = list;
     }
     this.InitNoticeRenderer();
     this.m_RenderedNoticeQueue.IsClosed = false;
     this.m_SaveRenderedNoticeQueue.IsClosed = false;
     this.m_RenderingNoticeQueue.IsClosed = false;
     this.m_ThreadExceptions.IsClosed = false;
     this.m_GeneratedReport = null;
     this.m_RenderingNoticeQueue.Clear();
     this.m_RenderedNoticeQueue.Clear();
     this.m_SaveRenderedNoticeQueue.Clear();
     this.m_ThreadExceptions.Clear();
     this.m_ProcessedNoticeCount = this.AccountListStatistics.RenderedCount;
     this.m_RenderThreads = null;
     this.m_ReportGenerationThreads = null;
     logger.Info("Запуск потоков");
     try
     {
         this.m_RenderThreads = new System.Threading.Thread[Constants.NoticeRenderThreads];
         for (int i = 0; i < this.m_RenderThreads.Length; i = (int) (i + 1))
         {
             this.m_RenderThreads[i] = new System.Threading.Thread(new System.Threading.ThreadStart(this.RenderThread));
             this.m_RenderThreads[i].Start();
             logger.Info("Запуск потока рендера " + (i + 1));
         }
         if (generationMode != GenerationMode.GenerateOnly)
         {
             this.m_ReportGenerationThreads = new System.Threading.Thread[Constants.NoticeReportGenerationThreads];
             for (int j = 0; j < this.m_ReportGenerationThreads.Length; j = (int) (j + 1))
             {
                 this.m_ReportGenerationThreads[j] = new System.Threading.Thread(new System.Threading.ThreadStart(this.ReportGenerationThread));
                 this.m_ReportGenerationThreads[j].Start();
                 logger.Info("Запуск потока экспорта " + (j + 1));
             }
         }
     }
     catch (System.OutOfMemoryException exception2)
     {
         ex = new NoticeGenerationException("Недостаточно памяти для создания потоков.", exception2);
         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
         return;
     }
     catch (System.ApplicationException exception3)
     {
         ex = new NoticeGenerationException("Ошибка при выполнении запроса в базу данных для получения константы", exception3);
         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
         return;
     }
     catch (System.Data.SqlClient.SqlException exception4)
     {
         ex = new NoticeGenerationException("Ошибка при выполнении запроса в базу данных для получения константы", exception4);
         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
         return;
     }
     catch (System.Exception exception5)
     {
         ex = new NoticeGenerationException("Ошибка при создании потоков", exception5);
         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
         return;
     }
     if (Constants.MaxAccountsInGeneratingBlock > 0)
     {
         time2 = System.DateTime.Now;
         logger.Info("AccountCount: " + ((long) this.AccountListStatistics.AccountCount));
         for (int k = 0; k < System.Math.Ceiling((decimal) (this.AccountListStatistics.AccountCount / System.Convert.ToDecimal(Constants.MaxAccountsInGeneratingBlock))); k = (int) (k + 1))
         {
             if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
             {
                 ex = null;
                 this.m_ThreadExceptions.TryDequeue(out ex);
                 this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                 return;
             }
             foreach (NoticeNoticeTemplate template in this.Templates)
             {
                 bool flag;
                 int indexPart = (int) (k + 1);
                 logger.Info("Получение блока извещений для пачки " + ((int) indexPart));
                 System.Data.DataTable table = null;
                 do
                 {
                     flag = false;
                 }
                 while (flag && (num <= 5));
                 this.ReportPercentage(asyncOp);
                 ObjectList<NoticeNotice> list2 = new ObjectList<NoticeNotice>();
                 logger.Info("Разбор полученного блока. Кол-во: " + ((int) table.Rows.get_Count()));
                 foreach (System.Data.DataRow row in table.Rows)
                 {
                     if (!row.IsNull("renderedNoticeId") && (generationMode != GenerationMode.GenerateOnly))
                     {
                         long id = (long) ((long) row.get_Item("renderedNoticeId"));
                         NoticeRenderedNotice item = null;
                         num = 0;
                         do
                         {
                             flag = false;
                             try
                             {
                                 item = NoticeRenderedNotice.GetById(id);
                                 this.m_RenderedNoticeQueue.Enqueue(item);
                             }
                             catch (System.ApplicationException exception9)
                             {
                                 if (exception9.InnerException is System.Data.SqlClient.SqlException)
                                 {
                                     num = (int) (num + 1);
                                     flag = true;
                                     logger.Warn("Потеря соединения. Переподключение.");
                                 }
                                 else
                                 {
                                     ex = new NoticeGenerationException("Ошибка при получении сформированного извещения из базы данных", exception9);
                                     this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                                     return;
                                 }
                             }
                             catch (System.Exception exception11)
                             {
                                 ex = new NoticeGenerationException("Ошибка при получении сформированного извещения из базы данных", exception11);
                                 this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                                 return;
                             }
                         }
                         while (flag && (num <= 5));
                     }
                     else if (!row.IsNull("noticeId") && row.IsNull("renderedNoticeId"))
                     {
                         NoticeNotice notice2 = new NoticeNotice();
                         try
                         {
                             long num7 = (long) ((long) row.get_Item("noticeId"));
                             notice2.Id = num7;
                             notice2.Period = (System.DateTime) row.get_Item("period");
                             notice2.AccountId = (long) ((long) row.get_Item("accountId"));
                             notice2.HouseHolderId = row.IsNull("houseHolderId") ? NoticeNotice.Null.Id : ((long) ((long) row.get_Item("houseHolderId")));
                             notice2.Barcode = row.IsNull("barcode") ? string.Empty : ((string) ((string) row.get_Item("barcode")));
                         }
                         catch (System.Exception exception12)
                         {
                             ex = new NoticeGenerationException("Ошибка заполнении объекта извещения данными из БД", exception12);
                             this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                             return;
                         }
                         list2.Add(notice2);
                     }
                 }
                 table.Clear();
                 table.Dispose();
                 this.ReportPercentage(asyncOp);
                 if (list2.get_Count() > 0)
                 {
                     logger.Info("Получение данных для блока извещений из " + ((int) list2.get_Count()));
                     System.Data.DataTable table2 = null;
                     num = 0;
                     do
                     {
                         flag = false;
                         try
                         {
                             table2 = NoticeNotice.GetHeader(this.AreaId, this.Adapter.Filter.Period.Value, indexPart, template.Id);
                         }
                         catch (System.ApplicationException exception13)
                         {
                             if (exception13.InnerException is System.Data.SqlClient.SqlException)
                             {
                                 num = (int) (num + 1);
                                 flag = true;
                                 logger.Warn("Потеря соединения. Переподключение.");
                             }
                             else
                             {
                                 ex = new NoticeGenerationException("Ошибка при получении заголовков для блока извещений", exception13);
                                 this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                                 return;
                             }
                         }
                         catch (System.Exception exception15)
                         {
                             ex = new NoticeGenerationException("Ошибка при получении заголовков для блока извещений", exception15);
                             this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                             return;
                         }
                     }
                     while (flag && (num <= 5));
                     table2.set_TableName("header");
                     this.ReportPercentage(asyncOp);
                     if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
                     {
                         ex = null;
                         this.m_ThreadExceptions.TryDequeue(out ex);
                         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                         return;
                     }
                     System.Data.DataSet set = null;
                     num = 0;
                     do
                     {
                         flag = false;
                         try
                         {
                             set = NoticeNotice.GetReport(this.AreaId, this.Adapter.Filter.Period.Value, indexPart, template.Sql, template.Id);
                             if ((this.AdditionDataTable != null) && (set != null))
                             {
                                 set.Tables.Add(this.AdditionDataTable);
                             }
                         }
                         catch (System.ApplicationException exception16)
                         {
                             if (exception16.InnerException is System.Data.SqlClient.SqlException)
                             {
                                 num = (int) (num + 1);
                                 flag = true;
                                 logger.Warn("Потеря соединения. Переподключение.");
                             }
                             else
                             {
                                 ex = new NoticeGenerationException("Ошибка при получении данных для блока извещений", exception16);
                                 this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                                 return;
                             }
                         }
                         catch (System.Exception exception18)
                         {
                             ex = new NoticeGenerationException("Ошибка при получении данных для блока извещений", exception18);
                             this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                             return;
                         }
                     }
                     while (flag && (num <= 5));
                     set.Tables.get_Item(0).set_TableName("pays");
                     set.Tables.get_Item(1).set_TableName("counter");
                     for (int m = 2; m < set.Tables.get_Count(); m = (int) (m + 1))
                     {
                         int num15 = (int) (m - 1);
                         set.Tables.get_Item(m).set_TableName("data" + ((int) num15).ToString());
                     }
                     if (template.IdentityName == "Счет на оплату Ульяновск вариант 3")
                     {
                         if (set.Tables.get_Count() > 2)
                         {
                             set.Tables.get_Item(2).set_TableName("organizations");
                         }
                         if (set.Tables.get_Count() > 3)
                         {
                             set.Tables.get_Item(3).set_TableName("rates");
                         }
                     }
                     logger.Info("Отправка группы извещений {0} на рендер", indexPart);
                     this.m_RenderingNoticeQueue.IsWaiting = true;
                     foreach (NoticeNotice notice3 in list2)
                     {
                         System.Data.DataTable headerTable = table2.Clone();
                         foreach (System.Data.DataRow row2 in table2.Rows)
                         {
                             bool flag2 = false;
                             foreach (System.Data.DataRow row3 in set.Tables.get_Item(0).Rows)
                             {
                                 if (((long) row3.get_Item("id")) == notice3.Id)
                                 {
                                     flag2 = true;
                                     break;
                                 }
                             }
                             if (!flag2)
                             {
                                 break;
                             }
                             if (((long) row2.get_Item("id")) == notice3.Id)
                             {
                                 headerTable.ImportRow(row2);
                                 break;
                             }
                         }
                         RenderingNotice notice4 = new RenderingNotice(notice3, headerTable, set.Copy(), template.Template, template.Id);
                         this.m_RenderingNoticeQueue.Enqueue(notice4);
                         logger.Info("Отправлено на рендер " + ((long) notice3.Id));
                         this.ReportPercentage(asyncOp);
                     }
                     table2.Clear();
                     table2.Dispose();
                     set.Clear();
                     set.Dispose();
                     this.m_RenderingNoticeQueue.IsWaiting = false;
                     this.m_RetreivedNoticeBlocksCount = (int) (this.m_RetreivedNoticeBlocksCount + 1);
                 }
                 this.ReportPercentage(asyncOp);
                 if (this.m_RetreivedNoticeBlocksCount >= Constants.MaxRenderingBlocks)
                 {
                     logger.Info("Достигнуто максимальное количество одновременно обрабатываемых блоков");
                     while (true)
                     {
                         if (((this.m_SaveRenderedNoticeQueue.Count == 0) && (this.m_RenderingNoticeQueue.Count == 0)) && (this.m_RenderingNoticeCount == 0))
                         {
                             logger.Info("Очереди обработаны.");
                             this.m_RetreivedNoticeBlocksCount = 0;
                             continue;
                         }
                         this.SaveRenderedNotices(asyncOp, now);
                         this.ReportPercentage(asyncOp);
                         if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
                         {
                             ex = null;
                             this.m_ThreadExceptions.TryDequeue(out ex);
                             this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                             return;
                         }
                         System.Threading.Thread.Sleep(10);
                     }
                 }
                 this.SaveRenderedNotices(asyncOp, now);
                 this.ReportPercentage(asyncOp);
                 span2 = (System.TimeSpan) (System.DateTime.Now - time2);
                 if (span2.get_TotalMinutes() >= 3.0)
                 {
                     time2 = System.DateTime.Now;
                     logger.Info("Сборка мусора");
                     System.GC.Collect();
                 }
                 if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
                 {
                     ex = null;
                     this.m_ThreadExceptions.TryDequeue(out ex);
                     this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                     return;
                 }
             }
         }
         this.m_RenderingNoticeQueue.IsClosed = true;
         logger.Info("Ожидание и обработка очереди оставшихся отрендеренных извещений");
         while (!this.m_SaveRenderedNoticeQueue.IsClosed || (this.m_SaveRenderedNoticeQueue.Count != 0))
         {
             if (this.m_SaveRenderedNoticeQueue.Count == 0)
             {
                 System.Threading.Thread.Sleep(10);
             }
             span2 = (System.TimeSpan) (System.DateTime.Now - time2);
             if (span2.get_TotalMinutes() >= 3.0)
             {
                 time2 = System.DateTime.Now;
                 logger.Info("Сборка мусора");
                 System.GC.Collect();
             }
             this.ReportPercentage(asyncOp);
             if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
             {
                 ex = null;
                 this.m_ThreadExceptions.TryDequeue(out ex);
                 this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                 return;
             }
             this.SaveRenderedNotices(asyncOp, now);
         }
     }
     else
     {
         ex = new NoticeGenerationException("Неверное значение константы MaxAccountsInGeneratingBlock");
         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
         return;
     }
     this.m_RenderedNoticeQueue.IsClosed = true;
     logger.Info("Ожидание завершения запущенных потоков рендеринга и экспорта");
     while ((this.m_RenderingNoticeQueue.Count > 0) || (this.m_RenderingNoticeCount > 0))
     {
         System.Threading.Thread.Sleep(10);
         if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
         {
             ex = null;
             this.m_ThreadExceptions.TryDequeue(out ex);
             this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
             return;
         }
         this.ReportPercentage(asyncOp);
     }
     while ((this.m_RenderedNoticeQueue.Count > 0) || (this.m_ExportingNoticeCount > 0))
     {
         System.Threading.Thread.Sleep(10);
         if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
         {
             ex = null;
             this.m_ThreadExceptions.TryDequeue(out ex);
             this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
             return;
         }
         this.ReportPercentage(asyncOp);
     }
     span2 = (System.TimeSpan) (System.DateTime.Now - time2);
     if (span2.get_TotalMinutes() >= 3.0)
     {
         time2 = System.DateTime.Now;
         logger.Info("Сборка мусора");
         System.GC.Collect();
     }
     NoticeReport report = null;
     if (generationMode == GenerationMode.GenerateReport)
     {
         logger.Info("Объединение извещений в один отчёт для показа");
         System.Collections.Generic.List<NoticeRenderedNotice> renderedNotices = new System.Collections.Generic.List<NoticeRenderedNotice>();
         foreach (NoticeReport report2 in this.m_NoticeReports)
         {
             renderedNotices.AddRange(report2.RenderedNotices);
             report2.Dispose();
         }
         report = new NoticeReport(renderedNotices);
         this.m_GeneratedReport = report;
     }
     if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
     {
         ex = null;
         this.m_ThreadExceptions.TryDequeue(out ex);
         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
     }
     else
     {
         if ((this.m_NoticeCache.get_Count() > 0) && (this.m_Exporter != null))
         {
             logger.Info("Экспорт по домам управляющих компаний");
             int num9 = (int) ((this.m_Exporter.MaxPageCount * this.m_Template.AccountsInTemplate) / this.m_Template.PageCount);
             CachedNoticeInfoComparer comparer = new CachedNoticeInfoComparer();
             try
             {
                 foreach (string str in this.m_NoticeCache.Keys)
                 {
                     this.m_NoticeCache[str].Sort(comparer);
                     logger.Info("Экспорт домов УК " + str);
                     for (int n = 0; n < this.m_NoticeCache[str].get_Count(); n = (int) (n + num9))
                     {
                         System.Text.StringBuilder builder = new System.Text.StringBuilder();
                         int num11 = this.m_NoticeCache[str].get_Count();
                         if (num11 != 0)
                         {
                             int maxPageCount = this.m_Exporter.MaxPageCount;
                             int num13 = (int) (num11 - (n + maxPageCount));
                             num13 = (num13 < 1) ? ((int) 0) : num13;
                             using (StiReport report3 = new StiReport())
                             {
                                 report3.IsRendered = true;
                                 report3.NeedsCompiling = false;
                                 report3.RenderedPages.Clear();
                                 System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(System.IO.Path.Combine(this.m_Exporter.DestinationPath, str));
                                 if (!info.get_Exists())
                                 {
                                     info.Create();
                                 }
                                 string file = System.IO.Path.Combine(info.get_FullName(), string.Format("{0}_{1}.pdf", str, n / num9));
                                 for (int num14 = n; num14 < (num11 - num13); num14 = (int) (num14 + 1))
                                 {
                                     System.IO.FileInfo info2 = new System.IO.FileInfo(this.m_NoticeCache[str].get_Item(num14).CacheFilePath);
                                     if (info2.get_Exists())
                                     {
                                         byte[] bytes = System.IO.File.ReadAllBytes(info2.get_FullName());
                                         StiReport report4 = new StiReport();
                                         report4.LoadPackedDocument(bytes);
                                         report4.ReportUnit = report3.ReportUnit;
                                         foreach (StiPage page in report4.RenderedPages)
                                         {
                                             page.Report = report3;
                                             page.Guid = System.Guid.NewGuid().ToString().Replace("-", "");
                                             report3.RenderedPages.Add(page);
                                         }
                                         if (this.m_Exporter.DualPageExportMode && ((report4.RenderedPages.get_Count() % 2) != 0))
                                         {
                                             StiPage page2 = new StiPage(report3) {
                                                 IsRendered = true,
                                                 Orientation = report4.RenderedPages[0].Orientation,
                                                 Guid = System.Guid.NewGuid().ToString().Replace("-", "")
                                             };
                                             report3.RenderedPages.Add(page2);
                                         }
                                         builder.AppendLine(this.m_NoticeCache[str].get_Item(num14).FullAddress);
                                     }
                                 }
                                 report3.ExportDocument(StiExportFormat.Pdf, file);
                                 System.IO.File.WriteAllText(file + ".txt", builder.ToString());
                             }
                         }
                     }
                 }
                 logger.Info("Очистка дискового кэша");
                 System.IO.Directory.Delete(System.IO.Path.Combine(this.m_Exporter.DestinationPath, this.m_ExportCacheDirectoryName), true);
             }
             catch (System.Exception exception19)
             {
                 ex = new NoticeGenerationException("Ошибка при экспорте извещений, сгруппированных по УК", exception19);
                 this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                 return;
             }
         }
         System.TimeSpan timeSpent = (System.TimeSpan) (System.DateTime.Now - now);
         logger.Info("Операция успешно завершена. Время выполнения " + timeSpent.ToString());
         logger.Info("Всего отрендерено: " + ((int) this.m_TotalRendered));
         if (asyncOp != null)
         {
             GenerationCompletedEventArgs args = new GenerationCompletedEventArgs(timeSpent, null, false, asyncOp.get_UserSuppliedState()) {
                 GeneratedReport = report
             };
             asyncOp.PostOperationCompleted(this.onCompletedDelegate, args);
         }
         this.Reset();
     }
 }
 private void butOplApply_Click(object sender, System.EventArgs e)
 {
     if (!this.IsBusy)
     {
         this.butOplApply.set_Enabled((bool) !(this.IsBusy = true));
         if (this.m_PrintPOS.IsBusy)
         {
             System.Windows.Forms.MessageBox.Show("Фискальный регистратор занят. " + System.Environment.get_NewLine() + "Дождитесь выполнения операции.");
             this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
         }
         else
         {
             User currentUser;
             this.Payments_Fill();
             ObjectList<SpPayment> payments = new ObjectList<SpPayment>();
             decimal num = 0M;
             decimal commission = 0M;
             PayPaymentMoreFixedSum sum = new PayPaymentMoreFixedSum();
             foreach (SpPayment payment2 in this.m_payments)
             {
                 if (!(payment2.Summ == 0M))
                 {
                     num += payment2.Summ;
                     commission += payment2.Commission;
                     SpPayment payment = new SpPayment {
                         AccountId = payment2.AccountId,
                         ServiceName = payment2.ServiceName,
                         Summ = payment2.Summ,
                         Commission = 0M
                     };
                     payments.Add(payment);
                 }
             }
             commission = decimal.Round(commission, 2);
             if (payments.get_Count() == 0)
             {
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 throw new System.ApplicationException("Ошибка, нет ни одной услуги для оплаты, проверте суммы оплаты.");
             }
             payments.get_Item(0).Commission = commission;
             string cashierTerminal = Settings.Default.CashierTerminal;
             if (num >= PersonsCashSearchForm.FixedSumm)
             {
                 PersonsCashSearchForm form = new PersonsCashSearchForm();
                 if (form.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                 {
                     base.Close();
                     return;
                 }
                 sum.PersonId = form.SelectPerson.Id;
             }
             try
             {
                 currentUser = User.GetCurrentUser();
                 currentUser.GetOrg();
             }
             catch (System.Exception)
             {
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 throw new System.ApplicationException("Ошибка, проверьте настройки пользователя, организаций пункта приема и платежного агента.");
             }
             sum.UserId = currentUser.Id;
             PayLocalTransaction transaction = AccountOther.MakePaymentTry(payments, currentUser.Id, cashierTerminal);
             AccountOther.MakeCommit();
             if (num >= PersonsCashSearchForm.FixedSumm)
             {
                 sum.SpPaymentUno = transaction.Id;
                 sum.Summ = num;
                 sum.SaveChanges();
             }
             this.m_PrintPOS.AddToAccumulatePaySum(num, commission);
             this.m_PrintPOS.PrintPayment(this.m_Accounts.get_Item(0), payments, ((long) transaction.Id).ToString(), false, num, commission, false, delegate {
                 Messages.ShowMessage("Платеж успешно проведен.");
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 base.Close();
             }, delegate {
                 Messages.ShowMessage("Платеж успешно проведен.");
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 base.Close();
             });
         }
     }
 }
Example #19
0
 public House GetHouseByAddressId()
 {
     ObjectList<House> list = new ObjectList<House>();
     if (this.AddressLevel == 40)
     {
         list = Mappers.HouseMapper.FindByAdrId(this.ParentAddrId);
     }
     else if (this.AddressLevel == 30)
     {
         list = Mappers.HouseMapper.FindByAdrId(this.AdrId);
     }
     if (list.get_Count() == 0)
     {
         return House.Null;
     }
     return list.get_Item(0);
 }
Example #20
0
 private void SelectedService(ObjectList<ServiceOld> list)
 {
     if (list.get_Count() > 0)
     {
         this.serviceProviderTree.ShowOrganizations(this.FindOrganizationsByService(list.get_Item(0)));
         this.TreeExpander(this.serviceProviderTree, list.get_Item(0));
     }
 }
 public System.Data.DataSet MakeDataSource()
 {
     if (this.m_UseNoticeReportGenerator)
     {
         this.m_Area = new Area();
         this.m_Area.SaveChanges();
         LocalAddress address = LocalAddress.FindById(this.m_Account.AddrId);
         ObjectList<LocalAddress> list = new ObjectList<LocalAddress> {
             address
         };
         if (list.get_Count() != 0)
         {
             this.m_Area.SaveAddresses(list);
         }
         System.Data.DataSet set = new System.Data.DataSet();
         set.Tables.Add(new System.Data.DataTable());
         set.Tables.get_Item(0).Columns.Add("column");
         set.Tables.get_Item(0).Rows.Add(set.Tables.get_Item(0).NewRow());
         return set;
     }
     Area area = new Area();
     area.SaveChanges();
     LocalAddress address2 = LocalAddress.FindById(this.m_Account.AddrId);
     ObjectList<LocalAddress> addresses = new ObjectList<LocalAddress> {
         address2
     };
     if (addresses.get_Count() != 0)
     {
         area.SaveAddresses(addresses);
     }
     if (this.m_GenerateBeforeView)
     {
         NoticeNotice.GenerateNotices(this.m_NoticePeriod, (addresses.get_Count() == 0) ? ((long) 0L) : area.Id, null, null, false, true);
     }
     ObjectList<NoticeNotice> notices = NoticeNotice.FindBy(addresses, this.m_NoticePeriod, "", null);
     if (notices.get_Count() == 0)
     {
         return null;
     }
     System.Data.DataTable table = NoticeNotice.GetHeader(notices, false, false);
     table.set_TableName("header");
     System.Data.DataSet report = NoticeNotice.GetReport(notices, this.m_NoticeNoticeTemplateSetting.Template.Sql);
     if ((report.Tables.get_Count() < 2) || (report.Tables.get_Item(0).Rows.get_Count() == 0))
     {
         return null;
     }
     report.Tables.get_Item(0).set_TableName("pays");
     report.Tables.get_Item(1).set_TableName("counter");
     for (int i = 2; i < report.Tables.get_Count(); i = (int) (i + 1))
     {
         int num2 = (int) (i - 1);
         report.Tables.get_Item(i).set_TableName("data" + ((int) num2).ToString());
     }
     if (this.m_NoticeNoticeTemplateSetting.Template.IdentityName == "Счет на оплату Ульяновск вариант 3")
     {
         if (report.Tables.get_Count() > 2)
         {
             report.Tables.get_Item(2).set_TableName("organizations");
         }
         if (report.Tables.get_Count() > 3)
         {
             report.Tables.get_Item(3).set_TableName("rates");
         }
     }
     report.Tables.Add(table);
     return report;
 }
Example #22
0
 public void SetFilter(ObjectList<Organization> FilterServiceProvider, ServiceTypeOld FilterServiceTypes, ObjectList<LocalAddress> addressesSource, ObjectList<LocalAddress> addressesDest, ObjectList<ServiceOld> ServicesOld)
 {
     if ((FilterServiceProvider != null) && (FilterServiceProvider.get_Count() == 0))
     {
         this.m_FilterServiceProvider = null;
     }
     else
     {
         this.m_FilterServiceProvider = FilterServiceProvider;
     }
     if (FilterServiceTypes != null)
     {
         this.m_FilterServiceTypes = FilterServiceTypes;
     }
     if ((addressesDest != null) && (addressesDest.get_Count() == 0))
     {
         this.m_addressesDest = null;
     }
     else
     {
         this.m_addressesDest = new ObjectList<LocalAddress>();
         this.m_addressesDest.AddRange(addressesDest);
     }
     if ((ServicesOld != null) && (ServicesOld.get_Count() > 0))
     {
         this.m_Services = ServicesOld;
     }
     if ((addressesSource != null) && (addressesSource.get_Count() == 0))
     {
         this.m_addressesSource = null;
     }
     else
     {
         this.m_addressesSource = new ObjectList<LocalAddress>();
         this.m_addressesSource.AddRange(addressesSource);
     }
 }
Example #23
0
 public void SetFilter(ObjectList<Organization> FilterServiceProvider, ObjectList<ServiceTypeOld> FilterServiceTypes, ObjectList<CanonicalService> FilterCanonicalServices, Area Area, System.DateTime Date)
 {
     if ((FilterServiceProvider != null) && (FilterServiceProvider.get_Count() == 0))
     {
         this.m_FilterServiceProvider = null;
     }
     else
     {
         this.m_FilterServiceProvider = FilterServiceProvider;
     }
     if ((FilterServiceTypes != null) && (FilterServiceTypes.get_Count() == 0))
     {
         this.m_FilterServiceTypes = null;
     }
     else
     {
         this.m_FilterServiceTypes = FilterServiceTypes;
     }
     if ((FilterCanonicalServices != null) && (FilterCanonicalServices.get_Count() == 0))
     {
         this.m_FilterCanonicalServices = null;
     }
     else
     {
         this.m_FilterCanonicalServices = FilterCanonicalServices;
     }
     this.m_Area = Area;
     this.m_Date = Date;
 }
Example #24
0
 private void LoadNoticeInfo()
 {
     if (this.tcPaymentNotices.SelectedTab == this.tpAddInfo)
     {
         if (this.btnCurrentPosition.get_Checked())
         {
             this.btnAdd.set_Enabled(true);
             this.btnDel.set_Enabled(true);
             this.btnChange.set_Enabled(true);
         }
         if (this.areaAddressesTree.SelectedNode == null)
         {
             Messages.ShowWarning("Выберите адрес");
         }
         else
         {
             LocalAddress localAddress = (LocalAddress) this.areaAddressesTree.SelectedNode.get_Tag();
             if (localAddress.Level.ToString() == "Жилье")
             {
                 this.btnAdd.set_Enabled(false);
                 this.btnDel.set_Enabled(false);
                 this.btnChange.set_Enabled(false);
                 this.bsNoticeInfoAdr.set_DataSource(null);
             }
             else
             {
                 ObjectList<NoticeNoticeInformationAddress> list = new ObjectList<NoticeNoticeInformationAddress>();
                 if (this.btnCurrentPosition.get_Checked())
                 {
                     list = NoticeNoticeInformationAddress.FindByAddrId(localAddress);
                     if (list.get_Count() != 0)
                     {
                         this.btnAdd.set_Enabled(false);
                     }
                 }
                 if (this.btnAllPosition.get_Checked())
                 {
                     this.btnChange.set_Enabled(true);
                     this.btnDel.set_Enabled(true);
                     list = NoticeNoticeInformationAddress.FindByParentAddrId(localAddress);
                 }
                 this.bsNoticeInfoAdr.set_DataSource(list);
             }
         }
     }
 }
 private void btnSave_Click(object sender, System.EventArgs e)
 {
     this.dgvApartmentCounterIndicationsView.EndEdit();
     if (System.Windows.Forms.DialogResult.No != System.Windows.Forms.MessageBox.Show(null, "Сохранить показания?", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Exclamation, System.Windows.Forms.MessageBoxDefaultButton.Button2))
     {
         ObjectList<ApartmentCounterIndicationInputView> list = (ObjectList<ApartmentCounterIndicationInputView>) this.bsApartmentCounterIndicationInputView.get_DataSource();
         ObjectList<ApartmentCounterIndicationInputView> counterIndications = new ObjectList<ApartmentCounterIndicationInputView>();
         foreach (ApartmentCounterIndicationInputView view in list)
         {
             if ((view.Val != view.NewVal) && view.ValidationMultiChangeIndication())
             {
                 counterIndications.Add(view);
             }
         }
         if (counterIndications.get_Count() > 0)
         {
             try
             {
                 DALSql.ExecuteNonQuery("begin transaction", null);
                 ApartmentCounterIndicationInputView.SaveRecalc(this.mApartmnet, counterIndications);
                 DALSql.ExecuteNonQuery("commit transaction", null);
             }
             catch (System.Exception exception)
             {
                 DALSql.ExecuteNonQuery("IF (XACT_STATE()) = -1\r\n                                                BEGIN\r\n                                                    ROLLBACK TRANSACTION;\r\n                                                END;\r\n\r\n                                                -- Test whether the transaction is active and valid.\r\n                                                IF (XACT_STATE()) = 1\r\n                                                BEGIN\r\n                                                    COMMIT TRANSACTION;   \r\n                                                END;\r\n                                            ", null);
                 System.Windows.Forms.MessageBox.Show(exception.get_Message());
             }
         }
     }
 }
Example #26
0
 public void InsertReportShedulerParameters(long reportId, System.DateTime fromDate, System.DateTime toDate, ObjectList<Organization> houseHolders, ObjectList<Organization> serviceHouseHolders, ObjectList<Organization> accountHouseHolders, ObjectList<Organization> serviceProviders, ObjectList<Organization> resourceProviders, ObjectList<Organization> cashlessTransferrers, ObjectList<ServiceTypeOld> serviceTypes, ObjectList<CanonicalService> canonicalServices, ObjectList<ServiceOld> services, System.Collections.Generic.List<FasetItem> fasetItemApartmentTypes, System.Collections.Generic.List<FasetItem> fasetItemConvenienceTypes, System.Collections.Generic.List<FasetItem> fasetItemRecalcReasons, ObjectList<LocalAddress> localAddresses, Area selectedByUserArea, ObjectList<Benefit> benefits, bool isDebt, bool existsBenefitDiff, string paymentType, string apartamentArea, long minSumm, System.DateTime fromDay, System.DateTime toDay, bool withoutBankrupt, bool withoutClosesApartments, System.Collections.Generic.List<FasetItem> fasetFilterItems, ObjectList<Organization> paymentAgents, System.Collections.Generic.List<FasetItem> fasetItemHouseTypes, FasetItem cityBoroughs, string textParameter)
 {
     if (reportId != RepReportSheduler.Null.Id)
     {
         RepReportShedulerParameter parameter;
         if (fromDate != AIS.SN.Model.Constants.NullDate)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "fromDate",
                 Value = fromDate.ToShortDateString(),
                 PrintName = "Начало периода",
                 PrintValue = fromDate.ToShortDateString()
             };
             parameter.SaveChanges();
         }
         if (toDate != AIS.SN.Model.Constants.NullDate)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "toDate",
                 Value = toDate.ToShortDateString(),
                 PrintName = "Окончание периода",
                 PrintValue = toDate.ToShortDateString()
             };
             parameter.SaveChanges();
         }
         if (houseHolders != null)
         {
             foreach (Organization organization in houseHolders)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "houseHolderId",
                     Value = ((long) organization.Id).ToString(),
                     PrintName = "Управляющая компания жилья",
                     PrintValue = organization.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (serviceHouseHolders != null)
         {
             foreach (Organization organization2 in serviceHouseHolders)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "serviceHouseHolderId",
                     Value = ((long) organization2.Id).ToString(),
                     PrintName = "Управляющая компания услуги",
                     PrintValue = organization2.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (accountHouseHolders != null)
         {
             foreach (Organization organization3 in accountHouseHolders)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "accountHouseHolderId",
                     Value = ((long) organization3.Id).ToString(),
                     PrintName = "Управляющая компания ЛС",
                     PrintValue = organization3.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (serviceProviders != null)
         {
             foreach (Organization organization4 in serviceProviders)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "serviceProviderId",
                     Value = ((long) organization4.Id).ToString(),
                     PrintName = "Поставщик",
                     PrintValue = organization4.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (resourceProviders != null)
         {
             foreach (Organization organization5 in resourceProviders)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "resourceProviderId",
                     Value = ((long) organization5.Id).ToString(),
                     PrintName = "Ресурсоснабжающая организация",
                     PrintValue = organization5.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (cashlessTransferrers != null)
         {
             foreach (Organization organization6 in cashlessTransferrers)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "cashlessTransferrerId",
                     Value = ((long) organization6.Id).ToString(),
                     PrintName = "Организация по безналичным перечислениям",
                     PrintValue = organization6.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (serviceTypes != null)
         {
             foreach (ServiceTypeOld old in serviceTypes)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "serviceTypeId",
                     Value = ((long) old.Id).ToString(),
                     PrintName = "Группа услуг",
                     PrintValue = old.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (canonicalServices != null)
         {
             foreach (CanonicalService service in canonicalServices)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "canonicalId",
                     Value = ((long) service.Id).ToString(),
                     PrintName = "Вид благоустройства",
                     PrintValue = service.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (services != null)
         {
             foreach (ServiceOld old2 in services)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "serviceId",
                     Value = ((long) old2.Id).ToString(),
                     PrintName = "Услуга",
                     PrintValue = old2.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (fasetItemApartmentTypes != null)
         {
             foreach (FasetItem item in fasetItemApartmentTypes)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "fasetItemApartmentTypeId",
                     Value = ((int) item.Id).ToString(),
                     PrintName = "Тип жилья",
                     PrintValue = item.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (fasetItemHouseTypes != null)
         {
             foreach (FasetItem item2 in fasetItemHouseTypes)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "fasetItemHouseTypeId",
                     Value = ((int) item2.Id).ToString(),
                     PrintName = "Тип дома",
                     PrintValue = item2.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (fasetItemConvenienceTypes != null)
         {
             foreach (FasetItem item3 in fasetItemConvenienceTypes)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "convenienceTypeId",
                     Value = ((int) item3.Id).ToString(),
                     PrintName = "Тип благоустройства",
                     PrintValue = item3.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (fasetItemRecalcReasons != null)
         {
             foreach (FasetItem item4 in fasetItemRecalcReasons)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "typeReasonRecalcId",
                     Value = ((int) item4.Id).ToString(),
                     PrintName = "Причина перерасчёта",
                     PrintValue = item4.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if ((localAddresses != null) && (localAddresses.get_Count() != 0))
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "areaId",
                 Value = ((long) Area.GetAreaIdByLocalAddresses(localAddresses)).ToString()
             };
             if (selectedByUserArea == Area.Null)
             {
                 parameter.Value = ((long) Area.GetAreaIdByLocalAddresses(localAddresses)).ToString();
             }
             else
             {
                 parameter.Value = ((long) selectedByUserArea.Id).ToString();
             }
             parameter.SaveChanges();
         }
         if (benefits != null)
         {
             foreach (Benefit benefit in benefits)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "benefitId",
                     Value = ((long) benefit.Id).ToString(),
                     PrintName = "Льгота",
                     PrintValue = benefit.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         if (isDebt)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "isDebt",
                 Value = "1",
                 PrintName = "Разделение долгов",
                 PrintValue = "учтено"
             };
             parameter.SaveChanges();
         }
         if (existsBenefitDiff)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "isExistsBenefitDiff",
                 Value = "1",
                 PrintName = "Расхождения с КСЗН",
                 PrintValue = "учтены"
             };
             parameter.SaveChanges();
         }
         if (fasetFilterItems != null)
         {
             foreach (FasetItem item5 in fasetFilterItems)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "fasetFilterItemId",
                     Value = ((int) item5.Id).ToString(),
                     PrintName = item5.Faset.Name,
                     PrintValue = item5.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (paymentAgents != null)
         {
             foreach (Organization organization7 in paymentAgents)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "paymentAgentId",
                     Value = ((long) organization7.Id).ToString(),
                     PrintName = "Платежный агент",
                     PrintValue = organization7.ShortName
                 };
                 parameter.SaveChanges();
             }
         }
         RepReportTemplate template = RepReportTemplate.FindById(((RepReportTemplate) this.reportsTree.SelectedNode.get_Tag()).Id);
         if (template.MinSumm)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "minSumm",
                 Value = this.numMinSumm.Value.ToString(),
                 PrintName = "Минимальная сумма",
                 PrintValue = ((long) minSumm).ToString()
             };
             parameter.SaveChanges();
         }
         if (template.DatePeriod)
         {
             if (fromDay != AIS.SN.Model.Constants.NullDate)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "fromDay",
                     Value = fromDay.ToShortDateString(),
                     PrintName = "Дата начала",
                     PrintValue = fromDay.ToShortDateString()
                 };
                 parameter.SaveChanges();
             }
             if (toDay != AIS.SN.Model.Constants.NullDate)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "toDay",
                     Value = toDay.ToShortDateString(),
                     PrintName = "Дата окончания",
                     PrintValue = toDay.ToShortDateString()
                 };
                 parameter.SaveChanges();
             }
         }
         if (template.CalcOperationGroups)
         {
             CalcOperationGroup group = ((CalcOperationGroup) this.bsCalcOperationGroups.get_Current()) ?? CalcOperationGroup.Null;
             if (group != CalcOperationGroup.Null)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "calcOperGroupId",
                     Value = ((long) group.Id).ToString(),
                     PrintName = "Тип оплаты",
                     PrintValue = group.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (paymentType != string.Empty)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "paymentType",
                 Value = paymentType,
                 PrintName = "Тип оплаты",
                 PrintValue = paymentType
             };
             parameter.SaveChanges();
         }
         if (apartamentArea != string.Empty)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "apartamentArea",
                 Value = apartamentArea,
                 PrintName = "Площадь",
                 PrintValue = apartamentArea
             };
             parameter.SaveChanges();
         }
         if (template.PaymentAgentTypes)
         {
             FasetItem selectedFasetItem = this.selectPaymentAgentTypes.SelectedFasetItem;
             if (selectedFasetItem != FasetItem.Null)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "paymentAgentTypeId",
                     Value = ((int) selectedFasetItem.Id).ToString(),
                     PrintName = "Режим работы",
                     PrintValue = selectedFasetItem.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (withoutBankrupt)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "withoutBankrupt",
                 Value = "1",
                 PrintName = "Организации-банкроты",
                 PrintValue = "Не учитывать"
             };
             parameter.SaveChanges();
         }
         if (withoutClosesApartments)
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "withoutClosesApartments",
                 Value = "1",
                 PrintName = "Закрытые паспорта жилья",
                 PrintValue = "Не учитывать"
             };
             parameter.SaveChanges();
         }
         if (template.AccountProperty)
         {
             FasetItem item7 = this.selectAccountPropertyFaset.SelectedFasetItem;
             if (item7 != FasetItem.Null)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "accountPropertyId",
                     Value = ((int) item7.Id).ToString(),
                     PrintName = "Параметры ЛС",
                     PrintValue = item7.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (template.AccountProperty)
         {
             FasetItem item8 = this.selectAccountPropertyFaset.SelectedFasetItem;
             if (item8 != FasetItem.Null)
             {
                 parameter = new RepReportShedulerParameter {
                     ReportId = reportId,
                     Name = "accountPropertyId",
                     Value = ((int) item8.Id).ToString(),
                     PrintName = "Параметры ЛС",
                     PrintValue = item8.Name
                 };
                 parameter.SaveChanges();
             }
         }
         if (template.CityBorough && (cityBoroughs != FasetItem.Null))
         {
             parameter = new RepReportShedulerParameter {
                 ReportId = reportId,
                 Name = "boroughId",
                 Value = ((int) cityBoroughs.Id).ToString(),
                 PrintName = "Район города",
                 PrintValue = cityBoroughs.Name
             };
             parameter.SaveChanges();
         }
         if (!string.IsNullOrEmpty(textParameter))
         {
             new RepReportShedulerParameter { ReportId = reportId, Name = "textParameter", Value = textParameter, PrintName = template.TextParameter, PrintValue = textParameter }.SaveChanges();
         }
     }
 }
Example #27
0
 private void CashPaymentForm_Load(object sender, System.EventArgs e)
 {
     if (!Manager.DesignMode)
     {
         ObjectList<DebtAction> list = new ObjectList<DebtAction>();
         list = Mappers.DebtActionMapper.FindByAccountId(this.m_Account.Id);
         if (list.get_Count() > 0)
         {
             ObjectList<DebtAction> list2 = new ObjectList<DebtAction> {
                 DebtAction.Null
             };
             list2.AddRange(list);
             this.cbActions.set_DataSource(list2);
         }
         else
         {
             this.tableLayoutPanel1.Controls.Remove(this.cbActions);
             this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, (int) (this.tableLayoutPanel1.GetRowSpan(this.dataGridView1) + 1));
         }
         if (User.IsMemberOf(RightsEnum.АРМКассирОплатаВозможностьУстанавливатьДатуОплаты))
         {
             this.tpDatePayment.set_Enabled(true);
         }
         else
         {
             this.tpDatePayment.set_Enabled(false);
         }
         base.SuspendLayout();
         this.set_Font(Manager.WindowFont);
         this.m_PeriodsSource.set_DataSource(Mappers.CalcPeriodMapper.FindAll());
         this.m_PeriodsSource.set_Position(1);
         ObjectList<Organization> serviceHouseHolders = this.m_Account.GetServiceHouseHolders();
         serviceHouseHolders.Insert(0, Organization.Null);
         this.m_HouseHoldersSource.set_DataSource(serviceHouseHolders);
         this.m_HouseHoldersSource.set_Position(this.m_HouseHoldersSource.IndexOf(Organization.Null));
         this.m_Request = new PayRequest();
         this.m_Request.PaymentSystem = PayRequest.LocalPaymentSystem;
         this.m_Request.Organization = Constants.OrgName;
         this.m_Request.Office = "";
         this.m_Request.Terminal = Settings.Default.CashierTerminal;
         this.m_Request.Operator = User.CurrentUser.Name;
         this.m_Request.AccountNumber = this.m_Account.Number;
         this.m_Request.IsManualReturn = Settings.Default.CashierReturnMode;
         this.m_Request.CashFlowTypeId = Settings.Default.CashierCashFlowType;
         if (this.m_BarCode != string.Empty)
         {
             this.m_Request.IsByNotice = true;
             this.m_PayRequestCounters.set_DataSource(this.m_Request.GetRequestCounters());
         }
         else
         {
             this.tab.TabPages.Remove(this.tpCounters);
         }
         this.m_Request.UseBankrupt = this.chbxUseAccountServiceBankrupts.get_Checked();
         this.m_Request.NeedServiceCollapse = Settings.Default.NeedServiceCollapse;
         this.m_Request.PaymentDate = this.m_PaymentDate;
         this.m_Request.UsePaymentDate = Settings.Default.UsePaymentOrderDateForProcessPayment;
         this.m_Request.CashPaymentOrderType = this.m_CashPaymentOrderType;
         this.m_Request.SubService = this.m_subService;
         this.m_Request.PaymentOrderPackId = this.m_PaymentOrderPackId;
         this.m_Request.SaveChanges();
         this.MakeRequest();
         if (Settings.Default.CashierReturnMode)
         {
             this.m_PaymentButton.set_ForeColor(System.Drawing.Color.Red);
             this.m_PaymentButton.set_Font(new System.Drawing.Font(this.m_PaymentButton.Font, System.Drawing.FontStyle.Bold));
             this.m_PaymentButton.set_Text("&ВОЗВРАТ");
             this.m_OneSummPaymentCheckBox.set_Text("Возвращается");
         }
         this.selectDataGridViewTextBoxColumn.set_Visible(Settings.Default.CachierCanExcludeServiceFromPayment);
         if (Setting.GetValueByName("Интерфейсы", "АРМ Кассир. Учитывать невозвратные долги по умолчанию").ToUpper() != "ДА")
         {
             this.chbxUseAccountServiceBankrupts.set_Checked(false);
         }
         base.ResumeLayout();
     }
 }
Example #28
0
 private void tsbPrepare_Click(object sender, System.EventArgs e)
 {
     ObjectList<PayReester> reestersList = new ObjectList<PayReester>();
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvIncludedReesters.Rows)
     {
         if ((bool) (row.Cells.get_Item("IsBound") as System.Windows.Forms.DataGridViewCheckBoxCell).get_Value())
         {
             reestersList.Add(row.get_DataBoundItem() as PayReester);
         }
     }
     if (reestersList.get_Count() != 0)
     {
         new PayReestersForm(reestersList).ShowDialog();
     }
     else
     {
         Messages.ShowMessage("Не выбрано ни одного реестра");
     }
 }
 public bool SaveChange()
 {
     ObjectList<ApartmentTypeAddress> olata = new ObjectList<ApartmentTypeAddress>();
     if (this.mHouseId != 0L)
     {
         foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvApartmentTypeAddress.Rows)
         {
             if ((row.Cells.get_Item("isSelected").get_Value() != null) && (row.Cells.get_Item("isSelected").get_Value().ToString() == "True"))
             {
                 if (row.Cells.get_Item("dataNewApartmentType").get_Value() == null)
                 {
                     System.Windows.Forms.MessageBox.Show("Не у всех выбранных квартир проставлена дата начала действия", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK);
                     return false;
                 }
                 if (row.Cells.get_Item("selectCanonicalType").get_Value().ToString() == "<не выбрано>")
                 {
                     System.Windows.Forms.MessageBox.Show("Не у всех выбранных квартир проставлен тип благоустройства", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK);
                     return false;
                 }
                 ApartmentTypeAddress address = new ApartmentTypeAddress {
                     AdrName = row.Cells.get_Item("adrNameDataGridViewTextBoxColumn").get_Value().ToString(),
                     ApartmentId = (long) ((long) row.Cells.get_Item("ApartmentId").get_Value()),
                     FasetId = (short) ((short) row.Cells.get_Item("FasetId").get_Value()),
                     FasetItemName = row.Cells.get_Item("selectCanonicalType").get_Value().ToString(),
                     FromDate = System.DateTime.Parse(row.Cells.get_Item("dataNewApartmentType").get_Value().ToString())
                 };
                 olata.Add(address);
             }
         }
         if (olata.get_Count() > 0)
         {
             Mappers.ApartmentTypeAddressMapper.InsertNewApartmentCanonicalType(olata, this.mTypeId);
             this.UpdateTable(this.mHouseId, this.mTypeId, this.mFasetItemId);
             foreach (System.Windows.Forms.DataGridViewRow row2 in (System.Collections.IEnumerable) this.dgvApartmentTypeAddress.Rows)
             {
                 row2.Cells.get_Item("dataNewApartmentType").set_Value(null);
             }
         }
         this.Clear();
         return true;
     }
     foreach (System.Windows.Forms.DataGridViewRow row3 in (System.Collections.IEnumerable) this.dgvApartmentTypeAddress.Rows)
     {
         if ((row3.Cells.get_Item("isSelected").get_Value() != null) && (row3.Cells.get_Item("isSelected").get_Value().ToString() == "True"))
         {
             if (row3.Cells.get_Item("dataNewApartmentType").get_Value() == null)
             {
                 System.Windows.Forms.MessageBox.Show("Не у всех выбранных квартир проставлена дата начала действия", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK);
                 return false;
             }
             if (row3.Cells.get_Item("selectCanonicalType").get_Value().ToString() == "<не выбрано>")
             {
                 System.Windows.Forms.MessageBox.Show("Не у всех выбранных квартир проставлен тип благоустройства", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK);
                 return false;
             }
             ApartmentTypeAddress address2 = new ApartmentTypeAddress {
                 AdrName = row3.Cells.get_Item("adrNameDataGridViewTextBoxColumn").get_Value().ToString(),
                 ApartmentId = (long) ((long) row3.Cells.get_Item("ApartmentId").get_Value()),
                 FasetId = (short) ((short) row3.Cells.get_Item("FasetId").get_Value()),
                 FasetItemName = row3.Cells.get_Item("selectCanonicalType").get_Value().ToString(),
                 FromDate = System.DateTime.Parse(row3.Cells.get_Item("dataNewApartmentType").get_Value().ToString())
             };
             olata.Add(address2);
         }
     }
     if (olata.get_Count() > 0)
     {
         Mappers.ApartmentTypeAddressMapper.InsertNewApartmentType(olata);
         this.Clear();
     }
     return true;
 }