private void displaydetailinfo(string strID) { userLogin ul = new userLogin(); System.Data.DataTable dt = ul.getEditdata(strID); string strhtml = "空白详细信息"; if (dt != null && dt.Rows.Count > 0) { System.Data.DataRow r = dt.Rows[0]; strhtml = "<div style=\"line-height:27px;\">" + "姓名:" + r["fullname"].ToString().Trim() + "<br/>" + "部门:" + r["department"].ToString().Trim() + "<br/>" + "工号:" + r["staffno"].ToString().Trim() + "<br/>" + "账号:" + r["username"].ToString().Trim() + "<br/>" + "密码:" + r["password"].ToString().Trim() + "<br/>" + "性别:" + r["sex"].ToString().Trim() + "<br/>" + "生日:" + r["birdate"].ToString().Trim() + "<br/>" + "电话:" + r["telephone"].ToString().Trim() + "<br/>" + "<div style=\"word-break:break-all;\">地址:" + r["address"].ToString().Trim() + "</div>" + "注册人:" + r["regperson"].ToString().Trim() + "<br/>" + "日期:" + r["regdate"].ToString().Trim() + "<br/>" + "ID:" + r["ID"].ToString().Trim() + "<br/>" + "</div>"; } detailinfo.Text = strhtml; }
private void initinfo(string strID) { userLogin ul = new userLogin(); System.Data.DataTable dt = ul.getEditdata(strID); DataRow r = dt.Rows[0]; editID.Text = strID; fullname.Text = r["fullname"].ToString().Trim(); username.Text = r["username"].ToString().Trim(); password.Text = r["password"].ToString().Trim(); sex.SelectedValue = r["sex"].ToString().Trim(); department.SelectedValue = r["department"].ToString().Trim(); staffno.Text = r["staffno"].ToString().Trim(); DateTime seldate; if (System.DateTime.TryParse(r["birdate"].ToString().Trim(), out seldate)) { birdate.SelectedDate = seldate; } telephone.Text = r["telephone"].ToString().Trim(); address.Text = r["address"].ToString().Trim(); }