fix:危大工程
This commit is contained in:
@@ -34,6 +34,8 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();
|
||||
//类型
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpHazardType, ConstValue.Group_LargerHazardType, true);
|
||||
BLL.UnitWorkService.InitUnitWorkDownList(this.drpUnitWorkIds, this.CurrUser.LoginProjectId, false);
|
||||
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);
|
||||
BLL.UnitService.InitUnitDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
|
||||
@@ -62,6 +64,31 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
this.drpUnitWorkIds.SelectedValueArray = majorPlanApproval.UnitWorkId.Split(',');
|
||||
}
|
||||
if (majorPlanApproval.ExpectedTime != null)
|
||||
{
|
||||
this.txtExpectedTime.Text = string.Format("{0:yyyy-MM-dd}", majorPlanApproval.ExpectedTime);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(majorPlanApproval.SchemeType))
|
||||
{
|
||||
this.drpSchemeType.SelectedValue = majorPlanApproval.SchemeType;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(majorPlanApproval.HazardType))
|
||||
{
|
||||
this.drpHazardType.SelectedValue = majorPlanApproval.HazardType;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(majorPlanApproval.States))
|
||||
{
|
||||
this.drpStates.SelectedValue = majorPlanApproval.States;
|
||||
}
|
||||
|
||||
this.AttachUrl1.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_1"));
|
||||
this.AttachUrl2.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_2"));
|
||||
this.AttachUrl3.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_3"));
|
||||
this.AttachUrl4.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_4"));
|
||||
this.AttachUrl5.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_5"));
|
||||
this.AttachUrl6.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_6"));
|
||||
|
||||
this.txtTrainPersonNum.Text = majorPlanApproval.TrainPersonNum.HasValue ? majorPlanApproval.TrainPersonNum.ToString() : "";
|
||||
this.txtAuditMan.Text = majorPlanApproval.AuditMan;
|
||||
this.txtApprovalMan.Text = majorPlanApproval.ApprovalMan;
|
||||
//this.txtImplementationDeviation.Text = majorPlanApproval.ImplementationDeviation;
|
||||
@@ -72,6 +99,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
else
|
||||
{
|
||||
this.txtApprovalDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.txtExpectedTime.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,6 +125,79 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
return;
|
||||
}
|
||||
Model.Comprehensive_MajorPlanApproval majorPlanApproval = new Model.Comprehensive_MajorPlanApproval();
|
||||
if (drpHazardType.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择类型!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtExpectedTime.Text))
|
||||
{
|
||||
majorPlanApproval.ExpectedTime = Convert.ToDateTime(this.txtExpectedTime.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
majorPlanApproval.ExpectedTime = DateTime.Now;
|
||||
}
|
||||
|
||||
if (this.drpSchemeType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
majorPlanApproval.SchemeType = this.drpSchemeType.SelectedValue;
|
||||
}
|
||||
|
||||
if (this.drpHazardType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
majorPlanApproval.HazardType = this.drpHazardType.SelectedValue;
|
||||
}
|
||||
|
||||
if (this.drpStates.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
majorPlanApproval.States = this.drpStates.SelectedValue;
|
||||
}
|
||||
majorPlanApproval.TrainPersonNum = Funs.GetNewInt(this.txtTrainPersonNum.Text.Trim());
|
||||
|
||||
|
||||
if (this.drpStates.SelectedValue != "1")
|
||||
{
|
||||
//判断附件是否必传
|
||||
if (!returnFj(this.hdAttachUrl.Text + "_1"))
|
||||
{
|
||||
Alert.ShowInTop("请上传附件1-论证后的方案", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!returnFj(this.hdAttachUrl.Text + "_2"))
|
||||
{
|
||||
Alert.ShowInTop("请上传附件2-专家论证报告", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!returnFj(this.hdAttachUrl.Text + "_3"))
|
||||
{
|
||||
Alert.ShowInTop("请上传附件3-论证会签到表", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!returnFj(this.hdAttachUrl.Text + "_4"))
|
||||
{
|
||||
Alert.ShowInTop("请上传附件4-论证会会议照片", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!returnFj(this.hdAttachUrl.Text + "_5"))
|
||||
{
|
||||
Alert.ShowInTop("请上传附件5-方案交底记录", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!returnFj(this.hdAttachUrl.Text + "_6"))
|
||||
{
|
||||
Alert.ShowInTop("请上传附件6-方案交底会议照片", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
majorPlanApproval.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
@@ -171,11 +272,96 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// <param name="e"></param>
|
||||
protected void btnAttach_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
|
||||
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
|
||||
{
|
||||
this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.Comprehensive_MajorPlanApproval));
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}", this.hdAttachUrl.Text, BLL.Const.MajorPlanApprovalMenuId)));
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_1", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click2(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
|
||||
{
|
||||
this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.Comprehensive_MajorPlanApproval));
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_2", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click3(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
|
||||
{
|
||||
this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.Comprehensive_MajorPlanApproval));
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_3", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click4(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
|
||||
{
|
||||
this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.Comprehensive_MajorPlanApproval));
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_4", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click5(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
|
||||
{
|
||||
this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.Comprehensive_MajorPlanApproval));
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_5", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click6(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
|
||||
{
|
||||
this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.Comprehensive_MajorPlanApproval));
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_6", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
private bool returnFj(string id) {
|
||||
bool isT = true;
|
||||
var model = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == id);
|
||||
if (model==null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return isT;
|
||||
}
|
||||
|
||||
private string getUrl(string id)
|
||||
{
|
||||
string url = string.Empty;
|
||||
var model = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == id);
|
||||
if (model != null)
|
||||
{
|
||||
url = model.AttachUrl;
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user