Basf_TCC11/HJGL/FineUIPro.Web/WelderManage/WelderManageView.aspx.cs

79 lines
3.1 KiB
C#

using System;
namespace FineUIPro.Web.WelderManage
{
public partial class WelderManageView : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string welderId = Request.Params["WelderId"];
if (!string.IsNullOrEmpty(welderId))
{
Model.Welder_Welder welder = BLL.WelderService.GetWelderById(welderId);
if (welder != null)
{
this.txtWelderCode.Text = welder.WelderCode;
this.txtWelderName.Text = welder.WelderName;
if (!string.IsNullOrEmpty(welder.UnitId))
{
this.txtUnitName.Text = BLL.Base_UnitService.GetUnitNameByUnitId(welder.UnitId);
}
this.rblSex.SelectedValue = welder.Sex;
if (welder.Birthday.HasValue)
{
this.txtBirthday.Text = string.Format("{0:yyyy-MM-dd}", welder.Birthday);
}
this.txtIdentityCard.Text = welder.IdentityCard;
this.txtCertificateNum.Text = welder.CertificateNum;
if (welder.CertificateValidity.HasValue)
{
this.txtCertificateValidity.Text = string.Format("{0:yyyy-MM-dd}", welder.CertificateValidity);
}
this.txtWelderLevel.Text = welder.WelderLevel;
if (welder.IsOnDuty == true)
{
cbIsOnDuty.Checked = true;
}
else
{
cbIsOnDuty.Checked = false;
}
this.txtRemark.Text = welder.Remark;
if (!string.IsNullOrEmpty(welder.PhotoUrl))
{
this.Image1.ImageUrl = "~/" + welder.PhotoUrl;
}
}
}
}
}
#endregion
#region
/// <summary>
/// 上传附件资源
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
string edit = "0";
string welderId = Request.Params["WelderId"];
if (!string.IsNullOrEmpty(welderId))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/WelderManage&menuId={1}&edit={2}", welderId, BLL.Const.WelderManageMenuId, edit)));
}
}
#endregion
}
}