protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["FormID"] == "")
{
return;
}
else
{
DataTable TransitionForm = Transition_TransitionReport.GetTransitionForm(Request.QueryString["FormID"]);
CrystalReportSource1.ReportDocument.SetDataSource(Transition_TransitionReport.GetTransitionForm(Request.QueryString["FormID"]));
//CrystalReportSource1.ReportDocument.SetDataSource(Transition_TransitionReport.GetEmpTransitionForm(Request.QueryString["FormID"]));
string aa = TransitionForm.Rows[0]["TransitionID"].ToString();
CrystalReportSource1.ReportDocument.ParameterFields["FormID"].CurrentValues.AddValue(TransitionForm.Rows[0]["TransitionID"].ToString());
CrystalReportSource1.ReportDocument.ParameterFields["InputName"].CurrentValues.AddValue(TransitionForm.Rows[0]["InputName"].ToString());
CrystalReportSource1.ReportDocument.ParameterFields["InputDate"].CurrentValues.AddValue(TransitionForm.Rows[0]["InputDate"].ToString());
CrystalReportSource1.DataBind();
CrystalReportViewer1.DataBind();
}
}
public static DataTable GetTransitionForm(string TransitionID)
{
Transition.HRTransitionService.HRTransitionService TransitionForm = new Transition.HRTransitionService.HRTransitionService();
Transition.EmpTransitionService.EmpTransitionService EmpTransitionForm = new Transition.EmpTransitionService.EmpTransitionService();
DataSet Form = TransitionForm.GetTransitionByID(TransitionID);
DataTable Table = new DataTable("TransitionForm");
int a = Form.Tables[0].Rows.Count;
return Form.Tables[0];
}
public static DataTable GetEmpTransitionForm(string TransitionID)
{
Transition.HRTransitionService.HRTransitionService TransitionForm = new Transition.HRTransitionService.HRTransitionService();
Transition.EmpTransitionService.EmpTransitionService EmpTransitionForm = new Transition.EmpTransitionService.EmpTransitionService();
DataSet Form = EmpTransitionForm.GetEmpTransitionByID(TransitionID);
DataTable Table = new DataTable("EmpTransitionForm");
Table.Columns.Add("TransitionID", typeof(string));
Table.Columns.Add("EmpID", typeof(string));
Table.Columns.Add("TransTypeID", typeof(string));
Table.Columns.Add("Reason", typeof(string));
Table.Columns.Add("Remark", typeof(string));
//int a = Form.Tables[0].Rows.Count;
//return Form.Tables[0];
foreach (DataRow Row in Form.Tables[0].Rows)
{
DataRow NewRow = Table.NewRow();
DataSet Set = EmpTransitionForm.GetEmpTransitionByID(Row["TransitionID"].ToString());
NewRow["TransitionID"] = Row["TransitionID"];
NewRow["EmpID"] = Row["EmpID"];
NewRow["TransTypeID"] = Row["TransTypeID"];
NewRow["Reason"] = Row["Reason"];
NewRow["Remark"] = Row["Remark"];
Table.Rows.Add(NewRow);
}
return Table;
}
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["FormID"] == "")
{
return;
}
else
{
DataSet TransitionFormSet = TransitionForm.GetTransitionByID (Request.QueryString["FormID"]);
DataSet EmpForms = EmpForm.GetEmpTransitionByID(Request.QueryString["FormID"]);
this.CrystalReportSource1.ReportDocument.SetDataSource(TransitionFormSet);
this.CrystalReportSource1.ReportDocument.Subreports["emptransition"].SetDataSource(EmpForms);
this.CrystalReportSource1.DataBind();
}
}
select case {EmpPublic.Sex}
case true
formula = "男"
case false
formula = "女"
End select