using System; using System.Collections; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Linq; using System.Net; using System.Web; using System.Web.Http; using System.Web.Http.Description; using iBemsDataService.Model; using iBemsDataService.Util; namespace iBemsDataService.Report { public partial class MonthlyReport : DevExpress.XtraReports.UI.XtraReport { private iBemsEntities db = new iBemsEntities(); public int MonthlyReportId { get; set; } public MonthlyReport() { InitializeComponent(); } protected override void OnBeforePrint(System.Drawing.Printing.PrintEventArgs e) { base.OnBeforePrint(e); var monthlyReport = db.FmsMonthlyReport .Where(a => a.MonthlyReportId == MonthlyReportId) .FirstOrDefault(); if (monthlyReport == null) { return; } this.lbDate.Text = monthlyReport.AddDate.ToString("yyyy-MM-dd (ddd요일)"); this.lbTeamName.Text = string.Format("ID = {0}", MonthlyReportId); this.lbTeamName.Text = monthlyReport.CmUser.CmDepartment.Name; this.xrCustomTask.Text = monthlyReport.Contents; } } }