我有一个不返回预期数据值的代码块。
protected void Page_Load(object sender, EventArgs e)
{
corpEmployee.Employee editEmp = new corpEmployee.Employee();
editEmp.EmployeeID = PatientCustomerID.Value;
corpCustomerMgr.GetEmployeeRecord(editEmp);
tboxFirstName.Text = editEmp.EmpFirstName.ToString();
tboxLastName.Text = editEmp.EmpLastName.ToString();
tboxCity.Text = editEmp.EmpCity.ToString();
tboxAddress.Text = editEmp.EmpAddrLine1.ToString();
}
public static void GetEmployeeRecord(corpEmployee.Employee QueryData)
{
try
{
List<corpEmployee.Employee> empRecord = new List<corpEmployee.Employee>();
corpCustomerDAL.GetEmployeeData(empRecord, QueryData);
}
catch (Exception ex)
{
LogAppError(ex.ToString());
}
}
执行时corpCustomerDAL.GetEmployeeData(empRecord, QueryData);
,empRecord 与具有正确属性值的 Employee 对象一起返回。但是,当代码返回时corpCustomerMgr.GetEmployeeRecord(editEmp);
,员工对象具有空值。
如何将 Employee 对象值返回给 Page_Load 例程?