protected override System.Data.DataSet MakeDataSource(DoWorkEventArgs e) { if (base.m_Period.DateEndIsNull || base.m_Period.DateBeginIsNull) { Messages.ShowMessage("Заполните период"); return null; } Area area = new Area(); if (this.groupAdressesView.GetSelectedAddresses().get_Count() != 0) { area.SaveChanges(); area.SaveAddresses(this.groupAdressesView.GetSelectedAddresses()); area.SaveChanges(); } ObjectList<Organization> selectedOrganizations = this.selectOrgs1.SelectedOrganizations; ObjectList<ServiceTypeOld> serviceTypes = this.selectServiceTypes1.ServiceTypes; System.DateTime fromPeriod = base.m_Period.DateBeginIsNull ? Constants.NullDate : base.m_Period.DateBegin; System.DateTime toPeriod = base.m_Period.DateEndIsNull ? Constants.NullDate : base.m_Period.DateEnd; if ((fromPeriod == Constants.MinDate) || (toPeriod == Constants.MinDate)) { Messages.ShowMessage("Не заданы даты!"); return null; } System.Data.DataSet set = Mappers.SimpleReportMapper.GetJnReportByChargeVacations(area.Id, selectedOrganizations, serviceTypes, fromPeriod, toPeriod); set.Tables.get_Item(0).set_TableName("tuning"); set.Tables.get_Item(1).set_TableName("crit"); set.Tables.get_Item(2).set_TableName("data"); area.DeleteWithRelations(); return set; }
public void AddGroupOrSets(AreaGroup groupSets, ObjectList<Area> area) { foreach (Area area2 in area) { Area area3 = new Area(); AreaGroup group = groupSets; area3.Name = area2.Name; if ((groupSets != null) && (groupSets.Id != -1L)) { area3.AreaGroupId = group.Id; } try { area3.SaveChanges(); area3.SaveAddresses(area2.GetAddresses()); } catch (System.Exception exception) { Messages.ShowException(this, exception); break; } if ((area2 != null) && (area2.Id != -1L)) { this.SetAreas(group.GetAreas()); } } }
protected override System.Data.DataSet MakeDataSource(DoWorkEventArgs e) { System.DateTime fromDate = base.m_Period.DateBeginIsNull ? Constants.NullDate : base.m_Period.DateBegin; System.DateTime toDate = base.m_Period.DateEndIsNull ? Constants.NullDate : base.m_Period.DateEnd; Area area = new Area(); if (this.groupAdressesView.GetSelectedAddresses().get_Count() != 0) { area.SaveChanges(); area.SaveAddresses(this.groupAdressesView.GetSelectedAddresses()); } ObjectList<Organization> selectedOrganizations = this.selectHolders.SelectedOrganizations; return Mappers.SimpleReportMapper.GetResidentVacationsReport(fromDate, toDate, this.vacationType, selectedOrganizations, area); }
private void btnFind_Click(object sender, System.EventArgs e) { if (!this.workerFind.get_IsBusy()) { Organization organization = this.selectOrg.SelectedOrganizationOld ?? Organization.Null; Organization selectedOrganization = new Organization(); selectedOrganization = this.selectHouseHolder.SelectedOrganization; CanonicalService service = new CanonicalService(); service = (CanonicalService) this.cbCanonicalService.get_SelectedItem(); ServiceTypeOld old = ((ServiceTypeOld) this.bsServiceTypes.get_Current()) ?? ServiceTypeOld.Null; ObjectList<LocalAddress> localAddresses = this.selectAddresses.GetLocalAddresses(); Area @null = new Area(); if (localAddresses.get_Count() == 0) { @null = Area.Null; } else { @null.SaveChanges(); @null.SaveAddresses(localAddresses); } this.m_workerFind_area = @null; this.m_workerFind_org = organization; this.m_workerFind_hh = selectedOrganization; this.m_workerFind_st = old; this.m_workerFind_cs = service; this.btnFind.set_Image(Resources.LOADING); this.workerFind.RunWorkerAsync(this.workerFind); } }
private void btnSave_Click(object sender, System.EventArgs e) { ServiceTypeSubQualityPercent percent = (this.bsServiceTypeSuspensionTypePercent.get_Current() as ServiceTypeSubQualityPercent) ?? ServiceTypeSubQualityPercent.Null; ServiceTypeSubQualityAcceptableDuration duration = (this.bsServiceTypeSuspensionTypeAcceptableDurations.get_Current() as ServiceTypeSubQualityAcceptableDuration) ?? ServiceTypeSubQualityAcceptableDuration.Null; OrgDocument doc = this.selectOrgDocument.SelectedOrgDocument ?? OrgDocument.Null; ObjectList<LocalAddress> addresses = new ObjectList<LocalAddress>(); string text = string.Empty; if (this.m_AccountServiceSubQuality == AccountServiceSubQuality.Null) { addresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); } if (percent == ServiceTypeSubQualityPercent.Null) { text = text + "Выберите процент снятия" + System.Environment.get_NewLine(); } if ((duration == ServiceTypeSubQualityAcceptableDuration.Null) && this.cbxServiceTypeSuspensionTypeAcceptableDurations.get_Enabled()) { text = text + "Выберите нормативные параметры" + System.Environment.get_NewLine(); } if (doc == OrgDocument.Null) { text = text + "Выберите документ" + System.Environment.get_NewLine(); } if (!this.dateTimePeriod.IsInsideOnePeriod()) { text = text + "Даты периода недопоставки должны лежать в одном месяце" + System.Environment.get_NewLine(); } if (text != string.Empty) { BalloonWindow.Show(this.btnSave, text); } else { this.m_AccountServiceSubQuality.StsqpId = percent.Id; if (this.cbxServiceTypeSuspensionTypeAcceptableDurations.get_Enabled()) { this.m_AccountServiceSubQuality.StsqadId = duration.Id; } this.m_AccountServiceSubQuality.PressureDeviation = this.numPressureDeviation.Value; this.m_AccountServiceSubQuality.SquareRooms = this.numSquareRooms.Value; this.m_AccountServiceSubQuality.DayTemperature = this.numDayTemperature.Value; this.m_AccountServiceSubQuality.NightTemperature = this.numNightTemperature.Value; this.m_AccountServiceSubQuality.FromDate = this.dateTimePeriod.TimeBegin; this.m_AccountServiceSubQuality.ToDate = this.dateTimePeriod.TimeEnd; this.m_AccountServiceSubQuality.ExceptAcceptableDuration = this.chbxExeptAcceptableDuration.get_Checked(); this.m_AccountServiceSubQuality.ReasonId = this.sfdReasons.SelectedFasetItem.Id; if ((this.m_AccountServiceSubQuality != AccountServiceSubQuality.Null) && !this.m_AccountServiceSubQuality.IsNew) { this.m_AccountServiceSubQuality.StsqpId = percent.Id; this.m_AccountServiceSubQuality.SaveChanges(); if (this.OnAddAccountServiceSubQuality != null) { this.OnAddAccountServiceSubQuality(); } } else { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(addresses); GroupOperation.AddAccountServiceSubQualities(area, this.m_AccountServiceSubQuality, doc, this.chbxRunRecalc.get_Checked()); area.DeleteWithRelations(); if (this.OnAddAccountServiceSubQuality != null) { this.OnAddAccountServiceSubQuality(); } else { Messages.ShowMessage("Операция выполнена"); } } } }
private void bSave_Click(object sender, System.EventArgs e) { ObjectList<LocalAddress> selectedAddresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); if (selectedAddresses.get_Count() <= 0) { Messages.ShowWarning("Не выбраны адреса. Групповая операция не будет выполнена."); } else { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(selectedAddresses); if (this.selectOrgsHouseHolder.SelectedOrganizations != null) { if (this.dbFromDateHH.Value == Constants.NullDate) { BalloonWindow.Show(this.dbFromDateHH, "Укажите дату начала срока действия"); return; } if ((this.dbToDateHH.Value != Constants.NullDate) && (this.dbToDateHH.Value <= this.dbFromDateHH.Value)) { BalloonWindow.Show(this.dbToDateHH, "Дата начала срока действия должна быть раньше даты окончания срока действия"); return; } } if (this.selectOrganizationServiceProviders.SelectedOrganization != Organization.Null) { if (this.selectServiceTypesServiceProviders.ServiceTypes.get_Count() <= 0) { BalloonWindow.Show(this.selectServiceTypesServiceProviders, "Выберите тип услуг"); return; } if (this.dbFromDateSP.Value == Constants.NullDate) { BalloonWindow.Show(this.dbFromDateSP, "Укажите дату начала срока действия"); return; } if ((this.dbToDateSP.Value != Constants.NullDate) && (this.dbToDateSP.Value <= this.dbFromDateSP.Value)) { BalloonWindow.Show(this.dbToDateSP, "Дата начала срока действия должна быть раньше даты окончания срока действия"); return; } } if (this.selectOrganizationResourceProvider.SelectedOrganization != Organization.Null) { if (this.selectServiceTypesResourceProvider.ServiceTypes.get_Count() <= 0) { BalloonWindow.Show(this.selectServiceTypesResourceProvider, "Выберите тип услуг"); return; } if (this.dbFromDateRP.Value == Constants.NullDate) { BalloonWindow.Show(this.dbFromDateRP, "Укажите дату начала срока действия"); return; } if ((this.dbToDateRP.Value != Constants.NullDate) && (this.dbToDateRP.Value <= this.dbFromDateRP.Value)) { BalloonWindow.Show(this.dbToDateRP, "Дата начала срока действия должна быть раньше даты окончания срока действия"); return; } } bool flag = false; if (this.selectOrgsHouseHolder.SelectedOrganizations != null) { GroupOperation.AddHouseHouseHolder(area, this.selectOrgsHouseHolder.SelectedOrganizations, this.dbFromDateHH.Value, this.dbToDateHH.Value); flag = true; } if (this.selectOrganizationServiceProviders.SelectedOrganization != Organization.Null) { GroupOperation.AddHouseServiceProviders(area, this.selectOrganizationServiceProviders.SelectedOrganization, this.selectServiceTypesServiceProviders.ServiceTypes, this.dbFromDateSP.Value, this.dbToDateSP.Value); flag = true; } if (this.selectOrganizationResourceProvider.SelectedOrganization != Organization.Null) { GroupOperation.AddHouseResourceProviders(area, this.selectOrganizationResourceProvider.SelectedOrganization, this.selectServiceTypesResourceProvider.ServiceTypes, this.dbFromDateRP.Value, this.dbToDateRP.Value); flag = true; } area.DeleteWithRelations(); if (flag) { Messages.ShowMessage("Групповая операция успешно выполнена"); } else { Messages.ShowMessage("Уточните параметры групповой операции"); } } }
private void btnComprasion_Click(object sender, System.EventArgs e) { if (!this.workerCompareServices.get_IsBusy()) { if (!this.isChangeParametrChangeHouseHolder && (Messages.QuestionYesNo(this, "Выполнить заново сопоставление?") != System.Windows.Forms.DialogResult.Yes)) { this.tabctrlWizard.set_SelectedTab(this.tpLinking); } else { Organization organization = (Organization) this.bsOldHouseHolders.get_Current(); Organization organization2 = (Organization) this.bsNewHouseHolders.get_Current(); ObjectList<LocalAddress> selectedAddresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); string text = string.Empty; if ((organization == Organization.Null) || (organization == null)) { text = text + "Выберите старую управляющую компанию" + System.Environment.get_NewLine(); } if ((organization2 == Organization.Null) || (organization2 == null)) { text = text + "Выберите новую управляющую компанию" + System.Environment.get_NewLine(); } if ((((organization != null) && (organization2 != null)) && ((organization != Organization.Null) && (organization2 != Organization.Null))) && (organization.Id == organization2.Id)) { text = text + "Выберите разные управляющие компании" + System.Environment.get_NewLine(); } if (this.dbFromDate.IsNull) { text = text + "Введите дату смены управляющей компании" + System.Environment.get_NewLine(); } if (this.tbAccountNumberSufix.get_Text().Trim() == string.Empty) { text = text + "Введите символ для номера ЛС" + System.Environment.get_NewLine(); } if (text != string.Empty) { BalloonWindow.Show(this.btnComprasion, text); } else if ((selectedAddresses.get_Count() != 0) || (Messages.QuestionYesNo(this, "Вы не выбрали адреса!\nОперация будет произведена для всего адресного плана.\nВы уверены, что хотите продолжить?") == System.Windows.Forms.DialogResult.Yes)) { this.bsOldServices.Clear(); this.bsNewServices.Clear(); this.dgvServicesComparison.set_DataSource(null); Area area = new Area(); area.SaveChanges(); area.SaveAddresses(selectedAddresses); this.m_addresses = new ObjectList<LocalAddress>(selectedAddresses); object[] objArray = new object[] { area, organization, organization2 }; this.workerCompareServices.RunWorkerAsync(objArray); this.btnComprasion.set_Image(Resources.LOADING); } } } }
private void btnRun_Click(object sender, System.EventArgs e) { ObjectList<ServiceOld> selectedServices = this.vwServiceSearch.SelectedServices; ObjectList<LocalAddress> selectedAddresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); string text = string.Empty; if (selectedServices.get_Count() == 0) { text = text + "Выберите одну или более услуг, которые нужно заменить" + System.Environment.get_NewLine(); } Service service = ((Service) this.bsServices.get_Current()) ?? Service.Null; if (service == Service.Null) { text = text + "Выберите услугу, на которую нужно заменить" + System.Environment.get_NewLine(); } if (text != string.Empty) { BalloonWindow.Show(this.btnRun, text); } else { Area @null; if (selectedAddresses.get_Count() == 0) { if (Messages.QuestionYesNo(this, "Вы не выбрали адреса.\nВы уверены что хотите продолжить?") != System.Windows.Forms.DialogResult.Yes) { return; } @null = Area.Null; } else { @null = new Area(); @null.SaveChanges(); @null.SaveAddresses(selectedAddresses); } if (Messages.QuestionYesNo(this, "Откат данной операции невозможен, предусмотрительнее сделать перед выполнением операции копию базы, продолжить выполнение?") != System.Windows.Forms.DialogResult.Yes) { @null.DeleteWithRelations(); } else { GroupOperation.ReplaceAccountServices(selectedServices, @null, service); Messages.ShowMessage("Замена услуг выполнена!"); @null.DeleteWithRelations(); } } }
private void btnChangeService_Click(object sender, System.EventArgs e) { string text = string.Empty; ObjectList<ServiceOld> selectedServices = this.vwServiceSearch.SelectedServices; if (selectedServices.get_Count() == 0) { text = text + "Выберите услуги" + System.Environment.get_NewLine(); } if (this.selectServices.SelectedServices.get_Count() == 0) { text = text + "Выберите услугу открытия" + System.Environment.get_NewLine(); } ServiceOld old = new ServiceOld(); if (this.selectServices.SelectedServices.get_Count() != 0) { old = this.selectServices.SelectedServices.get_Item(0); } ObjectList<LocalAddress> selectedAddresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); OrgDocument selectedOrgDocument = this.selectOrgDocument.SelectedOrgDocument; if (this.dbxOpenDate.IsNull) { text = text + "Введите дату открытия" + System.Environment.get_NewLine(); } if (this.dbxCloseDate.IsNull) { text = text + "Введите дату закрытия" + System.Environment.get_NewLine(); } if ((!this.dbxOpenDate.IsNull && !this.dbxCloseDate.IsNull) && (this.dbxOpenDate.Value < this.dbxCloseDate.Value.AddDays((double) 1.0))) { text = text + "Дата открытия должна быть не раньше чем следующий день после даты закрытия" + System.Environment.get_NewLine(); } if (text != string.Empty) { BalloonWindow.Show(this.btnChangeService, text); } else { string str2 = string.Empty; if (selectedAddresses.get_Count() == 0) { str2 = str2 + "Вы не выбрали адреса!\nОперация будет произведена для всего адресного плана.\n"; } if (this.dbxOpenDate.Value != this.dbxCloseDate.Value.AddDays((double) 1.0)) { str2 = str2 + "Указанная дата открытия более чем на один день позже, чем дата закрытия.\n"; } if ((str2 == string.Empty) || (Messages.QuestionYesNo(this, str2 + "Вы уверены, что хотите продолжить?") == System.Windows.Forms.DialogResult.Yes)) { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(selectedAddresses); string str3 = GroupOperation.CheckAccountJointServices(area.Id, selectedServices); if (str3 != string.Empty) { Messages.ShowMessage("Операция не может быть проведена,т.к. на перечисленных ниже адресах открыто более одной из выбранных услуг: " + str3); area.DeleteWithRelations(); } else if (Messages.QuestionYesNo(this, "Все выбранные услуги будут сменены на выбранную,операция необратима,продолжить?") == System.Windows.Forms.DialogResult.Yes) { bool avanceTransfer = this.cbAdvancesMove.get_Checked() ? ((bool) true) : ((bool) false); bool debtTransfer = this.chDebtTransfer.get_Checked() ? ((bool) true) : ((bool) false); bool opServicesTransfer = this.chOpServicesTransfer.get_Checked() ? ((bool) true) : ((bool) false); bool connectionCounter = this.chConnectionCounter.get_Checked() ? ((bool) true) : ((bool) false); bool connectionEquipment = this.chConnectionEquipment.get_Checked() ? ((bool) true) : ((bool) false); Organization organization = this.selectHouseHolder.SelectedOrganizationOld ?? Organization.Null; Organization organization2 = this.selectAccountHouseHolder.SelectedOrganizationOld ?? Organization.Null; foreach (ServiceOld old2 in selectedServices) { int? selectedEnumValue = this.enumDebt.SelectedEnumValue; int? nullable2 = this.enumAvance.SelectedEnumValue; GroupOperation.CloseOpenAccountService(old2.Id, old.Id, this.dbxCloseDate.Value, this.dbxOpenDate.Value, avanceTransfer, debtTransfer, selectedOrgDocument, selectedAddresses, organization.Id, organization2.Id, !this.cbxIsCharge.get_Checked(), opServicesTransfer, connectionCounter, connectionEquipment, true, true, selectedEnumValue.get_HasValue() ? selectedEnumValue.GetValueOrDefault() : ((int) 0), nullable2.get_HasValue() ? nullable2.GetValueOrDefault() : ((int) 0)); } Messages.ShowMessage("Групповая операция по смене услуги выполнена"); } } } }
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; }
private void btnBalanceCancellation_Click(object sender, System.EventArgs e) { if (!this.cbOpen.get_Checked() && !this.cbClose.get_Checked()) { Messages.ShowWarning("Выберите на закрытых и/или открытых паспортах жилья проводится операция"); } else { string text = string.Empty; ObjectList<ServiceOld> selectedServices = this.vwServiceSearch.SelectedServices; if (selectedServices.get_Count() == 0) { text = text + "Выберите услуги" + System.Environment.get_NewLine(); } if (this.dbxDateCancel.IsNull) { text = text + "Введите дату списания" + System.Environment.get_NewLine(); } if (!this.cbCancelAvans.get_Checked() && !this.cbCancelDebt.get_Checked()) { text = text + "Выберите операцию по списанию" + System.Environment.get_NewLine(); } ObjectList<LocalAddress> selectedAddresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); if (text != string.Empty) { BalloonWindow.Show(this.btnBalanceCancellation, text); } else { Area @null; if (selectedAddresses.get_Count() == 0) { if (Messages.QuestionYesNo(this, "Вы не выбрали адреса! \nОперация будет произведена для всего адресного плана.\nВы уверены что хотите продолжить?") != System.Windows.Forms.DialogResult.Yes) { return; } @null = Area.Null; } else { @null = new Area(); @null.SaveChanges(); @null.SaveAddresses(selectedAddresses); } bool cancelAvans = this.cbCancelAvans.get_Checked() ? ((bool) true) : ((bool) false); bool cancelDebt = this.cbCancelDebt.get_Checked() ? ((bool) true) : ((bool) false); GroupOperation.BalanceCancellationAccountServices(selectedServices, @null, cancelDebt, cancelAvans, this.dbxDateCancel.Value, this.cbOpen.get_Checked(), this.cbClose.get_Checked()); Messages.ShowMessage("Групповая операция по списанию баланса выполнена"); } } }
private void btnChangeService_Click(object sender, System.EventArgs e) { string text = string.Empty; ObjectList<ServiceOld> selectedServices = this.vwServiceSearch.SelectedServices; if (selectedServices.get_Count() == 0) { text = text + "Выберите услуги" + System.Environment.get_NewLine(); } ServiceOld old = (ServiceOld) this.bsServiceOpen.get_Current(); ObjectList<LocalAddress> selectedAddresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); OrgDocument selectedOrgDocument = this.selectOrgDocument.SelectedOrgDocument; if ((old == ServiceOld.Null) || (old == null)) { text = text + "Выберите услугу открытия" + System.Environment.get_NewLine(); } if (this.dbxOpenDate.IsNull) { text = text + "Введите дату открытия" + System.Environment.get_NewLine(); } if (this.dbxCloseDate.IsNull) { text = text + "Введите дату закрытия" + System.Environment.get_NewLine(); } if ((!this.dbxOpenDate.IsNull && !this.dbxCloseDate.IsNull) && (this.dbxOpenDate.Value < this.dbxCloseDate.Value.AddDays((double) 1.0))) { text = text + "Дата открытия должна быть не раньше чем следующий день после даты закрытия" + System.Environment.get_NewLine(); } if (text != string.Empty) { BalloonWindow.Show(this.btnChangeService, text); } else { string str2 = string.Empty; if (selectedAddresses.get_Count() == 0) { str2 = str2 + "Вы не выбрали адреса!\nОперация будет произведена для всего адресного плана.\n"; } if (this.dbxOpenDate.Value != this.dbxCloseDate.Value.AddDays((double) 1.0)) { str2 = str2 + "Указанная дата открытия более чем на один день позже, чем дата закрытия.\n"; } if ((str2 == string.Empty) || (Messages.QuestionYesNo(this, str2 + "Вы уверены, что хотите продолжить?") == System.Windows.Forms.DialogResult.Yes)) { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(selectedAddresses); string str3 = GroupOperation.CheckAccountJointServices(area.Id, selectedServices); if (str3 != string.Empty) { Messages.ShowMessage("Операция не может быть проведена,т.к. на перечисленных ниже адресах открыто более одной из выбранных услуг: " + str3); area.DeleteWithRelations(); } else if (Messages.QuestionYesNo(this, "Все выбранные услуги будут сменены на выбранную,операция необратима,продолжить?") == System.Windows.Forms.DialogResult.Yes) { Messages.ShowMessage("Групповая операция по смене услуги выполнена"); } } } }
private void tsbGetCountersByOrganizations_Click(object sender, System.EventArgs e) { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(this.selectAddresses1.GetLocalAddresses()); area.SaveChanges(); ApartmentCounter counter = new ApartmentCounter(); if (this.selectOrganization1.SelectedOrganizationOld != null) { this.bsApartmentCounter.SuspendBinding(); this.bsApartmentCounter.set_DataSource(counter.GetCountersByOrganizations(this.selectOrganization1.SelectedOrganizationOld.Id, area.Id)); this.bsApartmentCounter.ResumeBinding(); if (this.bsApartmentCounter.get_Count() == 0) { this.bsApartmentCounter_CurrentChanged(sender, e); } } else { this.bsApartmentCounter.set_DataSource(null); this.bsApartmentCounter_CurrentChanged(sender, e); System.Windows.Forms.MessageBox.Show("Необходимо выбрать адрес и организацию!"); } }
private void btnOK_Click(object sender, System.EventArgs e) { OrgDocument doc = this.selectOrgDocument.SelectedOrgDocument ?? OrgDocument.Null; string text = string.Empty; ServiceTypeOld sourceServiceType = ((ServiceTypeOld) this.bsSourceServiceTypes.get_Current()) ?? ServiceTypeOld.Null; ServiceTypeOld destServiceType = ((ServiceTypeOld) this.bsDestServiceTypes.get_Current()) ?? ServiceTypeOld.Null; if (sourceServiceType == ServiceTypeOld.Null) { text = text + "Выберите тип услуг, с которого нужно перенести средства" + System.Environment.get_NewLine(); } if (destServiceType == ServiceTypeOld.Null) { text = text + "Выберите тип услуг, на который нужно перенести средства" + System.Environment.get_NewLine(); } if (!this.chbxDebtTransfer.get_Checked() && !this.chbxAdvancesMove.get_Checked()) { text = text + "Выберите операцию"; } if (text != string.Empty) { BalloonWindow.Show(this.btnOK, text); } else if ((this.m_addresses.get_Count() != 0) || (Messages.QuestionYesNo(this, "Вы не выбрали адреса!\nОперация будет произведена для всего адресного плана.\nВы уверены, что хотите продолжить?") == System.Windows.Forms.DialogResult.Yes)) { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(this.m_addresses); if (!this.chbxUseOnlyOpenService.get_Checked()) { int? selectedEnumValue = this.enumDebt.SelectedEnumValue; int? nullable2 = this.enumAvance.SelectedEnumValue; GroupOperation.TransferAvanceAccountServicesByServiceTypes(area, doc, this.chbxAdvancesMove.get_Checked(), this.chbxDebtTransfer.get_Checked(), sourceServiceType, destServiceType, this.chbxWithBankrupt.get_Checked(), selectedEnumValue.get_HasValue() ? selectedEnumValue.GetValueOrDefault() : ((int) 0), nullable2.get_HasValue() ? nullable2.GetValueOrDefault() : ((int) 0)); } else { int? nullable3 = this.enumDebt.SelectedEnumValue; int? nullable4 = this.enumAvance.SelectedEnumValue; GroupOperation.TransferAvanceAccountServicesByServiceTypesUseOpenAccountService(area, doc, sourceServiceType, destServiceType, this.chbxAvanceTransferFull.get_Checked(), nullable3.get_HasValue() ? nullable3.GetValueOrDefault() : ((int) 0), nullable4.get_HasValue() ? nullable4.GetValueOrDefault() : ((int) 0)); } area.DeleteWithRelations(); Messages.ShowMessage("Выравнивание остатков выполнено"); } }
public ApartmentCounterAddLinkingForm(ApartmentCounter ac) : this() { this.set_Font(Manager.WindowFont); this.m_ApartmentCounter = ac; this.m_Apartment = ac.GetApartment(); this.selectAddresses1.OnAddressesSelected += new AddressesHandler(this.selectAddresses1_OnAddressesSelected); Area area = new Area { StatusTemporary = 1 }; area.SaveChanges(); area.SaveAddresses(this.m_Apartment.AdrId); this.selectAddresses1.SelectedArea = area; }
public static Area AddArea(ObjectWithNameDTO dto) { Area area = new Area(); area.SaveChanges(dto); return area; }
private void btnAddArea_Click(object sender, System.EventArgs e) { if (!this.bwLoadAddresses.get_IsBusy()) { EnterNameForm form = new EnterNameForm(); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { Area area = new Area(); AreaGroup group = (AreaGroup) this.listGroups.get_SelectedItem(); area.Name = form.EnteredName; if ((group != null) && (group.Id != -1L)) { area.AreaGroupId = ((AreaGroup) this.listGroups.get_SelectedItem()).Id; } try { area.SaveChanges(); } catch (System.Exception exception) { Messages.ShowException(this, exception); return; } if ((group != null) && (group.Id != -1L)) { this.SetAreas(group.GetAreas()); } else { this.SetAreas(Area.FindAllUserAndNotEmptyName()); } Messages.ShowMessage("Создан набор адресов \"" + area.Name + "\"."); } form.Dispose(); } }
private void btnGetServices_Click(object sender, System.EventArgs e) { System.DateTime date = this.dbxDate.IsNull ? Constants.NullDate : this.dbxDate.Value; Area @null = Area.Null; if ((this.Addresses != null) && (this.Addresses.get_Count() > 0)) { @null = new Area(); @null.SaveChanges(); @null.SaveAddresses(this.m_Addresses); } this.m_Services = (this.bsServices.get_DataSource() ?? new ObjectList<ServiceOld>()) as ObjectList<ServiceOld>; ServicesForm form = new ServicesForm(@null, date, this.m_Services, null, House.Null, System.DateTime.MinValue, System.DateTime.MaxValue) { IsMultiSelect = true }; form.ShowDialog(this); this.bsServices.set_DataSource(form.SelectedServices); @null.DeleteWithRelations(); this.cbAll.set_Checked(true); this.dgvServices_SelectedAllRows(); if (this.OnServicesSelected != null) { this.OnServicesSelected(form.SelectedServices); } }
private void btnReCalc_Click(object sender, System.EventArgs e) { ObjectList<ServiceOld> selectedServices = this.vwServiceSearch.SelectedServices; ObjectList<LocalAddress> selectedAddresses = ((OperationGroupForm) base.Parent.Parent.Parent.Parent.Parent).GetSelectedAddresses(); FasetItem selectedFasetItem = this.selectReCalc.SelectedFasetItem; OrgDocument selectedOrgDocument = this.selectOrgDocument.SelectedOrgDocument; System.Text.StringBuilder builder = new System.Text.StringBuilder(); if (this.datePeriod.DateBeginIsNull) { builder.AppendLine("Введите дату начала периода"); } if (this.datePeriod.DateEndIsNull) { builder.AppendLine("Введите дату конца периода"); } if ((selectedFasetItem == FasetItem.Null) || (selectedFasetItem == null)) { builder.AppendLine("Выберите причину перерасчета"); } if (builder.get_Length() != 0) { BalloonWindow.Show(this.btnReCalc, builder.ToString()); } else { Area @null; if (selectedAddresses.get_Count() == 0) { if (Messages.QuestionYesNo(this, "Вы не выбрали адреса. Перерасчёт без ограниения по адресу может занять продолжительное время.\nВы уверены что хотите продолжить?") != System.Windows.Forms.DialogResult.Yes) { return; } @null = Area.Null; } else { @null = new Area(); @null.SaveChanges(); @null.SaveAddresses(selectedAddresses); } if ((selectedServices.get_Count() != 0) || (Messages.QuestionYesNo(this, "Вы не выбрали услуги. Будет произведён перерасчёт по всем услугам, который может занять продолжительное время.\nВы уверены что хотите продолжить?") == System.Windows.Forms.DialogResult.Yes)) { bool isRecalc = true; if (this.rbCharge.get_Checked()) { isRecalc = false; } this.set_Cursor(System.Windows.Forms.Cursors.WaitCursor); try { GroupOperation.RecalcAccountServices(selectedServices, selectedFasetItem.Id, this.datePeriod.DateBegin, this.datePeriod.DateEnd, selectedOrgDocument, @null, this.chbxWithBankrupt.get_Checked(), isRecalc); } catch (System.Exception exception) { Messages.ShowException(this, exception); } finally { this.set_Cursor(System.Windows.Forms.Cursors.Default); } Messages.ShowMessage("Групповой перерасчет был выполнен для " + ((selectedServices.get_Count() == 0) ? ((string) " всех ") : ((int) selectedServices.get_Count()).ToString()) + " услуг!"); @null.DeleteWithRelations(); } } }
private void tsAddress_Click(object sender, System.EventArgs e) { AreaAddressesForm form; User user = ((User) this.bsUsers.get_Current()) ?? User.Null; Area area = new Area(); this.addresses = LocalAddress.GetByUserId(user); area.SaveChanges(); area.SaveAddresses(this.addresses); if (this.addresses.get_Count() == 0) { form = new AreaAddressesForm(this.addressesSource, this.addressesDest); } else { form = new AreaAddressesForm(area); } if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.addressesDest = form.GetAddressesDest(); foreach (LocalAddress address in this.addressesDest) { if (!this.addresses.Contains(address)) { new UserAddress { UserId = user.Id, AdrId = address.Id }.SaveChanges(); } } foreach (LocalAddress address3 in this.addresses) { if (!this.addressesDest.Contains(address3)) { UserAddress.DeleteByUserAndAddress(address3, user); } } area.DeleteWithRelations(); this.addresses.Clear(); this.addressesDest.Clear(); this.addressesSource.Clear(); } }
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"); }
private void btnStart_Click(object sender, System.EventArgs e) { this.procName = this.cms.GetProcName(); if (this.procName == "") { System.Windows.Forms.MessageBox.Show("Отсутствует процедура расчета среднемесячных показаний.", "Отчет"); } else { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(this.m_LocalAddresses); this.startIndicationsDate = System.Convert.ToDateTime(this.cbxStartStat.get_Text()); this.period = System.Convert.ToDateTime(this.cbxPeriod.get_Text()); this.countMonth = this.nudMonthCount.Value; this.countMonthAvg = this.nudMonthCountAvg.Value; this.programStartTime = this.dbxProgramStartTime.Value; this.calcResult = this.cms.CalcIndecation(this.procName, this.startIndicationsDate, this.period, this.countMonth, this.countMonthAvg, this.programStartTime, area); if (this.calcResult != null) { System.Windows.Forms.MessageBox.Show("Расчет выполнен успешно, id групповой операции " + this.calcResult, "Отчет"); } else { System.Windows.Forms.MessageBox.Show("Расчет не был выполнен", "Отчет"); } } }
private void m_WorkerGetNotices_DoWork(object sender, DoWorkEventArgs e) { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(this.Adresses); if (this.m_WorkerGetNoticeMode == WorkerGetNoticeMode.Извещения) { this.m_DataSet = Mappers.DebtorMapper.FindByAccounts(this.Providers, this.Holders, this.ServiceTypes, this.Services, this.m_SelectedAccounts, this.Period, this.LastTermDate, true, (long) this.selectFasetApartmentType.Id, this.PeriodPayment, this.m_cityBoroughs, this.AccountHolders); this.m_DataSet.Tables.get_Item(0).set_TableName("data"); } else if (this.m_WorkerGetNoticeMode == WorkerGetNoticeMode.Уведомления) { this.m_DataSet = Mappers.DebtorMapper.FindByAccountsNotification(this.Providers, this.Holders, this.ServiceTypes, this.Services, this.m_SelectedAccounts, this.Period, System.DateTime.Now.Date, true, (long) this.selectFasetApartmentType.Id, this.PeriodPayment, this.m_cityBoroughs, this.AccountHolders); if (((this.m_DataSet != null) && (this.m_DataSet.Tables.get_Count() == 2)) && (this.m_DataSet.Tables.get_Item(0).Rows.get_Count() != 0)) { this.m_DataSet.Tables.get_Item(0).set_TableName("dataHeader"); this.m_DataSet.Tables.get_Item(1).set_TableName("dataServices"); } } }
private void m_WorkerGetReports_DoWork(object sender, DoWorkEventArgs e) { Area area = new Area(); bool selectedAccounts = false; if (this.Adresses.get_Count() != 0) { area.SaveChanges(); area.SaveAddresses(this.Adresses); } if (this.chbxWithSelectedAccounts.get_Checked()) { selectedAccounts = true; } ObjectList<Account> accounts = this.chbxWithSelectedAccounts.get_Checked() ? this.m_SelectedAccounts : new ObjectList<Account>(); this.m_DataSet = Mappers.DebtorMapper.FindBy(this.Providers, this.Holders, this.ServiceTypes, this.Services, accounts, area.Id, this.Period, this.m_TypeReport, this.MinSumm, this.MaxSumm, this.MinMonth, this.MaxMonth, (long) this.selectFasetApartmentType.Id, this.PeriodPayment, this.m_cityBoroughs, selectedAccounts, (long) this.selectFasetAccountProperty.Id, this.AccountHolders); this.m_DataSet.Tables.get_Item(0).set_TableName("header"); this.m_DataSet.Tables.get_Item(1).set_TableName("data"); }
public Area GetSelectedArea() { Area area = new Area { StatusTemporary = 1 }; area.SaveChanges(); ObjectList<LocalAddress> addresses = this.getSelectedAddresses(); area.SaveAddresses(addresses); return area; }
private void btnSearch_Click(object sender, System.EventArgs e) { Area area = new Area(); area.SaveChanges(); area.SaveAddresses(this.m_LocalAddresses); this.bsHouseCounters.set_DataSource(HouseCounter.FindByLocalAdressesServiceTypesServices(area, this.selectServiceTypes.ServiceTypes, this.selectServices.ServicesOld)); this.dgvHouseCounters.ClearSelection(); }