61 lines
1.8 KiB
C#
61 lines
1.8 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.IO;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using DevExpress.XtraReports.UI;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.Core;
|
|
using Image = System.Drawing.Image;
|
|
|
|
namespace BeWo.SeWo
|
|
{
|
|
public partial class Klientenstammblatt : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<CustomerDataRO>
|
|
{
|
|
public Klientenstammblatt()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(CustomerDataRO pRO)
|
|
{
|
|
var c = DAOFactory.GenericDAO.LoadByID<Customer>(pRO.CustomerOid);
|
|
|
|
lblBeginn.Text = String.Format("{0:dd.MM.yyyy}", c.AssistanceBegin);
|
|
lblMedication.Text = c.Medication;
|
|
lblAnmerkungen.Text = c.Diagnosis;
|
|
if (!String.IsNullOrEmpty(c.GradDerBehinderung))
|
|
lblGradDerBehinderung.Text = c.GradDerBehinderung + " %";
|
|
if (c.Pflegegrad.HasValue)
|
|
lblPflegegrad.Text = EnumTranslations.PflegegradTranslations[c.Pflegegrad];
|
|
|
|
SetPicture(c);
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private void SetPicture(Customer customer)
|
|
{
|
|
if (customer.Person.Images.Count > 0)
|
|
{
|
|
|
|
Image img = ByteArrayToImage(customer.Person.Images[0].Original);
|
|
|
|
xrPictureBox1.Image = img;
|
|
}
|
|
}
|
|
|
|
public Image ByteArrayToImage(byte[] byteArrayIn)
|
|
{
|
|
Image returnImage = null;
|
|
MemoryStream ms = new System.IO.MemoryStream(byteArrayIn);
|
|
returnImage = Image.FromStream(ms);
|
|
|
|
return returnImage;
|
|
}
|
|
|
|
}
|
|
}
|