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 定义项 /// /// 主键 /// 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 提交 /// /// 提交按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { SaveData(true); ShowNotify("提交成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } /// /// 提交数据 /// /// 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 附件上传 /// /// 上传附件资源 /// /// /// 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 } }