Пример #1
0
 public ServiceAddForm(Service Service)
     : this()
 {
     if ((Service != null) && (Service != Service.Null))
     {
         this._mService = Service;
     }
 }
 private void UpdateServiceNorm(Service service, bool updateServiceNorm)
 {
     ServiceNorm norm = (service.ServiceNormId != 0L) ? ServiceNorm.FindById(service.ServiceNormId) : new ServiceNorm();
     if (!this.Selected.get_Visible())
     {
         this.bsServiceNormTypesByProperties.set_DataSource(norm.GetFullServiceNormTypes(FasetsEnum.ApartmentProperties));
         this.bsServiceNormTypes.set_DataSource(norm.GetFullServiceNormTypes(FasetsEnum.ServiceNormType));
     }
     else
     {
         this.bsServiceNormTypesByProperties.set_DataSource(norm.FindFullByServiceNormIdServiceNormTypeTable(FasetsEnum.ApartmentProperties, this.dtServiceNormTypesByPropertySave));
         this.bsServiceNormTypes.set_DataSource(norm.FindFullByServiceNormIdServiceNormTypeTable(FasetsEnum.ServiceNormType, this.dtServiceNormTypesSave));
     }
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvServiceNormTypesByProperties.Rows)
     {
         if (this.dtServiceNormTypesByProperty != null)
         {
             foreach (System.Data.DataRow row2 in this.dtServiceNormTypesByProperty.Rows)
             {
                 if (((row.Cells.get_Item("ServiceNormTypeId").get_Value().ToString() == row2.get_Item("serviceNormTypeId").ToString()) && (row.Cells.get_Item("ServiceTypeServiceNormId").get_Value().ToString() == row2.get_Item("serviceNormId").ToString())) && (row.Cells.get_Item("ApartmentPropertyId").get_Value().ToString() == row2.get_Item("apartmentPropertyId").ToString()))
                 {
                     if (this.Selected.get_Visible())
                     {
                         row.Cells.get_Item("SelectedServiceNormType").set_Value(true);
                     }
                     else
                     {
                         row.Cells.get_Item("NewValueApartmentProperty").set_Value(row2.get_Item("rate"));
                     }
                 }
             }
         }
     }
     foreach (System.Windows.Forms.DataGridViewRow row3 in (System.Collections.IEnumerable) this.dgvServiceNormTypes.Rows)
     {
         if (this.dtServiceNormTypes != null)
         {
             foreach (System.Data.DataRow row4 in this.dtServiceNormTypes.Rows)
             {
                 if (((row3.Cells.get_Item("ServiceNormType_Id").get_Value().ToString() == row4.get_Item("serviceNormTypeId").ToString()) && (row3.Cells.get_Item("ServiceNormType_ServiceNormId").get_Value().ToString() == row4.get_Item("serviceNormId").ToString())) && (row3.Cells.get_Item("ServiceNormType_ApartmentPropertyId").get_Value().ToString() == row4.get_Item("apartmentPropertyId").ToString()))
                 {
                     if (this.Selected.get_Visible())
                     {
                         row3.Cells.get_Item("SelectedServiceNormTypeByProperty").set_Value(true);
                     }
                     else
                     {
                         row3.Cells.get_Item("NewValueNorm").set_Value(row4.get_Item("rate"));
                     }
                 }
             }
         }
     }
     this.ColoringDGVServiceNormType();
 }
 private void создатьУслугуСкопировавДанныеToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     if (this.dbFromDate.IsNull)
     {
         Messages.ShowMessage("Введите дату смены управляющей компании");
     }
     else
     {
         Organization organization = (Organization) this.bsNewHouseHolders.get_Current();
         if ((organization == null) || (organization == Organization.Null))
         {
             Messages.ShowMessage("Выберите новую управляющую компанию");
         }
         else
         {
             Service oldService = (Service) this.bsOldServices.get_Current();
             if ((oldService != null) && (oldService != Service.Null))
             {
                 Service service = new Service {
                     TypeId = oldService.TypeId,
                     ProviderId = oldService.ProviderId,
                     ShortName = oldService.ShortName,
                     LongName = oldService.LongName,
                     CanonicalId = oldService.CanonicalId,
                     AlgorithmId = oldService.AlgorithmId,
                     HouseHolderId = ((Organization) this.bsNewHouseHolders.get_Current()).Id,
                     ResourceProviderId = oldService.ResourceProviderId,
                     AdrId = oldService.AdrId,
                     IsSeasonal = oldService.IsSeasonal,
                     FromDate = this.dbFromDate.Value
                 };
                 ServiceAddForm form = new ServiceAddForm(service);
                 if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                 {
                     this.LinkServices(oldService, service);
                     this.bsOldServices.Remove(oldService);
                     this.bsNewServices.Add(service);
                     this.bsNewServices.set_Position(this.bsOldServices.IndexOf(service));
                 }
             }
         }
     }
 }
 private void LinkServices(Service oldService, Service newService)
 {
     this.dt.Rows.Add((object[]) new object[] { ((long) oldService.Id), ((long) oldService.Code), oldService.ShortName, ((long) newService.Id), ((long) newService.Code), newService.ShortName });
     this.dgvServicesComparison.set_DataSource(this.dt);
 }
