213 lines
		
	
	
		
			8.4 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			213 lines
		
	
	
		
			8.4 KiB
		
	
	
	
		
			C#
		
	
	
	
| using BLL;
 | |
| using Model;
 | |
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Web;
 | |
| using System.Web.UI;
 | |
| using System.Web.UI.WebControls;
 | |
| using AspNet = System.Web.UI.WebControls;
 | |
| 
 | |
| namespace FineUIPro.Web.TestRun
 | |
| {
 | |
|     public partial class DriverSchemeView : PageBase
 | |
|     {
 | |
|         public string ConstructSolutionId
 | |
|         {
 | |
|             get
 | |
|             {
 | |
|                 return (string)ViewState["ConstructSolutionId"];
 | |
|             }
 | |
|             set
 | |
|             {
 | |
|                 ViewState["ConstructSolutionId"] = value;
 | |
|             }
 | |
|         }
 | |
|         protected void imgBtnFile_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
 | |
|             String.Format("../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}",
 | |
|             -1, ConstructSolutionId, Const.TestRunConstructSolutionMenuId)));
 | |
|         }
 | |
|         protected void Page_Load(object sender, EventArgs e)
 | |
|         {
 | |
|             if (!IsPostBack)
 | |
|             {
 | |
| 
 | |
|                 ConstructSolutionId = Request.Params["constructSolutionId"];
 | |
|                 if (!string.IsNullOrWhiteSpace(ConstructSolutionId))
 | |
|                 {
 | |
|                     txtProjectName.Text = ProjectService.GetProjectByProjectId(CurrUser.LoginProjectId).ProjectName;
 | |
|                     Model.Solution_TestRunConstructSolution constructSolution = TestRunConstructSolutionService.GetConstructSolutionByConstructSolutionId(ConstructSolutionId);
 | |
|                     txtCode.Text = constructSolution.Code;
 | |
|                     if (!string.IsNullOrEmpty(constructSolution.UnitId))
 | |
|                     {
 | |
|                         drpUnit.Text = UnitService.GetUnitNameByUnitId(constructSolution.UnitId);
 | |
|                     }
 | |
|                     if (!string.IsNullOrEmpty(constructSolution.SolutionType))
 | |
|                     {
 | |
|                         drpModelType.Text = TestRunConstructSolutionService.ConvertSolutionType(constructSolution.SolutionType);
 | |
|                     }
 | |
|                     if (constructSolution.SolutionType == "12")
 | |
|                     {
 | |
|                         this.txtUnitWork.Hidden = true;
 | |
|                         this.txtSystem.Hidden = true;
 | |
|                     }
 | |
|                     txtSystem.Text = constructSolution.System;
 | |
|                     if (constructSolution.CompileDate != null)
 | |
|                     {
 | |
|                         txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", constructSolution.CompileDate);
 | |
|                     }
 | |
|                     txtSolutionName.Text = constructSolution.SolutionName;
 | |
|                     if (!string.IsNullOrWhiteSpace(constructSolution.UnitWorkIds))
 | |
|                     {
 | |
|                         txtUnitWork.Text = constructSolution.UnitWorkIds;
 | |
| 
 | |
|                     }
 | |
|                     if (constructSolution.Edition != null)
 | |
|                     {
 | |
|                         txtEdition.Text = constructSolution.Edition.ToString();
 | |
|                     }
 | |
|                     txtDocContent.Text = HttpUtility.HtmlDecode(constructSolution.Content);
 | |
| 
 | |
|                     bindApprove();
 | |
|                     //BindXMRole();
 | |
|                     //var xmUserIds = TestRunConstructSolutionApproveService.GetUserIdsApprovesBySignType(ConstructSolutionId, "XM");
 | |
|                     //if (xmUserIds.Count > 0)
 | |
|                     //{
 | |
|                     //    SetCheck(trSixe, xmUserIds);
 | |
|                     //}
 | |
|                     if (!string.IsNullOrEmpty(Request.Params["see"]))
 | |
|                     {
 | |
|                         Model.Solution_TestRunConstructSolutionApprove approve = BLL.TestRunConstructSolutionApproveService.GetSee(ConstructSolutionId, this.CurrUser.UserId);
 | |
|                         if (approve != null)
 | |
|                         {
 | |
|                             approve.ApproveDate = DateTime.Now;
 | |
|                             BLL.TestRunConstructSolutionApproveService.UpdateConstructSolutionApprove(approve);
 | |
|                         }
 | |
|                     }
 | |
| 
 | |
|                     AddAttachTab();
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         #region 动态加载角色树
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 设置树的节点选择
 | |
|         /// </summary>
 | |
|         /// <param name="nodes"></param>
 | |
|         /// <param name="role"></param>
 | |
|         private void SetCheck(Tree tree, List<string> userIds)
 | |
|         {
 | |
|             foreach (TreeNode tn in tree.Nodes[0].Nodes)
 | |
|             {
 | |
|                 if (userIds.Contains(tn.NodeID))
 | |
|                 {
 | |
|                     tn.Checked = true;
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 判断是否有选择
 | |
|         /// </summary>
 | |
|         /// <param name="node"></param>
 | |
|         /// <returns></returns>
 | |
|         public Boolean nodesCheckd(Tree node)
 | |
|         {
 | |
|             bool res = false;
 | |
|             if (node.Nodes[0].Nodes.Count > 0)
 | |
|             {
 | |
|                 foreach (var item in node.Nodes[0].Nodes)
 | |
|                 {
 | |
|                     if (item.Checked)
 | |
|                     {
 | |
|                         res = true;
 | |
|                         break;
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
|             return res;
 | |
|         }
 | |
| 
 | |
|         //private void BindXMRole()
 | |
|         //{
 | |
| 
 | |
|         //    TreeNode rootNode = new TreeNode();//定义根节点
 | |
|         //    rootNode.Text = "项目经理";
 | |
|         //    rootNode.NodeID = "0";
 | |
|         //    rootNode.Expanded = true;
 | |
|         //    rootNode.EnableCheckEvent = true;
 | |
|         //    trSixe.Nodes.Add(rootNode);
 | |
|         //    trSixe.EnableCheckBox = true;
 | |
|         //    using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
 | |
|         //    {
 | |
|         //        var userList = from x in db.Sys_User
 | |
|         //                       join y in db.Project_ProjectUnit
 | |
|         //                       on x.UnitId equals y.UnitId
 | |
|         //                       join p in db.Project_ProjectUser
 | |
|         //                      on x.UserId equals p.UserId
 | |
|         //                       where p.RoleId.Contains(Const.ProjectManager)
 | |
|         //                       && y.UnitType == Const.ProjectUnitType_1 && p.ProjectId == CurrUser.LoginProjectId && y.ProjectId == CurrUser.LoginProjectId
 | |
|         //                       orderby x.UserCode
 | |
|         //                       select x;
 | |
|         //        foreach (var u in userList)
 | |
|         //        {
 | |
|         //            TreeNode roleNode = new TreeNode();
 | |
|         //            roleNode.Text = u.UserName;
 | |
|         //            roleNode.NodeID = u.UserId;
 | |
|         //            rootNode.Nodes.Add(roleNode);
 | |
|         //        }
 | |
|         //    }
 | |
|         //}
 | |
|         #endregion
 | |
|         /// <summary>
 | |
|         /// 审批列表
 | |
|         /// </summary>
 | |
|         private void bindApprove()
 | |
|         {
 | |
|             var list = TestRunConstructSolutionApproveService.getListData(ConstructSolutionId);
 | |
|             //var user = UserService.GetAllUserList(CurrUser.LoginProjectId);
 | |
|             gvApprove.DataSource = list;
 | |
|             gvApprove.DataBind();
 | |
|         }
 | |
|         private void AddAttachTab()
 | |
|         {
 | |
|             PageContext.RegisterStartupScript(TabStrip1.GetAddTabReference("dynamic_tab2",
 | |
|                 String.Format("../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}",
 | |
|                     -1, ConstructSolutionId, Const.TestRunConstructSolutionMenuId), "附件",
 | |
|                 IconHelper.GetIconUrl(Icon.Attach), false));
 | |
| 
 | |
|             // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/DocManage&menuId={1}", hdDocId.Text, Const.DocManageMenuId)));
 | |
|         }
 | |
| 
 | |
|         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 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/Solution&menuId={2}",
 | |
|                  -1, fileId, Const.TestRunConstructSolutionMenuId)));
 | |
|         }
 | |
|     }
 | |
| } |