- Klientennamen im Jahresbericht eingebaut - Bugfix Reports für fehlende Unterschriften - Bugfix History
225 lines
8.5 KiB
C#
225 lines
8.5 KiB
C#
using BeWo.Service.ServiceImplementations;
|
|
using BS.Shared.DataContracts;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace BeWo.Report.ReportObjects
|
|
{
|
|
public class JahresReportRO : AbstractBeWoReportObject<JahresReportRO>
|
|
{
|
|
public DateTime ReportStartDate { get; set; }
|
|
|
|
public DateTime ReportEndDate { get; set; }
|
|
|
|
public IList<JahresReportTabelle> JahresReportTabelleList { get; set; }
|
|
|
|
public class JahresReportTabelle
|
|
{
|
|
public string Name { get; set; }
|
|
public IList<JahresReportDetail> JahresReportDetailList { get; set; }
|
|
//public charControll BarChart{get; set;}
|
|
|
|
}
|
|
|
|
public class JahresReportDetail
|
|
{
|
|
public string Name { get; set; }
|
|
|
|
public int Anzahl { get; set; }
|
|
|
|
public int MaennlichAnzahl { get; set; }
|
|
|
|
public int WeiblichAnzahl { get; set; }
|
|
|
|
public int DiversAnzahl { get; set; }
|
|
|
|
public int NoSexAnzahl { get; set; }
|
|
|
|
public object Custom1 { get; set; }
|
|
|
|
public object Custom2 { get; set; }
|
|
|
|
public object Custom3 { get; set; }
|
|
|
|
public object Custom4 { get; set; }
|
|
|
|
public object Custom5 { get; set; }
|
|
|
|
public object Custom6 { get; set; }
|
|
|
|
public object Custom7 { get; set; }
|
|
|
|
public object Custom8 { get; set; }
|
|
|
|
public object Custom9 { get; set; }
|
|
|
|
public object Custom10 { get; set; }
|
|
|
|
public IList<String> CustomerNames { get; set; }
|
|
|
|
public String AllCustomerString { get; set; }
|
|
|
|
}
|
|
|
|
|
|
public static JahresReportRO Create(int year, long? orgOid, long? teamOid, long? betreuungsartOid)
|
|
{
|
|
DateTime startDate = new DateTime(year, 1, 1);
|
|
|
|
return Create(startDate, startDate.AddYears(1), orgOid, teamOid, betreuungsartOid);
|
|
|
|
}
|
|
|
|
public static JahresReportRO Create(DateTime start, DateTime end, long? orgOid, long? teamOid, long? betreuungsartOid)
|
|
{
|
|
AnalysisServiceImp service = new AnalysisServiceImp();
|
|
|
|
var list = service.CreateAnnualReport(orgOid, teamOid, betreuungsartOid, start, end);
|
|
|
|
var ro = Create(list);
|
|
ro.ReportStartDate = start;
|
|
ro.ReportEndDate = end;
|
|
|
|
return ro;
|
|
}
|
|
|
|
public static JahresReportRO Create(List<AnnualReportDC> annualReports)
|
|
{
|
|
var lResult = new JahresReportRO();
|
|
lResult.JahresReportTabelleList = new List<JahresReportTabelle>();
|
|
|
|
|
|
foreach (var item in annualReports)
|
|
{
|
|
JahresReportTabelle tabelle = new JahresReportTabelle();
|
|
tabelle.JahresReportDetailList = new List<JahresReportDetail>();
|
|
tabelle.Name = item.Name;
|
|
lResult.JahresReportTabelleList.Add(tabelle);
|
|
|
|
//int MaenlichVar = 0;
|
|
//int WeiblichVar = 0;
|
|
//int anzVar = 0;
|
|
|
|
|
|
foreach (var data in item.Data)
|
|
{
|
|
JahresReportDetail detail = new JahresReportDetail();
|
|
detail.Name = data.Name;
|
|
detail.MaennlichAnzahl = (int)data.Male;
|
|
|
|
//MaenlichVar += detail.MaennlichAnzahl;
|
|
detail.WeiblichAnzahl = (int)data.Female;
|
|
|
|
detail.DiversAnzahl = (int)data.Divers;
|
|
detail.NoSexAnzahl = (int)data.NoSex;
|
|
|
|
//WeiblichVar += detail.WeiblichAnzahl;
|
|
detail.Anzahl = data.Value.HasValue ? (int)data.Value : 0;
|
|
|
|
detail.Custom1 = data.Value1;
|
|
detail.Custom2 = data.Value2;
|
|
detail.Custom3 = data.Value3;
|
|
detail.Custom4 = data.Value4;
|
|
detail.Custom5 = data.Value5;
|
|
detail.Custom6 = data.Value6;
|
|
detail.Custom7 = data.Value7;
|
|
detail.Custom8 = data.Value8;
|
|
detail.Custom9 = data.Value9;
|
|
detail.Custom10 = data.Value10;
|
|
|
|
detail.CustomerNames = data.CustomerNames;
|
|
|
|
if (data.CustomerNames != null)
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
foreach (var name in data.CustomerNames.OrderBy(s => s))
|
|
{
|
|
if (sb.Length > 0)
|
|
sb.Append("; ");
|
|
sb.Append(name);
|
|
}
|
|
detail.AllCustomerString = sb.ToString();
|
|
}
|
|
//wert
|
|
//anzVar += detail.Anzahl;
|
|
tabelle.JahresReportDetailList.Add(detail);
|
|
}
|
|
//--------- Hier muss der BAr chat code hin -----------------------------
|
|
/*ChartControl sideBySideBarChart = new ChartControl();
|
|
|
|
// Create the first side-by-side bar series and add points to it.
|
|
Series series1 = new Series("Side-by-Side Bar Series 1", ViewType.Bar);
|
|
series1.Points.Add(new SeriesPoint("Anzahl", new double[] { anzVar }));
|
|
series1.Points.Add(new SeriesPoint("Weiblich", new double[] { WeiblichVar }));
|
|
series1.Points.Add(new SeriesPoint("Männlich", new double[] { MaenlichVar }));
|
|
|
|
// Add the series to the chart.
|
|
sideBySideBarChart.Series.Add(series1);
|
|
|
|
// Hide the legend (if necessary).
|
|
sideBySideBarChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.true;
|
|
|
|
// Rotate the diagram (if necessary).
|
|
((XYDiagram)sideBySideBarChart.Diagram).Rotated = true;
|
|
|
|
// Add a title to the chart (if necessary).
|
|
ChartTitle chartTitle1 = new ChartTitle();
|
|
chartTitle1.Text = "Voll was Los";
|
|
sideBySideBarChart.Titles.Add(chartTitle1);
|
|
|
|
// Add the chart to the form.
|
|
sideBySideBarChart.Dock = DockStyle.Fill;
|
|
this.Controls.Add(sideBySideBarChart);
|
|
*/
|
|
//-----------------------------------------------------------------------
|
|
}
|
|
return lResult;
|
|
}
|
|
|
|
//----------------------- Code fÜR EIN BAR Chart Beispiel------------------------------//
|
|
/*
|
|
public void Form1_Load(object sender, EventArgs e) {
|
|
// Create an empty chart.
|
|
ChartControl sideBySideBarChart = new ChartControl();
|
|
|
|
// Create the first side-by-side bar series and add points to it.
|
|
Series series1 = new Series("Side-by-Side Bar Series 1", ViewType.Bar);
|
|
series1.Points.Add(new SeriesPoint("A", new double[] { 10 }));
|
|
series1.Points.Add(new SeriesPoint("B", new double[] { 12 }));
|
|
series1.Points.Add(new SeriesPoint("C", new double[] { 14 }));
|
|
series1.Points.Add(new SeriesPoint("D", new double[] { 17 }));
|
|
|
|
// Create the second side-by-side bar series and add points to it.
|
|
Series series2 = new Series("Side-by-Side Bar Series 2", ViewType.Bar);
|
|
series2.Points.Add(new SeriesPoint("A", new double[] { 15 }));
|
|
series2.Points.Add(new SeriesPoint("B", new double[] { 18 }));
|
|
series2.Points.Add(new SeriesPoint("C", new double[] { 25 }));
|
|
series2.Points.Add(new SeriesPoint("D", new double[] { 33 }));
|
|
|
|
// Add the series to the chart.
|
|
sideBySideBarChart.Series.Add(series1);
|
|
sideBySideBarChart.Series.Add(series2);
|
|
|
|
// Hide the legend (if necessary).
|
|
sideBySideBarChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
|
|
|
|
// Rotate the diagram (if necessary).
|
|
((XYDiagram)sideBySideBarChart.Diagram).Rotated = true;
|
|
|
|
// Add a title to the chart (if necessary).
|
|
ChartTitle chartTitle1 = new ChartTitle();
|
|
chartTitle1.Text = "Side-by-Side Bar Chart";
|
|
sideBySideBarChart.Titles.Add(chartTitle1);
|
|
|
|
// Add the chart to the form.
|
|
sideBySideBarChart.Dock = DockStyle.Fill;
|
|
this.Controls.Add(sideBySideBarChart);
|
|
}
|
|
*/
|
|
|
|
}
|
|
}
|
|
|