using BLL; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.CQMS.Information { public partial class StatementView : PageBase { #region 定义变量 /// /// 方案审查主键 /// public string StatementId { get { return (string)ViewState["StatementId"]; } set { ViewState["StatementId"] = value; } } #endregion #region 定义集合 /// /// 定义会签意见集合 /// public static List approves = new List(); #endregion public int ContactImg { get { return Convert.ToInt32(ViewState["ContactImg"]); } set { ViewState["ContactImg"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BLL.SecretLevelService.InitSecretLevelDropDownList(drpSecretLevel, true); UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true); ContactImg = 0; //CommonService.GetAllButtonList(CurrUser.LoginProjectId, CurrUser.UserId, Const.StatementMenuId); txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); StatementId = Request.Params["statementId"]; if (!string.IsNullOrWhiteSpace(StatementId)) { HFStatementId.Text = StatementId; Model.CQMS_Statement statement = StatementService.GetStatementByStatementId(StatementId); txtStatementCode.Text = statement.StatementCode; if (!string.IsNullOrEmpty(statement.SecretLevelId)) { drpSecretLevel.SelectedValue = statement.SecretLevelId; } if (!string.IsNullOrEmpty(statement.UnitId)) { drpUnit.SelectedValue = statement.UnitId; ConfirmFormService.InitConfirmFormList(drpConfirmFormId, this.CurrUser.LoginProjectId, string.Empty, true); } this.txtContractNo.Text = statement.ContractNo; this.txtTaskTheme.Text = statement.TaskTheme; if (!string.IsNullOrEmpty(statement.ConfirmFormId)) { this.drpConfirmFormId.SelectedValue = statement.ConfirmFormId; List list = new List(); Model.CQMS_ConfirmForm confirmForm = BLL.ConfirmFormService.GetConfirmFormByConfirmFormId(statement.ConfirmFormId); list.Add(confirmForm); drpConfirmFormId.DataValueField = "ConfirmFormId"; drpConfirmFormId.DataTextField = "ConfirmFormCode"; drpConfirmFormId.DataSource = list; drpConfirmFormId.DataBind(); } if (!string.IsNullOrEmpty(statement.ProductionSource)) { this.rblProductionSource.SelectedValue = statement.ProductionSource; } this.txtJobContent.Text = statement.JobContent; if (statement.CompileDate != null) { txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", statement.CompileDate); } if (statement.Edition != null) { txtEdition.Text = statement.Edition.ToString(); } bindApprove(); if (statement.PlanCost != null) { this.txtPlanCost.Text = statement.PlanCost.ToString(); } if (statement.AuditCost != null) { this.txtAuditCost.Text = statement.AuditCost.ToString(); } if (statement.RealCost != null) { this.txtRealCost.Text = statement.RealCost.ToString(); } } } } private void NoEdit() { txtStatementCode.Enabled = false; drpSecretLevel.Enabled = false; drpUnit.Enabled = false; txtContractNo.Enabled = false; txtTaskTheme.Enabled = false; txtJobContent.Enabled = false; rblProductionSource.Enabled = false; txtCompileDate.Enabled = false; txtEdition.Enabled = false; ContactImg = -1; } /// /// 审批列表 /// private void bindApprove() { var list = StatementApproveService.getListData(StatementId); gvApprove.DataSource = list; gvApprove.DataBind(); } public string man(Object man) { string appman = string.Empty; if (UserService.GetUserByUserId(man.ToString()) != null) { appman = UserService.GetUserByUserId(man.ToString()).UserName; } return appman; } protected void imgBtnFile_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(HFStatementId.Text)) //新增记录 { HFStatementId.Text = SQLHelper.GetNewID(typeof(Model.CQMS_Statement)); } PageContext.RegisterStartupScript(WindowAtt.GetShowReference( String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Statement&menuId={2}", -1, HFStatementId.Text, Const.StatementMenuId))); } protected void btnapprove_Click(object sender, EventArgs e) { //HFStatementId.Text var approve = StatementApproveService.GetStatementApproveByApproveMan(HFStatementId.Text, CurrUser.UserId); if (approve != null) { var approveId = approve.StatementApproveId; PageContext.RegisterStartupScript(WindowAtt.GetShowReference( String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Statement&menuId={2}", -1, approveId, Const.StatementMenuId))); } } protected void gvApprove_RowCommand(object sender, GridCommandEventArgs e) { object[] keys = gvApprove.DataKeys[e.RowIndex]; string fileId = string.Empty; if (keys == null) { return; } else { fileId = keys[0].ToString(); } PageContext.RegisterStartupScript(WindowAtt.GetShowReference( String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Statement&menuId={2}", -1, fileId, Const.StatementMenuId))); } } }