SGGL_SHJ/SGGL/FineUIPro.Web/Personal/PersonalInfo.aspx.cs

110 lines
4.0 KiB
C#

namespace FineUIPro.Web.Personal
{
using BLL;
using System;
using System.Linq;
public partial class PersonalInfo : PageBase
{
#region
/// <summary>
/// 照片附件路径
/// </summary>
public string PhotoAttachUrl
{
get
{
return (string)ViewState["PhotoAttachUrl"];
}
set
{
ViewState["PhotoAttachUrl"] = value;
}
}
#endregion
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
/// Tab1加载页面方法
this.Tab1LoadData();
if (this.CurrUser.PersonId == Const.hfnbdId)
{
this.btnCustomQuery.Hidden = false;
this.lbSystemVersion.Hidden = false;
this.lbSystemVersion.Text = Funs.SystemVersion;
}
}
}
#region Tab1
/// <summary>
/// Tab1加载页面方法
/// </summary>
private void Tab1LoadData()
{
var user = Person_PersonsService.GetPerson_PersonsById(this.CurrUser.PersonId);
if (user != null)
{
this.txtUserName.Text = user.PersonName;
this.txtUserCode.Text = user.JobNum;
var sexVules = BLL.ConstValue.drpConstItemList(ConstValue.Group_0002).FirstOrDefault(x => x.ConstValue == user.Sex);
if (sexVules != null)
{
this.drpSex.Text = sexVules.ConstText;
}
this.dpBirthDay.Text = string.Format("{0:yyyy-MM-dd}", user.Birthday);
var MarriageVules = BLL.ConstValue.drpConstItemList(ConstValue.Group_0003).FirstOrDefault(x => x.ConstValue == user.MaritalStatus);
if (MarriageVules != null)
{
this.drpMarriage.Text = MarriageVules.ConstText;
}
var NationVules = BLL.ConstValue.drpConstItemList(ConstValue.Group_0005).FirstOrDefault(x => x.ConstValue == user.Nation);
if (NationVules != null)
{
this.drpNation.Text = NationVules.ConstText;
}
var units = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == user.UnitId);
if (units != null)
{
this.drpUnit.Text = units.UnitName;
}
this.txtAccount.Text = user.Account;
this.txtIdentityCard.Text = user.IdentityCard;
this.txtEmail.Text = user.Email;
this.txtTelephone.Text = user.Telephone;
var EducationVules = BLL.ConstValue.drpConstItemList(ConstValue.Group_0004).FirstOrDefault(x => x.ConstValue == user.EduLevel);
if (EducationVules != null)
{
this.drpEducation.Text = EducationVules.ConstText;
}
this.txtHometown.Text = user.Address;
//var position = BLL.PositionService.GetPositionById(user.PositionId);
//if (position != null)
//{
// this.drpPosition.Text = position.PositionName;
//}
//this.txtPerformance.Text = user.Performance;
if (!string.IsNullOrEmpty(user.PhotoUrl))
{
this.PhotoAttachUrl = user.PhotoUrl;
this.Image1.ImageUrl = "~/" + this.PhotoAttachUrl;
}
}
}
#endregion
protected void btnCustomQuery_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../SysManage/CustomQuery.aspx"), "查询"));
}
}
}