CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/CQMS/QualityActivity/QCManage/QCGroupRegistrationView.asp...

130 lines
5.5 KiB
C#

using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using AspNet = System.Web.UI.WebControls;
namespace FineUIPro.Web.CQMS.QualityActivity.QCManage
{
public partial class QCGroupRegistrationView : PageBase
{
/// <summary>
/// 主键
/// </summary>
public string QCGroupRegistrationId
{
get
{
return (string)ViewState["QCGroupRegistrationId"];
}
set
{
ViewState["QCGroupRegistrationId"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// BLL.UnitService.InitProjectUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
BLL.UnitService.InitAllUnitDownList(this.drpUnitId, true);
QCGroupRegistrationId = Request.Params["QCGroupRegistrationId"];
if (!string.IsNullOrEmpty(QCGroupRegistrationId))
{
hdId.Text = this.QCGroupRegistrationId;
Model.QCManage_QCGroupRegistration QCGroupRegistration = BLL.QCManage_QCGroupRegistrationService.GetQCGroupRegistrationByQCGroupRegistrationId(QCGroupRegistrationId);
this.txtCode.Text = QCGroupRegistration.Code;
this.txtName.Text = QCGroupRegistration.Name;
if (!string.IsNullOrEmpty(QCGroupRegistration.CompileMan))
{
this.txtCompileMan.Text = UserService.GetUserNameByUserId(QCGroupRegistration.CompileMan);
}
if (QCGroupRegistration.CompileDate != null)
{
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", QCGroupRegistration.CompileDate);
}
if (!string.IsNullOrEmpty(QCGroupRegistration.UnitId))
{
this.drpUnitId.SelectedValue = QCGroupRegistration.UnitId;
}
txtSubjects.Text = QCGroupRegistration.Subjects;
txtProcess.Text = QCGroupRegistration.Process;
txtAchievement.Text = QCGroupRegistration.Achievement;
txtAwardName.Text = QCGroupRegistration.AwardName;
if (!string.IsNullOrEmpty(QCGroupRegistration.AwardType))
{
drpAwardType.SelectedValue = QCGroupRegistration.AwardType;
if (QCGroupRegistration.AwardType == "1") {
drpAwardLevel.Items.Add(new ListItem("鲁班奖", "1"));
drpAwardLevel.Items.Add(new ListItem("国优奖", "2"));
drpAwardLevel.Items.Add(new ListItem("省部级", "3"));
drpAwardLevel.Items.Add(new ListItem("市级", "4"));
}
else if (QCGroupRegistration.AwardType == "2") {
drpAwardLevel.Items.Add(new ListItem("省部级", "5"));
drpAwardLevel.Items.Add(new ListItem("集团级", "6"));
drpAwardLevel.Items.Add(new ListItem("企业级", "7"));
}
}
if (!string.IsNullOrEmpty(QCGroupRegistration.AwardLevel))
{
drpAwardLevel.SelectedValue = QCGroupRegistration.AwardLevel;
}
txtAwardingUnit.Text = QCGroupRegistration.AwardingUnit;
}
else
{
this.txtCompileMan.Text = this.CurrUser.UserName;
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
}
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
}
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
{
}
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/QCGroupRegistration&menuId={1}", hdId.Text, BLL.Const.ProjectQCGroupRegistrationListMenuId)));
}
protected void Change_AwardType(object sender, EventArgs eventArgs)
{
drpAwardLevel.Items.Clear();
drpAwardLevel.Items.Add(new ListItem("-请选择-", ""));
if (drpAwardType.SelectedValue == "1") {
drpAwardLevel.Items.Add(new ListItem("国家级", "1"));
drpAwardLevel.Items.Add(new ListItem("省部级", "2"));
drpAwardLevel.Items.Add(new ListItem("市级", "3"));
}
else if (drpAwardType.SelectedValue == "2") {
drpAwardLevel.Items.Add(new ListItem("省部级", "4"));
drpAwardLevel.Items.Add(new ListItem("集团级", "5"));
drpAwardLevel.Items.Add(new ListItem("企业级", "6"));
}
// 设置选中第一项
if (drpAwardLevel.Items.Count > 0)
{
drpAwardLevel.SelectedIndex = 0;
}
}
}
}