Пример #5
0
 public static ServiceOld GetByService(Service service)
 {
     return new ServiceOld {
         ShortName = service.ShortName, LongName = service.LongName, ServiceTypeId = service.TypeId, ServiceProviderId = service.ProviderId, Code = service.Code, CalcAlgId = service.AlgorithmId, CanonicalServiceId = service.CanonicalId, AdrId = service.AdrId, ResourceProviderId = service.ResourceProviderId, HouseHolderId = service.HouseHolderId, IsSeasonal = (bool) (service.IsSeasonal == 1), IsFixedPayment = (bool) (service.IsFixedPayment == 1), FromDate = service.FromDate, ToDate = service.ToDate, CanHaveNegativeCharge = service.CanHaveNegativeCharge, CanRecalcInCloseAccount = service.CanRecalcInCloseAccount,
         m_isNotRecalculationOldPeriod = service.IsNotRecalculationOldPeriod
      };
 }
Пример #6
0
 public ServiceTariffView(Service service)
 {
     this.InitializeComponent();
     this._mService = service;
 }
Пример #7
0
 protected override void Fill(ObjectWithId obj)
 {
     ServiceTariff tariff = (ServiceTariff) obj;
     this._mService = tariff.GetService();
     this.numTariff.set_Value(tariff.Rate);
     this.selectOrgDocument.SelectedOrgDocument = tariff.OrgDocument;
     this.dbFromDate.Value = tariff.FromDate;
     this.bsServiceTariffTypes.set_DataSource(ServiceTariffType.FindByServiceTariffId(tariff.Id));
     this.panel1.set_Visible(true);
     if (!User.IsMemberOf(RightsEnum.ВводОтрицательногоТарифа))
     {
         this.epRights.SetError(this.numTariff, "У Вас нет прав на ввод отрицательного тарифа");
     }
 }
Пример #8
0
 private void UpdateBsServiceTariffTypes(Service service)
 {
 }
Пример #9
0
 public ServiceAddForm()
 {
     this._mService = Service.Null;
     this.InitializeComponent();
 }
Пример #10
0
 protected override void Fill(ObjectWithId obj)
 {
     this.service = Service.FindById(obj.Id);
     this.serviceTariffBindingSource.set_DataSource(this.service.GetServiceTariffs());
     this.serviceTariffBindingSource.set_Sort("FromDate desc");
     if (this.IsReadOnly)
     {
         this.toolStrip.set_Visible(false);
     }
 }
Пример #11
0
 private void UpdateBsServiceTariffTypes(Service service, bool updateServiceTarifTypes)
 {
     if ((this.dgvServices.Rows.GetRowCount(System.Windows.Forms.DataGridViewElementStates.Selected) > 1) && updateServiceTarifTypes)
     {
         this.bsServiceTariffTypes.Clear();
     }
     else if (service.LastRateId != 0L)
     {
         ServiceTariff tariff = ServiceTariff.FindById(service.LastRateId);
         if (!this.SelectedServiceTariffType.get_Visible())
         {
             this.bsServiceTariffTypes.set_DataSource(tariff.GetInstalledServiceTariffTypes());
             this.dgvServiceTariffTypes.Sort(this.dgvServiceTariffTypes.Columns.get_Item("rateDataGridViewTextBoxColumn"), ListSortDirection.Descending);
             foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvServiceTariffTypes.Rows)
             {
                 foreach (System.Data.DataRow row2 in this.dtServiceTariffTypes.Rows)
                 {
                     if (((row.Cells.get_Item("ServiceTeriffTypeId").get_Value().ToString() == row2.get_Item("ServiceTariffTypeId").ToString()) && (row.Cells.get_Item("TariffTypeId").get_Value().ToString() == row2.get_Item("typeId").ToString())) && (row.Cells.get_Item("ServiceTariffId").get_Value().ToString() == row2.get_Item("serviceTariffId").ToString()))
                     {
                         row.Cells.get_Item("NewServiceTypeTariffRateColumn").set_Value(row2.get_Item("rate").ToString());
                     }
                 }
             }
         }
         else
         {
             this.bsServiceTariffTypes.set_DataSource(tariff.GetInstalledServiceTariffTypesByTable(this.dtSerficeTariffTypeSave));
             this.dgvServiceTariffTypes.Sort(this.dgvServiceTariffTypes.Columns.get_Item("rateDataGridViewTextBoxColumn"), ListSortDirection.Descending);
             foreach (System.Windows.Forms.DataGridViewRow row3 in (System.Collections.IEnumerable) this.dgvServiceTariffTypes.Rows)
             {
                 foreach (System.Data.DataRow row4 in this.dtSerficeTariffTypeSave.Rows)
                 {
                     if ((row4.get_Item("typeId").ToString() == row3.Cells.get_Item("TariffTypeId").get_Value().ToString()) && (row4.get_Item("rate").ToString() != row3.Cells.get_Item("rateDataGridViewTextBoxColumn").get_Value().ToString()))
                     {
                         row3.DefaultCellStyle.set_BackColor(System.Drawing.Color.LightYellow);
                     }
                 }
                 foreach (System.Data.DataRow row5 in this.dtServiceTariffTypes.Rows)
                 {
                     if (((row3.Cells.get_Item("ServiceTeriffTypeId").get_Value().ToString() == row5.get_Item("ServiceTariffTypeId").ToString()) && (row3.Cells.get_Item("TariffTypeId").get_Value().ToString() == row5.get_Item("typeId").ToString())) && (row3.Cells.get_Item("ServiceTariffId").get_Value().ToString() == row5.get_Item("serviceTariffId").ToString()))
                     {
                         row3.Cells.get_Item("SelectedServiceTariffType").set_Value(true);
                     }
                 }
             }
         }
     }
 }
Пример #12
0
 public static void ReplaceAccountServices(ObjectList<ServiceOld> services, Area area, Service service)
 {
     Mappers.GroupOperationMapper.ReplaceAccountServices(services, area, service.Id);
 }