SGGL_SHJ/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanListView.aspx.cs

186 lines
7.5 KiB
C#
Raw Normal View History

2023-06-01 17:14:29 +08:00
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();
2023-06-05 16:41:08 +08:00
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);
2023-07-04 10:55:01 +08:00
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
2023-06-01 17:14:29 +08:00
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
{
this.rblIsReview.SelectedValue = "False";
this.drpPerson.Hidden = true;
}
2023-07-04 10:55:01 +08:00
if (!string.IsNullOrEmpty(actionPlanList.ProjectId))
{
this.drpProject.SelectedValue = actionPlanList.ProjectId;
}
2023-06-01 17:14:29 +08:00
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();
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;
}
}
}
}