ZHJA_HJGL/HJGL_ZH/FineUIPro.Web/HJGL/WeldingManage/WeldingProcessCardFinalFile...

117 lines
4.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class WeldingProcessCardFinalFile :PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string MatchedProcedureMaterialId
{
get
{
return (string)ViewState["MatchedProcedureMaterialId"];
}
set
{
ViewState["MatchedProcedureMaterialId"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.drpSTE_ID1.DataValueField = "STE_ID";
this.drpSTE_ID1.DataTextField = "STE_Name";
this.drpSTE_ID1.DataSource = BLL.HJGL_MaterialService.GetSteelList();
this.drpSTE_ID1.DataBind();
Funs.FineUIPleaseSelect(this.drpSTE_ID1);
this.drpWeldingMethodId.DataValueField = "WME_ID";
this.drpWeldingMethodId.DataTextField = "WME_Name";
this.drpWeldingMethodId.DataSource = BLL.HJGL_WeldingMethodService.GetWeldMethodNameList();
this.drpWeldingMethodId.DataBind();
Funs.FineUIPleaseSelect(this.drpWeldingMethodId);
}
}
#region
/// <summary>
/// 提交按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
SaveData(true);
ShowNotify("提交成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
/// <summary>
/// 提交数据
/// </summary>
/// <param name="isClose"></param>
private void SaveData(bool isClose)
{
Model.HJGL_WeldingProcedure_MatchedProcedureMaterial match = new Model.HJGL_WeldingProcedure_MatchedProcedureMaterial();
match.ProjectId = this.CurrUser.LoginProjectId;
if (this.drpSTE_ID1.SelectedValue!=BLL.Const._Null)
{
match.STE_ID1 = this.drpSTE_ID1.SelectedValue;
}
match.Specifications=this.txtSpecifications.Text.Trim();
if (this.drpWeldingMethodId.SelectedValue!=BLL.Const._Null)
{
match.WeldingMethodId = this.drpWeldingMethodId.SelectedValue;
}
match.Flag = "1";
if (!string.IsNullOrEmpty(this.MatchedProcedureMaterialId))
{
match.MatchedProcedureMaterialId = this.MatchedProcedureMaterialId;
BLL.HJGL_MatchedProcedureMaterialService.UpdateMatchedProcedureMaterial(match);
}
else
{
this.MatchedProcedureMaterialId = SQLHelper.GetNewID(typeof(Model.HJGL_WeldingProcedure_MatchedProcedureMaterial));
match.MatchedProcedureMaterialId = this.MatchedProcedureMaterialId;
BLL.HJGL_MatchedProcedureMaterialService.AddMatchedProcedureMaterial(match);
}
}
#endregion
#region
/// <summary>
/// 上传附件资源
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
string edit = "0"; // 表示能打开附件上传窗口,但不能上传附件
string tokey = "";
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_WeldingProcessCardMenuId, BLL.Const.BtnSave))
{
if (string.IsNullOrEmpty(this.MatchedProcedureMaterialId))
{
SaveData(false);
}
tokey = this.MatchedProcedureMaterialId;
edit = "1";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HJGL/WeldingProcessCard&menuId={1}&edit={2}", tokey, Const.HJGL_WeldingProcessCardMenuId, edit)));
}
}
#endregion
}
}