增加项目策划、总包合同模块
This commit is contained in:
@@ -0,0 +1,216 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Plan
|
||||
{
|
||||
public partial class ProjectPlanView : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string ProjectPlanId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectPlanId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectPlanId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义会签意见集合
|
||||
/// </summary>
|
||||
public static List<Model.ActionPlan_ProjectPlanApprove> approves = new List<Model.ActionPlan_ProjectPlanApprove>();
|
||||
#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();
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.ProjectPlanId = Request.Params["ProjectPlanId"];
|
||||
ProjectService.InitAllProjectDropDownList(this.drpProject, true);
|
||||
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 select x).ToList();
|
||||
Model.ActionPlan_ProjectPlan ProjectPlan = BLL.ProjectPlanService.GetProjectPlanById(this.ProjectPlanId);
|
||||
if (ProjectPlan != null)
|
||||
{
|
||||
var compileMan = BLL.Person_PersonsService.GetPerson_PersonsById(ProjectPlan.CompileMan);
|
||||
if (compileMan != null)
|
||||
{
|
||||
q.Add(compileMan);
|
||||
}
|
||||
}
|
||||
this.drpCompileMan.DataTextField = "PersonName";
|
||||
this.drpCompileMan.DataValueField = "PersonId";
|
||||
this.drpCompileMan.DataSource = q;
|
||||
this.drpCompileMan.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpCompileMan);
|
||||
this.drpPerson.DataTextField = "PersonName";
|
||||
this.drpPerson.DataValueField = "PersonId";
|
||||
this.drpPerson.DataSource = q;
|
||||
this.drpPerson.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpPerson);
|
||||
if (!string.IsNullOrEmpty(this.ProjectPlanId))
|
||||
{
|
||||
if (ProjectPlan != null)
|
||||
{
|
||||
HFProjectPlanId.Text = this.ProjectPlanId;
|
||||
this.ProjectId = ProjectPlan.ProjectId;
|
||||
if (ProjectPlan.Edition != null)
|
||||
{
|
||||
txtEdition.Text = ProjectPlan.Edition.ToString();
|
||||
}
|
||||
///读取编号
|
||||
this.txtProjectPlanCode.Text = ProjectPlan.ProjectPlanCode;
|
||||
this.txtProjectPlanName.Text = ProjectPlan.ProjectPlanName;
|
||||
this.drpProject.SelectedValue = ProjectPlan.ProjectId;
|
||||
this.txtVersionNo.Text = ProjectPlan.VersionNo;
|
||||
if (!string.IsNullOrEmpty(ProjectPlan.ProjectType))
|
||||
{
|
||||
this.drpProjectType.SelectedValue = ProjectPlan.ProjectType;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpProjectType.Hidden = true;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ProjectPlan.CompileMan))
|
||||
{
|
||||
this.drpCompileMan.SelectedValue = ProjectPlan.CompileMan;
|
||||
}
|
||||
if (ProjectPlan.CompileDate != null)
|
||||
{
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ProjectPlan.CompileDate);
|
||||
}
|
||||
List<string> list = BLL.ProjectPlanApproveService.GetReviewingPersonIds(this.ProjectPlanId);
|
||||
if (list.Count > 0)
|
||||
{
|
||||
this.drpPerson.SelectedValueArray = list.ToArray();
|
||||
}
|
||||
bindApprove();
|
||||
}
|
||||
WindowAtt_Close(null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpCompileMan.SelectedValue = this.CurrUser.PersonId;
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.trAtt.Hidden = true;
|
||||
txtEdition.Text = "0";
|
||||
plApprove2.Hidden = true;
|
||||
////自动生成编码
|
||||
this.txtProjectPlanCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.OfficeProjectPlanMenuId, this.ProjectId, this.CurrUser.UnitId);
|
||||
this.txtProjectPlanName.Text = this.SimpleForm1.Title;
|
||||
this.txtVersionNo.Text = "V1.0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审批列表
|
||||
/// </summary>
|
||||
private void bindApprove()
|
||||
{
|
||||
var list = ProjectPlanApproveService.getListData(ProjectPlanId);
|
||||
gvApprove.DataSource = list;
|
||||
gvApprove.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(HFProjectPlanId.Text)) //新增记录
|
||||
{
|
||||
HFProjectPlanId.Text = SQLHelper.GetNewID(typeof(Model.ActionPlan_ProjectPlan));
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ProjectPlanAttachUrl&menuId={1}&type=-1", HFProjectPlanId.Text, BLL.Const.OfficeProjectPlanMenuId)));
|
||||
}
|
||||
|
||||
protected void btnapprove_Click(object sender, EventArgs e)
|
||||
{
|
||||
//HFConstructSolutionId.Text
|
||||
var approve = ProjectPlanApproveService.GetProjectPlanApproveByApproveMan(HFProjectPlanId.Text, CurrUser.PersonId);
|
||||
if (approve != null)
|
||||
{
|
||||
var approveId = approve.ProjectPlanApproveId;
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
|
||||
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/ProjectPlanAttachUrl&menuId={2}",
|
||||
0, approveId, Const.OfficeProjectPlanMenuId)));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
this.divC.InnerHtml = string.Empty;
|
||||
var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == HFProjectPlanId.Text);
|
||||
if (getAtt != null)
|
||||
{
|
||||
this.divC.InnerHtml = UploadAttachmentService.ShowAttachment("../../", getAtt.AttachUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.trAtt.Hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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/ProjectPlanAttachUrl&menuId={2}",
|
||||
-1, fileId, Const.OfficeProjectPlanMenuId)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user