Merge branch 'BewoRene'
# Conflicts: # BeWo/ServiceProxy/Generated.cs # Report/DefaultReportCreator.cs # Service/ServiceContracts/IOperationsService.cs
This commit is contained in:
@@ -180,10 +180,10 @@ namespace BeWo.Report
|
||||
return report as XtraReport;
|
||||
}
|
||||
|
||||
public override XtraReport CreateFlsReport(String flsReportId, String subType)
|
||||
{
|
||||
string flsReportPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, flsReportId + ".xml");
|
||||
var lFLSAnalysisDataReportDC = Utils.XMLDeserialize<FLSAnalysisDataReportDC>(flsReportPath);
|
||||
public override XtraReport CreateFlsReport(String flsReportId, String subType)
|
||||
{
|
||||
string flsReportPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, flsReportId + ".xml");
|
||||
var lFLSAnalysisDataReportDC = Utils.XMLDeserialize<FLSAnalysisDataReportDC>(flsReportPath);
|
||||
|
||||
|
||||
IBeWoReport<FLSReportRO> lFLSReportObject = null;
|
||||
@@ -200,14 +200,14 @@ namespace BeWo.Report
|
||||
return lFLSReportObject as XtraReport;
|
||||
}
|
||||
|
||||
public override XtraReport CreateQueryReport(long queryOid, String queryReportId)
|
||||
{
|
||||
var query = DAOFactory.GenericDAO.LoadByID<Query>(queryOid);
|
||||
public override XtraReport CreateQueryReport(long queryOid, String queryReportId)
|
||||
{
|
||||
var query = DAOFactory.GenericDAO.LoadByID<Query>(queryOid);
|
||||
|
||||
if (query == null)
|
||||
return new XtraReport();
|
||||
|
||||
var path = BS.Shared.Core.Utils.CreateSavePath(TempPath, queryReportId + ".xml");
|
||||
if (query == null)
|
||||
return new XtraReport();
|
||||
|
||||
var path = BS.Shared.Core.Utils.CreateSavePath(TempPath, queryReportId + ".xml");
|
||||
|
||||
var table = Utils.XMLDeserialize<DataTable>(path);
|
||||
|
||||
@@ -403,48 +403,48 @@ namespace BeWo.Report
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
private IList<long> GetMeineKlientenOids()
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
private IList<long> GetMeineKlientenOids()
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
|
||||
ApplicationUser loggedInUser = null;
|
||||
|
||||
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
||||
{
|
||||
loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
||||
}
|
||||
else
|
||||
{
|
||||
loggedInUser = SessionFacade.LoggedInUser;
|
||||
}
|
||||
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
||||
{
|
||||
loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
||||
}
|
||||
else
|
||||
{
|
||||
loggedInUser = SessionFacade.LoggedInUser;
|
||||
}
|
||||
|
||||
if (loggedInUser != null && loggedInUser.Employee != null)
|
||||
{
|
||||
foreach (var e2c in loggedInUser.Employee.Employee2CustomerList)
|
||||
{
|
||||
if (e2c.Customer.IsActive == ActivationTypeId.Active)
|
||||
{
|
||||
foreach (var v2o in e2c.ValueList)
|
||||
{
|
||||
if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
|
||||
if (loggedInUser != null && loggedInUser.Employee != null)
|
||||
{
|
||||
foreach (var e2c in loggedInUser.Employee.Employee2CustomerList)
|
||||
{
|
||||
if (e2c.Customer.IsActive == ActivationTypeId.Active)
|
||||
{
|
||||
foreach (var v2o in e2c.ValueList)
|
||||
{
|
||||
if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
|
||||
{
|
||||
if (!customerOids.Contains(e2c.Customer.Oid.Value))
|
||||
{
|
||||
customerOids.Add(e2c.Customer.Oid.Value);
|
||||
}
|
||||
if (!customerOids.Contains(e2c.Customer.Oid.Value))
|
||||
{
|
||||
customerOids.Add(e2c.Customer.Oid.Value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return customerOids;
|
||||
}
|
||||
return customerOids;
|
||||
}
|
||||
|
||||
public virtual IList<long> GetKlientenOidsMeinesTeams(long? teamOid)
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
public virtual IList<long> GetKlientenOidsMeinesTeams(long? teamOid)
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
|
||||
ApplicationUser loggedInUser = null;
|
||||
|
||||
@@ -470,7 +470,7 @@ namespace BeWo.Report
|
||||
teams.AddRange(DAOFactory.SearchDAO.FindLeadingTeams(loggedInUser.Employee.Oid.Value));
|
||||
teams.AddRange(DAOFactory.SearchDAO.FindTeamsOfEmployee(loggedInUser.Employee.Oid.Value));
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (var team in teams)
|
||||
{
|
||||
@@ -488,7 +488,7 @@ namespace BeWo.Report
|
||||
{
|
||||
customerOids.Add(e2c.Customer.Oid.Value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -498,97 +498,97 @@ namespace BeWo.Report
|
||||
}
|
||||
}
|
||||
|
||||
return customerOids;
|
||||
}
|
||||
return customerOids;
|
||||
}
|
||||
|
||||
public virtual XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
var roList = new List<ServicesOverviewRO>();
|
||||
public virtual XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
var roList = new List<ServicesOverviewRO>();
|
||||
|
||||
foreach (var coid in customerOids)
|
||||
{
|
||||
var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
|
||||
foreach (var coid in customerOids)
|
||||
{
|
||||
var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
|
||||
|
||||
if (ro != null)
|
||||
{
|
||||
roList.Add(ro);
|
||||
}
|
||||
}
|
||||
if (ro != null)
|
||||
{
|
||||
roList.Add(ro);
|
||||
}
|
||||
}
|
||||
|
||||
var sortedList = roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
|
||||
|
||||
if (sortedList.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid.HasValue && orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid.Value);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Name;
|
||||
}
|
||||
if (sortedList.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid.HasValue && orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid.Value);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Name;
|
||||
}
|
||||
|
||||
var rootReport = CreateReportForServicesOverviewRo(sortedList[0], reportId);
|
||||
if (rootReport.Pages.Count == 0)
|
||||
{
|
||||
rootReport.CreateDocument();
|
||||
}
|
||||
if (rootReport.Pages.Count == 0)
|
||||
{
|
||||
rootReport.CreateDocument();
|
||||
}
|
||||
|
||||
|
||||
for (int i = 1; i < sortedList.Count; i++)
|
||||
{
|
||||
var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId);
|
||||
if (lNext.Pages.Count == 0)
|
||||
{
|
||||
lNext.CreateDocument();
|
||||
}
|
||||
{
|
||||
var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId);
|
||||
if (lNext.Pages.Count == 0)
|
||||
{
|
||||
lNext.CreateDocument();
|
||||
}
|
||||
|
||||
rootReport.Pages.AddRange(lNext.Pages);
|
||||
rootReport.Pages.AddRange(lNext.Pages);
|
||||
}
|
||||
|
||||
return rootReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
return rootReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public virtual XtraReport CreateReportForServicesOverviewRo(ServicesOverviewRO ro, String reportId)
|
||||
{
|
||||
|
||||
|
||||
var serviceOverviewReport = this.FindReportImp<ServicesOverviewRO>(reportId);
|
||||
serviceOverviewReport.SetReportDataSource(ro);
|
||||
|
||||
|
||||
|
||||
return serviceOverviewReport as XtraReport;
|
||||
}
|
||||
|
||||
public virtual XtraReport AddSubServicesOverviewReportToReport(XtraReport masterReport, IBeWoReport<ServicesOverviewRO> newReport, ServicesOverviewRO ro)
|
||||
{
|
||||
if (ro.Services.Count > 0)
|
||||
{
|
||||
newReport.SetReportDataSource(ro);
|
||||
((XtraReport)newReport).CreateDocument();
|
||||
if (masterReport == null)
|
||||
{
|
||||
masterReport = newReport as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (masterReport.Pages.Count == 0)
|
||||
{
|
||||
masterReport.CreateDocument();
|
||||
}
|
||||
public virtual XtraReport AddSubServicesOverviewReportToReport(XtraReport masterReport, IBeWoReport<ServicesOverviewRO> newReport, ServicesOverviewRO ro)
|
||||
{
|
||||
if (ro.Services.Count > 0)
|
||||
{
|
||||
newReport.SetReportDataSource(ro);
|
||||
((XtraReport)newReport).CreateDocument();
|
||||
if (masterReport == null)
|
||||
{
|
||||
masterReport = newReport as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (masterReport.Pages.Count == 0)
|
||||
{
|
||||
masterReport.CreateDocument();
|
||||
}
|
||||
|
||||
masterReport.Pages.AddRange(((XtraReport)newReport).Pages);
|
||||
masterReport.Pages.AddRange(((XtraReport)newReport).Pages);
|
||||
|
||||
}
|
||||
}
|
||||
return masterReport;
|
||||
}
|
||||
}
|
||||
}
|
||||
return masterReport;
|
||||
}
|
||||
|
||||
public override XtraReport CreateSbdLeistungsnachweisForAllCustomers(int month, int year, long orgaOid, long empOid, long serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
return CreateReportForStundenaufstellungROs(SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
|
||||
{
|
||||
return CreateReportForStundenaufstellungROs(SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
|
||||
|
||||
//var lROs = SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
||||
|
||||
@@ -661,25 +661,25 @@ namespace BeWo.Report
|
||||
|
||||
long result;
|
||||
|
||||
if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.SearchDAO.GetSettlementInvoiceByInvoiceBaseOid(invoiceBaseOid.Value));
|
||||
}
|
||||
else if (Int64.TryParse(dcId, out result))
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(result)); // = Utils.XMLDeserialize<SettlementDC>(lPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
string lPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, dcId);
|
||||
lSettlementDC = Utils.XMLDeserialize<Settlement2DC>(lPath);
|
||||
}
|
||||
String reportId = null;
|
||||
if (lSettlementDC.CostBearer2SupportConceptOid.HasValue)
|
||||
{
|
||||
CostBearer2SupportConcept c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(lSettlementDC.CostBearer2SupportConceptOid.Value);
|
||||
reportId = c2s.CostBearer.ID;
|
||||
}
|
||||
if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.SearchDAO.GetSettlementInvoiceByInvoiceBaseOid(invoiceBaseOid.Value));
|
||||
}
|
||||
else if (Int64.TryParse(dcId, out result))
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(result)); // = Utils.XMLDeserialize<SettlementDC>(lPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
string lPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, dcId);
|
||||
lSettlementDC = Utils.XMLDeserialize<Settlement2DC>(lPath);
|
||||
}
|
||||
String reportId = null;
|
||||
if (lSettlementDC.CostBearer2SupportConceptOid.HasValue)
|
||||
{
|
||||
CostBearer2SupportConcept c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(lSettlementDC.CostBearer2SupportConceptOid.Value);
|
||||
reportId = c2s.CostBearer.ID;
|
||||
}
|
||||
|
||||
if (lSettlementDC.DifferentHourlyRateCount > 0)
|
||||
{
|
||||
@@ -721,35 +721,35 @@ namespace BeWo.Report
|
||||
{
|
||||
IBeWoReport<MitarbeiterstundenkontoRO> report;
|
||||
|
||||
if (ansicht == 1)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterarbeitszeitkonto");
|
||||
if (ansicht == 1)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterarbeitszeitkonto");
|
||||
}
|
||||
else if (ansicht == 2)
|
||||
{
|
||||
var reportjahr = FindReportImp<MitarbeiterstundenkontoMonateRO>("MitarbeiterarbeitszeitkontoJahr");
|
||||
var jahrStart = new DateTime(startDate.Year, 1, 1);
|
||||
var ds = new MitarbeiterstundenkontoMonateRO(employeeOid, teamOids, jahrStart, endDate, null);
|
||||
{
|
||||
var reportjahr = FindReportImp<MitarbeiterstundenkontoMonateRO>("MitarbeiterarbeitszeitkontoJahr");
|
||||
var jahrStart = new DateTime(startDate.Year, 1, 1);
|
||||
var ds = new MitarbeiterstundenkontoMonateRO(employeeOid, teamOids, jahrStart, endDate, null);
|
||||
|
||||
reportjahr.SetReportDataSource(ds);
|
||||
reportjahr.SetReportDataSource(ds);
|
||||
|
||||
return reportjahr as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (teamOids != null && teamOids.Count > 0)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Teamstundenkonto");
|
||||
}
|
||||
else
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterstundenkonto");
|
||||
}
|
||||
}
|
||||
return reportjahr as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (teamOids != null && teamOids.Count > 0)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Teamstundenkonto");
|
||||
}
|
||||
else
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterstundenkonto");
|
||||
}
|
||||
}
|
||||
|
||||
var x =
|
||||
MitarbeiterstundenkontoRO.Create(employeeOid, teamOids, startDate, endDate, null);
|
||||
report.SetReportDataSource(x);
|
||||
var x =
|
||||
MitarbeiterstundenkontoRO.Create(employeeOid, teamOids, startDate, endDate, null);
|
||||
report.SetReportDataSource(x);
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
@@ -862,7 +862,7 @@ namespace BeWo.Report
|
||||
{
|
||||
var report = FindReportImp<KilometerauswertungsRO>();
|
||||
|
||||
report.SetReportDataSource(KilometerauswertungsRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid)), rangeDate));
|
||||
report.SetReportDataSource(KilometerauswertungsRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid)), rangeDate));
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
@@ -871,7 +871,7 @@ namespace BeWo.Report
|
||||
{
|
||||
var report = FindReportImp<KilometerauswertungsListRO>();
|
||||
|
||||
report.SetReportDataSource(KilometerauswertungsListRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<Customer>(customerOids)), rangeDate));
|
||||
report.SetReportDataSource(KilometerauswertungsListRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<Customer>(customerOids)), rangeDate));
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
@@ -897,8 +897,10 @@ namespace BeWo.Report
|
||||
public override XtraReport CreateAbsenceReport(DateTime dt, List<long> abs, List<long> empTypes)
|
||||
{
|
||||
var report = FindReportImp<AbsenceRO>();
|
||||
|
||||
report.SetReportDataSource(AbsenceRO.Create(dt, (new OperationsServiceImp()).GetAbsenceTimeDCEmployee51(dt, dt.AddMonths(1).AddTicks(-1), abs, empTypes)));
|
||||
var service = new OperationsServiceImp();
|
||||
var filter = new AbsenceOverviewFilterDC() { AbsenceReasons = abs, EmploymentType = empTypes, Year = dt.Year, Month = dt.Month };
|
||||
|
||||
report.SetReportDataSource(AbsenceRO.Create(service.GetAbsenceOverview(filter), filter));
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
@@ -908,7 +910,7 @@ namespace BeWo.Report
|
||||
var service = new OperationsServiceImp();
|
||||
var service2 = new CustomerServiceImp();
|
||||
var report = FindReportImp<RosterRO>();
|
||||
|
||||
|
||||
report.SetReportDataSource(RosterRO.Create(service.GetDienstEintraege(wOid, dt.Year, dt.Month), service.GetAllDienste(), service2.GetAllActiveWohnheimeCompact().First(x => x.WohnheimOid == wOid), dt.Year, dt.Month));
|
||||
|
||||
return report as XtraReport;
|
||||
|
||||
Reference in New Issue
Block a user