60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Collections;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Web.UI.HtmlControls;
|
|
using GZTW.AyaNova.BLL;
|
|
|
|
public partial class ClientWorkorderView : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
string idstring = Request.QueryString["id"];
|
|
Guid oID = Guid.Empty;
|
|
if (!string.IsNullOrEmpty(idstring))
|
|
oID = new Guid(idstring);
|
|
else
|
|
throw new System.ApplicationException("ClientWorkorderView: Invalid ID param");
|
|
|
|
//Fetch the report to print
|
|
object o = null;
|
|
Report r = Report.GetItem(Util.IntegrationData.ClientWorkorderReportID);
|
|
string key=r.ReportKey;
|
|
|
|
if (key == WorkorderServiceList.ReportKey)
|
|
{
|
|
//It's a summary workorder report
|
|
o=WorkorderServiceList.GetListForSingleItem(oID);
|
|
}
|
|
else
|
|
{
|
|
//It's a detailed workorder report
|
|
o = WorkorderServiceDetailedReportData.GetItem(oID);
|
|
|
|
}
|
|
|
|
|
|
if (o != null)
|
|
{
|
|
Cache.Insert(Util.CurrentUserID.ToString() + key,
|
|
o,
|
|
null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(2));
|
|
|
|
string toUrl = "ReportView.aspx?rpt=" + r.ID + "&src=" + Util.CurrentUserID.ToString() + key;
|
|
Response.Redirect(toUrl);
|
|
}
|
|
|
|
else
|
|
Response.Write("Nothing to report");
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|