138 lines
4.9 KiB
C#
138 lines
4.9 KiB
C#
using BLL;
|
|
using System;
|
|
|
|
namespace FineUIPro.Web.CQMS.Train
|
|
{
|
|
public partial class TrainRecordView : PageBase
|
|
{
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
public string TrainPlanId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["TrainPlanId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["TrainPlanId"] = value;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 办理类型
|
|
/// </summary>
|
|
public string State
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["State"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["State"] = value;
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
TrainPlanId = Request.Params["TrainPlanId"];
|
|
BLL.CQMSTrainObjectService.InitTrainObjectDropDownList(this.drpPlanTrainPersons, true);
|
|
BLL.SitePerson_PersonService.InitProjectUserListByProjectUnitTypeDropDownList(this.drpRealTrainPersons, this.CurrUser.LoginProjectId, Const.ProjectUnitType_1 + "," + Const.ProjectUnitType_2, true);
|
|
BLL.SitePerson_PersonService.InitSitePersonByUnitTypeRoletIdsDropDownList(this.drpHostMan, this.CurrUser.LoginProjectId, Const.ProjectUnitType_1, Const.QAManager + "," + Const.CQEngineer, true);
|
|
BLL.CQMSTrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true);
|
|
if (!string.IsNullOrEmpty(TrainPlanId))
|
|
{
|
|
Model.Train_TrainPlan TrainPlan = BLL.CQMS_TrainPlanService.GetTrainPlanByTrainPlanId(TrainPlanId);
|
|
hdId.Text = TrainPlanId;
|
|
if (!string.IsNullOrEmpty(TrainPlan.PlanTrainPersons))
|
|
{
|
|
this.drpPlanTrainPersons.SelectedValueArray = TrainPlan.PlanTrainPersons.Split(',');
|
|
}
|
|
if (TrainPlan.PlanTrainDate != null)
|
|
{
|
|
txtPlanTrainDate.Text = string.Format("{0:yyyy-MM-dd}", TrainPlan.PlanTrainDate);
|
|
}
|
|
if (!string.IsNullOrEmpty(TrainPlan.TrainTypeId))
|
|
{
|
|
this.drpTrainType.SelectedValue = TrainPlan.TrainTypeId;
|
|
}
|
|
if (!string.IsNullOrEmpty(TrainPlan.HostMan))
|
|
{
|
|
this.drpHostMan.SelectedValueArray = TrainPlan.HostMan.Split(',');
|
|
}
|
|
this.txtPlace.Text = TrainPlan.Place;
|
|
if (TrainPlan.RealTrainDate != null)
|
|
{
|
|
txtRealTrainDate.Text = string.Format("{0:yyyy-MM-dd}", TrainPlan.RealTrainDate);
|
|
}
|
|
if (TrainPlan.TeachHour != null)
|
|
{
|
|
txtTeachHour.Text = TrainPlan.TeachHour.ToString();
|
|
}
|
|
if (TrainPlan.TrainPersonNum != null)
|
|
{
|
|
txtTrainPersonNum.Text = TrainPlan.TrainPersonNum.ToString();
|
|
}
|
|
if (!string.IsNullOrEmpty(TrainPlan.RealTrainPersons))
|
|
{
|
|
this.drpRealTrainPersons.SelectedValueArray = TrainPlan.RealTrainPersons.Split(',');
|
|
}
|
|
this.txtTrainContent.Text = TrainPlan.TrainContent;
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 时间转换
|
|
/// </summary>
|
|
/// <param name="date"></param>
|
|
/// <returns></returns>
|
|
public string ConvertDate(object date)
|
|
{
|
|
if (date != null)
|
|
{
|
|
return string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(date));
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
protected void drpRealTrainPersons_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
int i = 0;
|
|
foreach (var item in this.drpRealTrainPersons.SelectedValueArray)
|
|
{
|
|
if (item != Const._Null)
|
|
{
|
|
i++;
|
|
}
|
|
}
|
|
this.txtTrainPersonNum.Text = i.ToString();
|
|
}
|
|
|
|
protected void imgBtnFile_Click(object sender, EventArgs e)
|
|
{
|
|
if (string.IsNullOrEmpty(hdId.Text))
|
|
{
|
|
hdId.Text = SQLHelper.GetNewID();
|
|
}
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CQMS/Train&menuId={1}", hdId.Text, BLL.Const.CQMSTrainPlanMenuId)));
|
|
}
|
|
}
|
|
} |