168 lines
6.8 KiB
C#
168 lines
6.8 KiB
C#
using BLL;
|
|
using System;
|
|
using System.Linq;
|
|
|
|
namespace FineUIPro.Web.CQMS.Foreign
|
|
{
|
|
public partial class ITPListProjectEdit : PageBase
|
|
{
|
|
#region 加载
|
|
/// <summary>
|
|
/// 加载
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, false);
|
|
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, false);
|
|
CNProfessionalService.InitCNProfessionalDownList(drpCNProfessional, false);
|
|
var installation = Project_InstallationService.GetInstallationList(this.CurrUser.LoginProjectId);
|
|
this.drpInstalltion.DataTextField = "Text";
|
|
this.drpInstalltion.DataValueField = "Value";
|
|
drpInstalltion.DataSource = installation;
|
|
drpInstalltion.DataBind();
|
|
|
|
string itpListId = Request.Params["ITPListId"];
|
|
if (!string.IsNullOrEmpty(itpListId))
|
|
{
|
|
var itpList = BLL.ITPListProjectService.GetITPListProjectById(itpListId);
|
|
if (itpList != null)
|
|
{
|
|
|
|
if (!string.IsNullOrEmpty(itpList.UnitId))
|
|
{
|
|
this.drpUnit.SelectedValue = itpList.UnitId;
|
|
}
|
|
if (!string.IsNullOrEmpty(itpList.InstallationId))
|
|
{
|
|
this.drpInstalltion.SelectedValue = itpList.InstallationId;
|
|
}
|
|
if (!string.IsNullOrEmpty(itpList.UnitWorkId))
|
|
{
|
|
this.drpUnitWork.SelectedValue = itpList.UnitWorkId;
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(itpList.CNProfessionalCode))
|
|
{
|
|
this.drpCNProfessional.SelectedValue = itpList.CNProfessionalCode;
|
|
}
|
|
if (!string.IsNullOrEmpty(itpList.CheckLevel))
|
|
{
|
|
this.drpLevel.SelectedValue = itpList.CheckLevel;
|
|
}
|
|
|
|
this.txtFileType.Text = itpList.FileType;
|
|
this.txtContent.Text = itpList.CheckContent;
|
|
this.txtDocCode.Text = itpList.DocCode;
|
|
this.txtMemo.Text = itpList.Memo;
|
|
if (itpList.CheckDate.HasValue)
|
|
{
|
|
this.txtCheckDate.Text = itpList.CheckDate.Value.ToString("yyyy-MM-HH");
|
|
}
|
|
this.hdITPListId.Text = itpList.ITPListId;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
protected void drpInstalltion_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
//var installation = UnitWorkService.GetUnitWork(this.CurrUser.LoginProjectId,drpInstalltion.SelectedValue);
|
|
//this.drpUnitWork.Items.Clear();
|
|
//this.drpUnitWork.DataTextField = "Text";
|
|
//this.drpUnitWork.DataValueField = "Value";
|
|
//drpUnitWork.DataSource = installation;
|
|
//drpUnitWork.DataBind();
|
|
}
|
|
|
|
|
|
|
|
#region 保存
|
|
/// <summary>
|
|
/// 保存按钮
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
string itpListId = Request.Params["ITPListId"];
|
|
Model.CQMS_Foreign_ITPListProject newITPList = new Model.CQMS_Foreign_ITPListProject();
|
|
newITPList.ProjectId = this.CurrUser.LoginProjectId;
|
|
|
|
newITPList.CompileMan = this.CurrUser.UserId;
|
|
newITPList.CompileDate = DateTime.Now;
|
|
if (this.drpUnit.SelectedValue != Const._Null)
|
|
{
|
|
newITPList.UnitId = this.drpUnit.SelectedValue;
|
|
}
|
|
if (this.drpInstalltion.SelectedValue != Const._Null)
|
|
{
|
|
newITPList.InstallationId = this.drpInstalltion.SelectedValue;
|
|
}
|
|
|
|
if (this.drpUnitWork.SelectedValue != Const._Null)
|
|
{
|
|
newITPList.UnitWorkId = drpUnitWork.SelectedValue;
|
|
}
|
|
if (this.drpCNProfessional.SelectedValue != Const._Null)
|
|
{
|
|
newITPList.CNProfessionalCode = this.drpCNProfessional.SelectedValue;
|
|
}
|
|
if (!string.IsNullOrEmpty(this.drpLevel.SelectedValue))
|
|
{
|
|
newITPList.CheckLevel = this.drpLevel.SelectedValue;
|
|
}
|
|
newITPList.FileType = this.txtFileType.Text.Trim();
|
|
|
|
newITPList.CheckContent = this.txtContent.Text.Trim();
|
|
newITPList.DocCode = this.txtDocCode.Text.Trim();
|
|
newITPList.Memo = this.txtMemo.Text.Trim();
|
|
if (!string.IsNullOrEmpty(this.txtCheckDate.Text.Trim()))
|
|
{
|
|
newITPList.CheckDate = Convert.ToDateTime(this.txtCheckDate.Text.Trim());
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(itpListId))
|
|
{
|
|
newITPList.ITPListId = itpListId;
|
|
BLL.ITPListProjectService.UpdateITPListProject(newITPList);
|
|
}
|
|
else
|
|
{
|
|
if (!string.IsNullOrEmpty(this.hdITPListId.Text.Trim()))
|
|
{
|
|
newITPList.ITPListId = this.hdITPListId.Text.Trim();
|
|
}
|
|
else
|
|
{
|
|
newITPList.ITPListId = SQLHelper.GetNewID(typeof(Model.CQMS_Foreign_ITPListProject));
|
|
}
|
|
BLL.ITPListProjectService.AddITPListProject(newITPList);
|
|
}
|
|
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
}
|
|
#endregion
|
|
|
|
#region 附件上传
|
|
/// <summary>
|
|
/// 附件上传
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnAttach_Click(object sender, EventArgs e)
|
|
{
|
|
if (string.IsNullOrEmpty(this.hdITPListId.Text)) //新增记录
|
|
{
|
|
this.hdITPListId.Text = SQLHelper.GetNewID(typeof(Model.CQMS_Foreign_ITPListProject));
|
|
}
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/Foreign/ITPListProject&menuId={1}", this.hdITPListId.Text, BLL.Const.ITPListProjectMenuId)));
|
|
}
|
|
#endregion
|
|
}
|
|
} |