96 lines
3.2 KiB
C#
96 lines
3.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using BS.Shared.Core;
|
|
using DevExpress.XtraReports.UI;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace InputFamilienhilfe
|
|
{
|
|
public partial class StundennachweisBetrUmgang : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
{
|
|
public StundennachweisBetrUmgang()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
{
|
|
if (pRO.Services != null)
|
|
{
|
|
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
|
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
|
|
{
|
|
if (s.IsBillable)
|
|
{
|
|
ServicesOverviewRO.CreateSignatureString(s);
|
|
|
|
s.ServiceCategoryAbbr = "";
|
|
|
|
ServicesOverviewRO.CreateGoalList(s);
|
|
|
|
if (String.IsNullOrEmpty(s.Notice))
|
|
{
|
|
s.Notice = s.GoalList;
|
|
}
|
|
else
|
|
{
|
|
s.Notice = String.Format("{0}\r\n{1}", s.Notice, s.GoalList);
|
|
}
|
|
// String firstLine = "";
|
|
//if (!String.IsNullOrEmpty(s.Notice))
|
|
//{
|
|
// if (s.Notice.IndexOf(Environment.NewLine) >= 0)
|
|
// firstLine = s.Notice.Substring(0, s.Notice.IndexOf(Environment.NewLine));
|
|
// else
|
|
// firstLine = s.Notice;
|
|
//}
|
|
//s.Notice = firstLine;
|
|
|
|
s.Notice4 = ""; // Familienkontakt
|
|
s.Notice5 = ""; // Kontakt zur Schule
|
|
|
|
servicesBillable.Add(s);
|
|
}
|
|
}
|
|
|
|
pRO.Services = servicesBillable;
|
|
}
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private void picSignature_BeforePrint(object sender, CancelEventArgs e)
|
|
{
|
|
XRPictureBox xrBox = sender as XRPictureBox;
|
|
//var test = this.GetCurrent
|
|
string base64String = xrBox.Tag as string;
|
|
if (!String.IsNullOrWhiteSpace(base64String))
|
|
{
|
|
var base64Data = Regex.Match(base64String, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
|
|
var binData = Convert.FromBase64String(base64Data);
|
|
Image img = ByteArrayToImage(binData);
|
|
xrBox.Image = Utils.CropImage(img);
|
|
}
|
|
else
|
|
{
|
|
xrBox.Image = null;
|
|
}
|
|
}
|
|
|
|
public Image ByteArrayToImage(byte[] byteArrayIn)
|
|
{
|
|
Image returnImage = null;
|
|
MemoryStream ms = new System.IO.MemoryStream(byteArrayIn);
|
|
returnImage = Image.FromStream(ms);
|
|
|
|
return returnImage;
|
|
}
|
|
}
|
|
}
|