154 lines
5.6 KiB
C#
154 lines
5.6 KiB
C#
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 WorkOrderView : PageBase
|
|
{
|
|
#region 定义变量
|
|
/// <summary>
|
|
/// 方案审查主键
|
|
/// </summary>
|
|
public string WorkOrderId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["WorkOrderId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["WorkOrderId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 定义集合
|
|
/// <summary>
|
|
/// 定义会签意见集合
|
|
/// </summary>
|
|
public static List<Model.CQMS_WorkOrderApprove> approves = new List<Model.CQMS_WorkOrderApprove>();
|
|
#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.WorkOrderMenuId);
|
|
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
|
WorkOrderId = Request.Params["workOrderId"];
|
|
if (!string.IsNullOrWhiteSpace(WorkOrderId))
|
|
{
|
|
HFWorkOrderId.Text = WorkOrderId;
|
|
Model.CQMS_WorkOrder workOrder = WorkOrderService.GetWorkOrderByWorkOrderId(WorkOrderId);
|
|
txtWorkOrderCode.Text = workOrder.WorkOrderCode;
|
|
if (!string.IsNullOrEmpty(workOrder.SecretLevelId))
|
|
{
|
|
drpSecretLevel.SelectedValue = workOrder.SecretLevelId;
|
|
}
|
|
if (!string.IsNullOrEmpty(workOrder.UnitId))
|
|
{
|
|
drpUnit.SelectedValue = workOrder.UnitId;
|
|
}
|
|
this.txtContractNo.Text = workOrder.ContractNo;
|
|
this.txtTaskTheme.Text = workOrder.TaskTheme;
|
|
this.txtContentDescription.Text = workOrder.ContentDescription;
|
|
this.txtImplementationRequirements.Text = workOrder.ImplementationRequirements;
|
|
if (workOrder.CompileDate != null)
|
|
{
|
|
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", workOrder.CompileDate);
|
|
}
|
|
if (workOrder.Edition != null)
|
|
{
|
|
txtEdition.Text = workOrder.Edition.ToString();
|
|
}
|
|
bindApprove();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 审批列表
|
|
/// </summary>
|
|
private void bindApprove()
|
|
{
|
|
var list = WorkOrderApproveService.getListData(WorkOrderId);
|
|
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(HFWorkOrderId.Text)) //新增记录
|
|
{
|
|
HFWorkOrderId.Text = SQLHelper.GetNewID(typeof(Model.CQMS_WorkOrder));
|
|
}
|
|
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
|
|
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/WorkOrder&menuId={2}",
|
|
-1, HFWorkOrderId.Text, Const.WorkOrderMenuId)));
|
|
}
|
|
|
|
protected void btnapprove_Click(object sender, EventArgs e)
|
|
{
|
|
//HFWorkOrderId.Text
|
|
var approve = WorkOrderApproveService.GetWorkOrderApproveByApproveMan(HFWorkOrderId.Text, CurrUser.UserId);
|
|
if (approve != null)
|
|
{
|
|
var approveId = approve.WorkOrderApproveId;
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
|
|
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/WorkOrder&menuId={2}",
|
|
-1, approveId, Const.WorkOrderMenuId)));
|
|
}
|
|
|
|
}
|
|
|
|
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/WorkOrder&menuId={2}",
|
|
-1, fileId, Const.WorkOrderMenuId)));
|
|
}
|
|
}
|
|
} |