public ServiceTypeSubQualityAddChangeForm() { this.mServiceTypeSubQuality = ServiceTypeSubQuality.Null; this._mServiceTypeSubQualityPercent = ServiceTypeSubQualityPercent.Null; this._mServiceType = ServiceTypeOld.Null; this.InitializeComponent(); }
public AddressTariffViewCollection Find(Organization org, ServiceTypeOld st) { if (org == null) { throw new System.ArgumentNullException("org", "Организация не может быть равной null"); } if (st == null) { throw new System.ArgumentNullException("st", "Тип услуги не может быть равен null"); } AddressTariffViewCollection views = new AddressTariffViewCollection(); System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[2]; parameters[0] = new System.Data.SqlClient.SqlParameter("@orgId", System.Data.SqlDbType.BigInt); parameters[0].set_Value((long) org.Id); parameters[1] = new System.Data.SqlClient.SqlParameter("@srvTypeId", System.Data.SqlDbType.BigInt); parameters[1].set_Value((long) st.Id); foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(" select \ta.adrId, sn.LocalAddress_ToString(a.adrId, 0) adr,\r\n\t\t\t\t\t\t\t\tsrvTarif.id tId,\r\n\t\t\t\t\t\t\t\tsrvTarif.rate,\r\n\t\t\t\t\t\t\t\tsrvTarif.srvId,\r\n\t\t\t\t\t\t\t\tsrvTarif.code,\r\n\t\t\t\t\t\t\t\tsrvTarif.shortName\r\n\t\t\t\t\t\tfrom\t(\tselect s.id srvId,s.code,s.shortName,curSt.id,curSt.rate\r\n\t\t\t\t\t\t\t\t\tfrom\tsn.Organizations o,\r\n\t\t\t\t\t\t\t\t\t\t\tsn.Services s,\r\n\t\t\t\t\t\t\t\t\t\t\t(\tselect st.*\r\n\t\t\t\t\t\t\t\t\t\t\t\tfrom\t sn.ServiceTariffs st,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t (select serviceId,MAX(dateb) dateb\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t from\t sn.ServiceTariffs\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t group by serviceId\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) curSt\r\n\t\t\t\t\t\t\t\t\t\t\t\twhere\t st.serviceId=curSt.serviceId\r\n\t\t\t\t\t\t\t\t\t\t\t\tand\t\t st.dateb=curSt.dateb\r\n\t\t\t\t\t\t\t\t\t\t\t\tand\t\t st.id=(select MAX(id)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom\t sn.ServiceTariffs st1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere\t st1.serviceId=st.serviceId\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tand\t\t st1.dateb=st.dateb\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t) curSt\r\n\t\t\t\t\t\t\t\t\twhere\t(o.id=@orgId or @orgId=0)\r\n\t\t\t\t\t\t\t\t\tand\t\ts.providerId=o.id\r\n\t\t\t\t\t\t\t\t\tand\t\t(s.typeId=@srvTypeId or @srvTypeId=0)\r\n\t\t\t\t\t\t\t\t\tand\t\tcurSt.serviceId=s.id\r\n\t\t\t\t\t\t\t\t) srvTarif\r\n\t\t\t\t\t\t\t\tinner join sn.AccountServices acs on (srvTarif.srvId = acs.id) and (acs.toDate is null)\r\n\t\t\t\t\t\t\t\tinner join sn.Accounts ac on acs.accountId = ac.id\r\n\t\t\t\t\t\t\t\tinner join sn.Apartments a on ac.apartmentId = a.id", parameters).Rows) { views.AddObject(this.Load(row)); } return views; }
public ServiceTypeNode(ServiceTypeOld st) : base(st.ShortName) { base.set_Tag(st); base.Nodes.Add(""); }
public static ServiceTypeOld AddServiceType(ServiceTypeDTO dto) { ServiceTypeOld old = new ServiceTypeOld(); old.SaveChanges(dto); if (ServiceTypes.FindById(old.Id) == null) { ServiceTypes.Add(old); } return old; }
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); } }
protected virtual System.Data.DataTable GetServerReport(Server srv, System.DateTime dateBeg, System.DateTime dateEnd, CalcOperationGroup opGroup, Organization sp, ServiceTypeOld st) { return Mappers.SimpleReportMapper.JnOperations(srv, dateBeg, dateEnd, opGroup, sp, st); }
private void UpdateParent(ServiceTypeOld serviceTypeOld) { ServiceTypeOld old = serviceTypeOld.Parent ?? ServiceTypeOld.Null; if (old != ServiceTypeOld.Null) { ServiceTypeDTO dto = new ServiceTypeDTO { Id = old.Id, Code = (int) ((int) old.Code), ShortName = old.ShortName, LongName = old.LongName, Unit = old.Unit, Parent = old.Parent, TypeId = old.TypeId, IsGroup = 1 }; old.SaveChanges(dto); } }
public static System.Collections.Generic.List<ServiceOld> FindByProviderAndType(Organization organization, ServiceTypeOld serviceType) { return Mappers.ServiceOldMapper.FindByProviderAndType(organization, serviceType); }
public System.Data.DataSet Recalc(System.DateTime fromDate, System.DateTime toDate, System.DateTime fromPeriod, System.DateTime toPeriod, FasetItem subType, Organization provider, ServiceTypeOld serviceType, ServiceOld serviceOld, Organization houseHolder, OrgDocument orgDocument, ObjectList<LocalAddress> addresses) { System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[12]; parameters[0] = new System.Data.SqlClient.SqlParameter("@areaId", System.Data.SqlDbType.BigInt); parameters[0].set_Value((long) Area.GetAreaIdByLocalAddresses(addresses)); parameters[1] = new System.Data.SqlClient.SqlParameter("@fromDate", System.Data.SqlDbType.DateTime); parameters[1].set_Value(fromDate); parameters[2] = new System.Data.SqlClient.SqlParameter("@toDate", System.Data.SqlDbType.DateTime); parameters[2].set_Value((toDate == Constants.NullDate) ? ((object) System.DBNull.Value) : ((object) toDate)); parameters[3] = new System.Data.SqlClient.SqlParameter("@fromPeriod", System.Data.SqlDbType.DateTime); parameters[3].set_Value(fromPeriod); parameters[4] = new System.Data.SqlClient.SqlParameter("@toPeriod", System.Data.SqlDbType.DateTime); parameters[4].set_Value((toPeriod == Constants.NullDate) ? ((object) System.DBNull.Value) : ((object) toPeriod)); parameters[5] = new System.Data.SqlClient.SqlParameter("@subTypeId", System.Data.SqlDbType.BigInt); parameters[5].set_Value((subType == FasetItem.Null) ? ((object) System.DBNull.Value) : ((object) ((int) subType.Id))); parameters[6] = new System.Data.SqlClient.SqlParameter("@providerId", System.Data.SqlDbType.BigInt); parameters[6].set_Value((provider == Organization.Null) ? ((object) System.DBNull.Value) : ((object) ((long) provider.Id))); parameters[7] = new System.Data.SqlClient.SqlParameter("@serviceTypeId", System.Data.SqlDbType.BigInt); parameters[7].set_Value((serviceType == ServiceTypeOld.Null) ? ((object) System.DBNull.Value) : ((object) ((long) serviceType.Id))); parameters[8] = new System.Data.SqlClient.SqlParameter("@serviceId", System.Data.SqlDbType.BigInt); parameters[8].set_Value((serviceOld == ServiceOld.Null) ? ((object) System.DBNull.Value) : ((object) ((long) serviceOld.Id))); parameters[9] = new System.Data.SqlClient.SqlParameter("@houseHolderId", System.Data.SqlDbType.BigInt); parameters[9].set_Value((houseHolder == Organization.Null) ? ((object) System.DBNull.Value) : ((object) ((long) houseHolder.Id))); parameters[10] = new System.Data.SqlClient.SqlParameter("@orgDocumentId", System.Data.SqlDbType.BigInt); parameters[10].set_Value((orgDocument == OrgDocument.Null) ? ((object) System.DBNull.Value) : ((object) ((long) orgDocument.Id))); parameters[11] = new System.Data.SqlClient.SqlParameter("@summ", System.Data.SqlDbType.Decimal); parameters[11].set_Direction(System.Data.ParameterDirection.Output); System.Data.DataSet set = new System.Data.DataSet(); set.Tables.Add(DALSql.ExecuteDataTable("exec sn.GetJnRecalcReport @areaId,@fromDate,@toDate,@fromPeriod,@toPeriod,\r\n\t\t\t\t\t\t\t\t\t\t\t\t@subTypeId,@providerId,@serviceTypeId,@serviceId,\r\n\t\t\t\t\t\t\t\t\t\t\t\t@houseHolderId,@orgDocumentId,@summ output ", parameters)); set.Tables.Add(DALSql.ExecuteDataTable("select sn.User_GetName() userName", null)); return set; }
public System.Data.DataTable JnOperationsByHouse(Server srv, System.DateTime dateBeg, System.DateTime dateEnd, CalcOperationGroup opGroup, Organization srvProvider, ServiceTypeOld srvType) { System.Data.DataTable table = new System.Data.DataTable(); System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(string.Format("Data Source = {0};Initial Catalog = {1};User ID={2};pwd={3}", new object[] { srv.IpAddress, srv.DbName, srv.UserName, srv.UserPwd })); try { connection.Open(); System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("", connection); command.set_CommandTimeout(0); command.Parameters.Add("@fromDate", System.Data.SqlDbType.DateTime).set_Value(dateBeg); command.Parameters.Add("@toDate", System.Data.SqlDbType.DateTime).set_Value(dateEnd); command.Parameters.Add("@operGroupName", System.Data.SqlDbType.VarChar, 0xff).set_Value(opGroup.Name); command.Parameters.Add("@providerName", System.Data.SqlDbType.VarChar, 0xff).set_Value((srvProvider.Id == 0L) ? ((object) System.DBNull.Value) : ((object) srvProvider.ShortName)); command.Parameters.Add("@serviceTypeName", System.Data.SqlDbType.VarChar, 0xff).set_Value((srvType.Id == 0L) ? ((object) System.DBNull.Value) : ((object) srvType.ShortName)); command.set_CommandText("\r\n\t\t\t\t\tselect providerName srvProvider, serviceTypeName srvType, sum(summ) summ\r\n\t\t\t\t\t\t--, apartmentAddrName house\r\n\t\t\t\t\t\t, ( case when apartmentAddrLevel = 40 then sn.LocalAddress_ToString(apartmentParentAddrId, 0) \r\n\t\t\t\t\t\t\telse sn.LocalAddress_ToString(apartmentAddrId, 0) end ) house\r\n\t\t\t\t\tfrom sn.JnGroupView\r\n\t\t\t\t\twhere operGroupName=@operGroupName and\r\n\t\t\t\t\t\t period>=@fromDate and period<@toDate and\r\n\t\t\t\t\t\t (@providerName is null or @providerName=providerName) and\r\n\t\t\t\t\t\t (@serviceTypeName is null or @serviceTypeName=serviceTypeName)\r\n\t\t\t\t\tgroup by providerName, serviceTypeName, apartmentAddrLevel, apartmentParentAddrId, apartmentAddrId"); new System.Data.SqlClient.SqlDataAdapter(command).Fill(table); } finally { connection.Close(); } return table; }
public System.Data.DataTable JnOperations(Server srv, System.DateTime dateBeg, System.DateTime dateEnd, CalcOperationGroup opGroup, Organization srvProvider, ServiceTypeOld srvType) { System.Data.DataTable table = new System.Data.DataTable(); System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(string.Format("Data Source = {0};Initial Catalog = {1};User ID={2};pwd={3}", new object[] { srv.IpAddress, srv.DbName, srv.UserName, srv.UserPwd })); try { connection.Open(); System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("", connection); command.set_CommandTimeout(0); command.Parameters.Add("@operGroup", System.Data.SqlDbType.VarChar, 0xff).set_Value(opGroup.Name); command.Parameters.Add("@fromDate", System.Data.SqlDbType.DateTime).set_Value(dateBeg); command.Parameters.Add("@toDate", System.Data.SqlDbType.DateTime).set_Value(dateEnd); command.Parameters.Add("@serviceProvider", System.Data.SqlDbType.VarChar, 0xff).set_Value((srvProvider.Id == 0L) ? ((object) System.DBNull.Value) : ((object) srvProvider.ShortName)); command.Parameters.Add("@serviceType", System.Data.SqlDbType.VarChar, 0xff).set_Value((srvType.Id == 0L) ? ((object) System.DBNull.Value) : ((object) srvType.ShortName)); command.set_CommandText("\r\n\t\t\t\t\tif object_id('tempdb..#t') is not null drop table #t\r\n\r\n\t\t\t\t\tselect ' '+srvProvider srvProvider, \r\n\t\t\t\t\t\t' '+houseHolder houseHolder, \r\n\t\t\t\t\t\t' '+srvType srvType, summ\r\n\t\t\t\t\tinto #t\r\n\t\t\t\t\tfrom sn.GetJnReportByGroup(@operGroup,@fromDate,@toDate,@serviceProvider,@serviceType) t\r\n\t\t\t\t\t--все внутренние суммы\r\n\t\t\t\t\tselect srvProvider, houseHolder, srvType, summ\r\n\t\t\t\t\tfrom #t\r\n\t\t\t\t\tunion\r\n/*\t\t\t\t\t--итоги поставщику по нескольким управляющим компаниям (строка)\r\n\t\t\t\t\tselect srvProvider, ' Итого' houseHolder, srvType, sum(summ) summ\r\n\t\t\t\t\tfrom #t\r\n\t\t\t\t\tgroup by srvProvider, srvType\r\n\t\t\t\t\thaving count(distinct houseHolder)>1\r\n\t\t\t\t\tunion\r\n\t\t\t\t\t--итоги поставщику по нескольким управляющим компаниям (сумма в конце)\r\n\t\t\t\t\tselect srvProvider, ' Итого' houseHolder, 'ИТОГО' srvType, sum(summ) summ\r\n\t\t\t\t\tfrom #t\r\n\t\t\t\t\tgroup by srvProvider\r\n\t\t\t\t\thaving count(distinct houseHolder)>1\r\n\t\t\t\t\tunion\r\n*/\t\t\t\t\t--итоги по поставщику с одной управляющей компанией (сумма в конце)\r\n\t\t\t\t\tselect srvProvider, houseHolder, 'ИТОГО' srvType, sum(summ) summ\r\n\t\t\t\t\tfrom #t\r\n\t\t\t\t\tgroup by srvProvider, houseHolder\r\n\t\t\t\t\tunion\r\n\t\t\t\t\t--итоги по группам услуг\r\n\t\t\t\t\tselect 'ИТОГО', '' houseHolder, srvType, sum(summ) summ\r\n\t\t\t\t\tfrom #t\r\n\t\t\t\t\tgroup by srvType\r\n\t\t\t\t\tunion\r\n\t\t\t\t\t--итоги по всей выборке\r\n\t\t\t\t\tselect 'ИТОГО', '' houseHolder, 'ИТОГО' srvType, sum(summ) summ\r\n\t\t\t\t\tfrom #t\t\t\t\t\t\r\n\t\t\t\t"); new System.Data.SqlClient.SqlDataAdapter(command).Fill(table); } finally { connection.Close(); } return table; }
public static void TransferAvanceAccountServicesByServiceTypesUseOpenAccountService(Area area, OrgDocument doc, ServiceTypeOld sourceServiceType, ServiceTypeOld destServiceType, bool isAvanceTransverFull, int debtTransferType, int avanceTransferType) { Mappers.GroupOperationMapper.TransferAvanceAccountServicesByServiceTypesUseOpenAccountService(area.Id, doc.Id, sourceServiceType.Id, destServiceType.Id, isAvanceTransverFull, debtTransferType, avanceTransferType); }
public static void TransferAvanceAccountServicesByServiceTypes(Area area, OrgDocument doc, bool avanceTransfer, bool debtTransfer, ServiceTypeOld sourceServiceType, ServiceTypeOld destServiceType, bool useAccountServiceBankrupts, int debtTransferType, int avanceTransferType) { Mappers.GroupOperationMapper.TransferAvanceAccountServicesByServiceTypes(area.Id, doc.Id, avanceTransfer, debtTransfer, sourceServiceType.Id, destServiceType.Id, useAccountServiceBankrupts, debtTransferType, avanceTransferType); }
private void btnOk_Click(object sender, System.EventArgs e) { if (this.selectOrgDocument1.SelectedOrgDocument == null) { new BalloonWindow("Не выбран документ!").Show(this.btnOk); } else if (this.cbxServiceType.get_SelectedItem() == null) { new BalloonWindow("Не выбрана услуга!").Show(this.btnOk); } else if (this.selectFasetServiceTypeSuspension.SelectedFasetItem == FasetItem.Null) { new BalloonWindow("Не выбрано требование!").Show(this.btnOk); } else if (this.rtNormativ.get_Text() == "") { new BalloonWindow("Не введена допустимая продолжит.!").Show(this.btnOk); } else if (this.rtRule.get_Text() == "") { new BalloonWindow("Не введен порядок изменения оплаты!").Show(this.btnOk); } else { this._mServiceType = (this.bsServiceType.get_Current() as ServiceTypeOld) ?? ServiceTypeOld.Null; this.mServiceTypeSubQuality.ServiceTypeId = this._mServiceType.Id; this.mServiceTypeSubQuality.QualityTypeId = this.selectFasetServiceTypeSuspension.SelectedFasetItem.Id; this.mServiceTypeSubQuality.QualityName = this.rtServiceTypeSuspension.get_Text(); this.mServiceTypeSubQuality.Normativ = this.rtNormativ.get_Text(); this.mServiceTypeSubQuality.SuspensionRule = this.rtRule.get_Text(); this.mServiceTypeSubQuality.OrgDocId = this.selectOrgDocument1.SelectedOrgDocument.Id; if (this.mServiceTypeSubQuality.IsNew) { this.btnOk.set_Text("Изменить"); this.tsButtons.set_Enabled(true); } else { base.set_DialogResult(System.Windows.Forms.DialogResult.Yes); } this.mServiceTypeSubQuality.SaveChanges(); } }
public ServiceTypeChildsForm(ServiceTypeOld serviceType) : this() { this.serviceTypeParent = serviceType; }
public static ObjectList<ServiceOld> FindBy(ServiceTypeOld type, Organization provider, AIS.SN.Model.DomainObjects.CanonicalService canonical, Organization houseHolder, Organization resourceProvider, LocalAddress adr, System.DateTime fromDate) { return Mappers.ServiceOldMapper.FindBy(type.Id, provider.Id, canonical.Id, houseHolder.Id, resourceProvider.Id, adr.Id, fromDate); }
public System.Collections.Generic.List<ServiceOld> FindByProviderIdType(ServiceTypeOld type) { return Mappers.ServiceOldMapper.FindByProviderAndType(this, type); }
public static System.Collections.Generic.List<ServiceOld> FindByServiceType(ServiceTypeOld serviceType) { return Mappers.ServiceOldMapper.FindByServiceType(serviceType); }
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); } }