SGGL_SHJ/SGGL/FineUIPro.Web/PHTGL/Filing/BidDocumentsStandingBookEdi...

170 lines
7.5 KiB
C#

using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
namespace FineUIPro.Web.PHTGL.Filing
{
public partial class BidDocumentsStandingBookEdit: PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string BidDocumentsStandingBookId
{
get
{
return (string)ViewState["BidDocumentsStandingBookId"];
}
set
{
ViewState["BidDocumentsStandingBookId"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
BLL.PHTGL_SetSubReviewService.InitGetSetSubCompleteDropDownList(DropSetSubReviewCode, this.CurrUser.PersonId, this.CurrUser.LoginProjectId, false);
////权限按钮方法
this.GetButtonPower();
this.BidDocumentsStandingBookId = Request.Params["BidDocumentsStandingBookId"];
if (!string.IsNullOrEmpty(this.BidDocumentsStandingBookId))
{
Model.PHTGL_BidDocumentsStandingBook model = BLL.BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(this.BidDocumentsStandingBookId);
if (model != null)
{
DropSetSubReviewCode.SelectedValue = model.SetSubReviewCode;
cbIsOnLine.Checked = model.IsOnLine==1?true:false;
txtShortListApprovalCode.Text= model.ShortListApprovalCode;
txtProposedInviter.Text=model.ProposedInviter;
txtApprovePersonFormCode.Text= model.ApprovePersonFormCode;
txtBidWinner.Text= model.BidWinner;
DropSetSubReviewCode_SelectedIndexChanged(null,null);
}
}
}
}
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
Model.PHTGL_BidDocumentsStandingBook table = new Model.PHTGL_BidDocumentsStandingBook();
table.IsOnLine = cbIsOnLine.Checked ? 1 : 0 ;
table.SetSubReviewCode = this.DropSetSubReviewCode.SelectedValue;
table.ShortListApprovalCode = this.txtShortListApprovalCode.Text;
table.ProposedInviter = this.txtProposedInviter.Text;
table.ApprovePersonFormCode = this.txtApprovePersonFormCode.Text;
table.BidWinner = this.txtBidWinner.Text;
if (string.IsNullOrEmpty(this.BidDocumentsStandingBookId))
{
table.BidDocumentsStandingBookId = SQLHelper.GetNewID(typeof(Model.PHTGL_BidDocumentsStandingBook));
BidDocumentsStandingBookId = table.BidDocumentsStandingBookId;
BLL.BidDocStandingBookService.AddPHTGL_BidDocumentsStandingBook(table);
}
else
{
var model= BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(BidDocumentsStandingBookId);
if (model!=null)
{
table.BidDocumentsStandingBookId = this.BidDocumentsStandingBookId;
BLL.BidDocStandingBookService.UpdatePHTGL_BidDocumentsStandingBook(table);
}
else
{
table.BidDocumentsStandingBookId = this.BidDocumentsStandingBookId;
BLL.BidDocStandingBookService.AddPHTGL_BidDocumentsStandingBook(table);
}
}
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.BidDocumentsStandingBookMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
#region
/// <summary>
/// 上传附件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(BidDocumentsStandingBookId))
{
BidDocumentsStandingBookId = Guid.NewGuid().ToString();
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId+ "-Notice", BLL.Const.BidDocumentsStandingBookMenuId)));
}
/// <summary>
/// 情况说明附件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrl_Remark_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(BidDocumentsStandingBookId))
{
BidDocumentsStandingBookId = Guid.NewGuid().ToString();
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId+ "-Bidder", BLL.Const.BidDocumentsStandingBookMenuId)));
}
#endregion
protected void DropSetSubReviewCode_SelectedIndexChanged(object sender, EventArgs e)
{
var _SetSub= BLL.PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewBySetSubReviewCode(DropSetSubReviewCode.SelectedValue);
var _BidApprove= PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(_SetSub.ApproveUserReviewID);
var _BidDoc = BLL.PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(_BidApprove.BidDocumentsReviewId);
var _ActPlan = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(_BidDoc.ActionPlanID);
var _Project=BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
this.txtEPCCode.Text = _ActPlan.EPCCode;
this.txtProjectShortName.Text = _Project.ShortName;
this.txtProjectCode.Text = _Project.ProjectCode;
this.txtBidType.Text = _BidDoc.BidType;
this.txtBidProject.Text = _ActPlan.BidProject;
this.txtActionPlanCode.Text = _ActPlan.ActionPlanCode;
this.txtBidDocumentsCode.Text = _BidDoc.BidDocumentsCode;
if (_BidDoc.Bidding_SendTime != null)
{
this.txtBidding_SendTime.Text = string.Format("{0:yyyy-MM-dd}", _BidDoc.Bidding_SendTime);
}
if (_BidDoc.Bidding_StartTime != null)
{
this.txtBidding_StartTime.Text = string.Format("{0:yyyy-MM-dd}", _BidDoc.Bidding_StartTime);
}
//this.txtApprovePersonFormCode.Text = model.ApprovePersonFormCode;
}
}
}