196 lines
8.1 KiB
C#
196 lines
8.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using BLL;
|
|
using System.Linq;
|
|
|
|
namespace FineUIPro.Web.ZHGL.Plan
|
|
{
|
|
public partial class ActionPlanListView : PageBase
|
|
{
|
|
#region 定义项
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
public string ActionPlanListId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["ActionPlanListId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["ActionPlanListId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
|
var q = (from x in Funs.DB.Person_Persons where x.UnitId == Const.UnitId_SEDIN && x.DepartId == Const.Depart_constructionId && x.RoleIds != null && x.RoleIds != Const.NoOfficeRole && x.RoleIds != string.Empty && (!x.IsPost.HasValue || x.IsPost == true) orderby x.PersonName select x).ToList();
|
|
this.drpReviewMan.DataTextField = "PersonName";
|
|
this.drpReviewMan.DataValueField = "PersonId";
|
|
this.drpReviewMan.DataSource = q;
|
|
this.drpReviewMan.DataBind();
|
|
Funs.FineUIPleaseSelect(this.drpReviewMan);
|
|
this.drpPerson.DataTextField = "PersonName";
|
|
this.drpPerson.DataValueField = "PersonId";
|
|
this.drpPerson.DataSource = q;
|
|
this.drpPerson.DataBind();
|
|
Funs.FineUIPleaseSelect(this.drpPerson);
|
|
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
|
|
this.ActionPlanListId = Request.Params["ActionPlanListId"];
|
|
if (!string.IsNullOrEmpty(this.ActionPlanListId))
|
|
{
|
|
Model.ActionPlan_ActionPlanList actionPlanList = BLL.ActionPlanListService.GetActionPlanListById(this.ActionPlanListId);
|
|
if (actionPlanList != null)
|
|
{
|
|
///读取编号
|
|
this.txtActionPlanListCode.Text = actionPlanList.ActionPlanListCode;
|
|
this.txtActionPlanListName.Text = actionPlanList.ActionPlanListName;
|
|
this.txtVersionNo.Text = actionPlanList.VersionNo;
|
|
if (!string.IsNullOrEmpty(actionPlanList.ProjectType))
|
|
{
|
|
this.drpProjectType.SelectedValue = actionPlanList.ProjectType;
|
|
}
|
|
else
|
|
{
|
|
this.drpProjectType.Hidden = true;
|
|
}
|
|
this.drpCompileMan.Text = BLL.Person_PersonsService.GetPersonsNameById(actionPlanList.CompileMan);
|
|
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", actionPlanList.CompileDate);
|
|
if (actionPlanList.IsReview == true)
|
|
{
|
|
this.rblIsReview.SelectedValue = "True";
|
|
this.drpReviewMan.Hidden = false;
|
|
this.drpReviewMan.SelectedValue = actionPlanList.ReviewMan;
|
|
}
|
|
else if (actionPlanList.IsCompanyReview == true)
|
|
{
|
|
this.rblIsReview.SelectedValue = "True2";
|
|
}
|
|
else
|
|
{
|
|
this.rblIsReview.SelectedValue = "False";
|
|
this.drpPerson.Hidden = true;
|
|
}
|
|
if (!string.IsNullOrEmpty(actionPlanList.ProjectId))
|
|
{
|
|
this.drpProject.SelectedValue = actionPlanList.ProjectId;
|
|
}
|
|
List<string> list2 = BLL.ActionPlanListApproveService.GetReviewingPersonIds(this.ActionPlanListId);
|
|
if (list2.Count > 0)
|
|
{
|
|
this.drpPerson.SelectedValueArray = list2.ToArray();
|
|
}
|
|
if (actionPlanList.IsCompanyReview != null)
|
|
{
|
|
rblIsCompanyReview.Hidden = false;
|
|
if (actionPlanList.IsCompanyReview == true)
|
|
{
|
|
rblIsCompanyReview.SelectedValue = "True";
|
|
}
|
|
else
|
|
{
|
|
rblIsCompanyReview.SelectedValue = "False";
|
|
}
|
|
}
|
|
var list = ActionPlanListApproveService.getListData(ActionPlanListId);
|
|
gvApprove.DataSource = list;
|
|
gvApprove.DataBind();
|
|
var approves = BLL.ActionPlanListApproveService.GetReviewings(this.ActionPlanListId, actionPlanList.Edition.Value);
|
|
if (approves.Count == 0)
|
|
{
|
|
this.drpPerson.Hidden = true;
|
|
this.rblIsCompanyReview.Hidden = true;
|
|
}
|
|
WindowAtt_Close(null, null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public string man(Object man)
|
|
{
|
|
string appman = string.Empty;
|
|
if (Person_PersonsService.GetPerson_PersonsById(man.ToString()) != null)
|
|
{
|
|
appman = Person_PersonsService.GetPerson_PersonsById(man.ToString()).PersonName;
|
|
}
|
|
return appman;
|
|
}
|
|
|
|
/// <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;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 附件上传
|
|
/// <summary>
|
|
/// 上传附件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(this.ActionPlanListId))
|
|
{
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ActionPlanListAttachUrl&menuId={1}&type=-1", this.ActionPlanListId, BLL.Const.ProjectActionPlanListMenuId)));
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
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/ActionPlanListAttachUrl&menuId={2}",
|
|
-1, fileId, Const.ProjectActionPlanListMenuId)));
|
|
}
|
|
|
|
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
|
{
|
|
this.divC.InnerHtml = string.Empty;
|
|
var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == this.ActionPlanListId);
|
|
if (getAtt != null)
|
|
{
|
|
this.divC.InnerHtml = UploadAttachmentService.ShowAttachment("../../", getAtt.AttachUrl);
|
|
}
|
|
else
|
|
{
|
|
this.trAtt.Hidden = true;
|
|
}
|
|
}
|
|
}
|
|
} |