return一个类,没有值(不知道怎么说...小白)部分代码如下:
////////////model/////////////
public class WorkStaff
{
#region Model
private int _WPId;
public int WPId
{
get { return _WPId; }
set { _WPId = value; }
}
private string _Guid;
public string Guid
{
get { return _Guid; }
set { _Guid = value; }
}
private string _OwnGuid;
public string OwnGuid
{
get { return _OwnGuid; }
set { _OwnGuid = value; }
}
private string _WPName;
public string WPName
{
get { return _WPName; }
set { _WPName = value; }
}
}
/////////////dal/////////////////////////
public WorkStaff WSShow(WorkStaff wsmodel)
{
WorkStaff wsinfo = new WorkStaff();
SqlParameter[] sp =
{
new SqlParameter("@WPName",SqlDbType.VarChar,50)
};
sp[0].Value = wsmodel.WPName;
DataSet ds = DbManager.Static_ExcuteQueryDataByProc("Proc_tbl_WorkPeople_GetModel_V1", sp);
#region
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["WPId"].ToString() != "")
{
wsinfo.WPId = int.Parse(ds.Tables[0].Rows[0]["WPId"].ToString());
}
wsinfo.Guid = ds.Tables[0].Rows[0]["Guid"].ToString();
wsinfo.OwnGuid = ds.Tables[0].Rows[0]["OwnGuid"].ToString();
wsinfo.WPName = ds.Tables[0].Rows[0]["WPName"].ToString();
wsinfo.WPPassWord = ds.Tables[0].Rows[0]["WPPassWord"].ToString();
wsinfo.WPRealName = ds.Tables[0].Rows[0]["WPRealName"].ToString();
}
return wsinfo; 这里返回正常
}
//////////////bll///////////////////////
public WorkStaff WSShow(WorkStaff wsmodel)
{
return wsdal.WSShow(wsmodel); 这里获取不了
}
//////////////ui////////////////////
private void EditBind(string name)
{
WorkStaff wsmodel = new WorkStaff();
WorkStaffbll wsbll = new WorkStaffbll();
wsmodel.WPName = name;
wsbll.WSShow(wsmodel);
this.WPName.Text = wsmodel.WPName;//账号
this.WPRealName.Text = wsmodel.WPRealName; //姓名
this.WPStatus.SelectedValue = wsmodel.WPStatus.ToString();//状态
}