Basf_TCC7/HJGL/FineUIPro.Web/common/BaseInfo/UnitView.aspx.cs

48 lines
1.7 KiB
C#

using System;
using System.Linq;
using BLL;
namespace FineUIPro.Web.common.BaseInfo
{
public partial class UnitView : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
btnClose.OnClientClick = ActiveWindow.GetHideReference();
string unitId = Request.Params["UnitId"];
if (!string.IsNullOrEmpty(unitId))
{
var unit = BLL.Base_UnitService.GetUnit(unitId);
if (unit != null)
{
this.txtUnitCode.Text = unit.UnitCode;
this.txtUnitName.Text = unit.UnitName;
this.txtCorporate.Text = unit.Corporate;
this.txtTelephone.Text = unit.Telephone;
this.txtFax.Text = unit.Fax;
this.txtAddress.Text = unit.Address;
this.txtProjectRange.Text = unit.ProjectRange;
if (!string.IsNullOrEmpty(unit.UnitTypeId))
{
var unitType = (from x in Funs.DB.Base_UnitType where x.UnitTypeId == unit.UnitTypeId select x).FirstOrDefault();
if (unitType!=null)
{
this.txtUnitType.Text = unitType.UnitTypeName;
}
}
}
}
}
}
#endregion
}
}