using BLL; using System; namespace FineUIPro.Web.PHTGL.Filing { public partial class BidDocumentsStandingBookEditProject : PageBase { #region /// /// 主键 /// 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.GetHideRefreshReference(); BLL.PHTGL_SetSubReviewService.InitGetSetSubCompleteDropDownList(DropSetSubReviewCode, this.CurrUser.PersonId, this.CurrUser.LoginProjectId, false); ////权限按钮方法 this.BidDocumentsStandingBookId = Request.Params["BidDocumentsStandingBookId"]; this.GetButtonPower(); if (!string.IsNullOrEmpty(this.BidDocumentsStandingBookId)) { Model.PHTGL_BidDocumentsStandingBook model = BLL.BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(this.BidDocumentsStandingBookId); if (model != null) { this.txtEPCCode.Text = model.EPCCode; this.txtProjectShortName.Text = model.ProjectShortName; this.txtProjectCode.Text = model.ProjectCode; this.txtIsOnLine.Text = model.IsOnLine; this.txtBidType.Text = model.BidType; this.txtActionPlanCode.Text = model.ActionPlanCode; this.txtBidDocumentsCode.Text = model.BidDocumentsCode; this.txtBidProject.Text = model.BidProject; this.txtShortListApprovalCode.Text = model.ShortListApprovalCode; this.txtProposedInviter.Text = model.ProposedInviter; this.txtBidding_SendTime.Text = model.Bidding_SendTime; this.txtBidding_StartTime.Text = model.Bidding_StartTime; this.txtApprovePersonFormCode.Text = model.ApprovePersonFormCode; this.txtBidWinner.Text = model.BidWinner; this.DropSetSubReviewCode.SelectedValue = model.SetSubReviewCode; this.txtBidNoticeCode.Text = model.BidNoticeCode; this.txtBidUnitFileCode.Text = model.BidUnitFileCode; } } } } #region 保存提交 /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { Model.PHTGL_BidDocumentsStandingBook table = new Model.PHTGL_BidDocumentsStandingBook(); table.UnitId = this.CurrUser.UnitId; table.DepartId = this.CurrUser.DepartId; table.EPCCode = this.txtEPCCode.Text; table.ProjectShortName = this.txtProjectShortName.Text; table.ProjectCode = this.txtProjectCode.Text; table.IsOnLine = this.txtIsOnLine.Text; table.BidType = this.txtBidType.Text; table.ActionPlanCode = this.txtActionPlanCode.Text; table.BidDocumentsCode = this.txtBidDocumentsCode.Text; table.BidProject = this.txtBidProject.Text; table.ShortListApprovalCode = this.txtShortListApprovalCode.Text; table.ProposedInviter = this.txtProposedInviter.Text; table.Bidding_SendTime = this.txtBidding_SendTime.Text; table.Bidding_StartTime = this.txtBidding_StartTime.Text; table.ApprovePersonFormCode = this.txtApprovePersonFormCode.Text; table.BidWinner = this.txtBidWinner.Text; table.SetSubReviewCode = DropSetSubReviewCode.SelectedValue; table.State = 0; table.BidNoticeCode = this.txtBidNoticeCode.Text; table.BidUnitFileCode = this.txtBidUnitFileCode.Text; table.ProjectId = this.CurrUser.LoginProjectId; if (string.IsNullOrEmpty(this.BidDocumentsStandingBookId)) { table.BidDocumentsStandingBookId = SQLHelper.GetNewID(typeof(Model.PHTGL_BidDocumentsStandingBook)); BidDocumentsStandingBookId = table.BidDocumentsStandingBookId; BLL.BidDocStandingBookService.AddPHTGL_BidDocumentsStandingBook(table); } else { table.BidDocumentsStandingBookId = this.BidDocumentsStandingBookId; var q = BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(table.BidDocumentsStandingBookId); if (q != null) { BLL.BidDocStandingBookService.UpdatePHTGL_BidDocumentsStandingBook(table); } else { BLL.BidDocStandingBookService.AddPHTGL_BidDocumentsStandingBook(table); } } ShowNotify("保存成功!", MessageBoxIcon.Success); // PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } protected void btnSubmit_Click(object sender, EventArgs e) { if (!BLL.AttachFileService.Getfile(BidDocumentsStandingBookId + "-BidUnit", BLL.Const.ProjectBidDocumentsStandingBookMenuId)) { ShowNotify("未上传中标单位投标文件,无法提交!", MessageBoxIcon.Warning); return; } if (!BLL.AttachFileService.Getfile(BidDocumentsStandingBookId + "-BidNotice", BLL.Const.ProjectBidDocumentsStandingBookMenuId)) { ShowNotify("未上传中标通知书,无法提交!", MessageBoxIcon.Warning); return; } if (!BLL.AttachFileService.Getfile(BidDocumentsStandingBookId + "-ActionPlan", BLL.Const.ProjectBidDocumentsStandingBookMenuId)) { ShowNotify("未上传实施计划文件,无法提交!", MessageBoxIcon.Warning); return; } if (!BLL.AttachFileService.Getfile(BidDocumentsStandingBookId + "-BidDocuments", BLL.Const.ProjectBidDocumentsStandingBookMenuId)) { ShowNotify("未上传招标文件,无法提交!", MessageBoxIcon.Warning); return; } if (!BLL.AttachFileService.Getfile(BidDocumentsStandingBookId + "-ApprovePersonForm", BLL.Const.ProjectBidDocumentsStandingBookMenuId)) { ShowNotify("未上传评委名单审批表文件,无法提交!", MessageBoxIcon.Warning); return; } if (!BLL.AttachFileService.Getfile(BidDocumentsStandingBookId + "-SetSubReview", BLL.Const.ProjectBidDocumentsStandingBookMenuId)) { ShowNotify("未上传确定中标人审批表文件,无法提交!", MessageBoxIcon.Warning); return; } if (!BLL.AttachFileService.Getfile(BidDocumentsStandingBookId + "-ShortListApproval", BLL.Const.ProjectBidDocumentsStandingBookMenuId)) { ShowNotify("未上传短名单审批表文件,无法提交!", MessageBoxIcon.Warning); return; } Model.PHTGL_BidDocumentsStandingBook table = new Model.PHTGL_BidDocumentsStandingBook(); table.UnitId = this.CurrUser.UnitId; table.DepartId = this.CurrUser.DepartId; table.EPCCode = this.txtEPCCode.Text; table.ProjectShortName = this.txtProjectShortName.Text; table.ProjectCode = this.txtProjectCode.Text; table.IsOnLine = this.txtIsOnLine.Text; table.BidType = this.txtBidType.Text; table.ActionPlanCode = this.txtActionPlanCode.Text; table.BidDocumentsCode = this.txtBidDocumentsCode.Text; table.BidProject = this.txtBidProject.Text; table.ShortListApprovalCode = this.txtShortListApprovalCode.Text; table.ProposedInviter = this.txtProposedInviter.Text; table.Bidding_SendTime = this.txtBidding_SendTime.Text; table.Bidding_StartTime = this.txtBidding_StartTime.Text; table.ApprovePersonFormCode = this.txtApprovePersonFormCode.Text; table.BidWinner = this.txtBidWinner.Text; table.SetSubReviewCode = DropSetSubReviewCode.SelectedValue; table.State = 1; table.BidNoticeCode = this.txtBidNoticeCode.Text; table.BidUnitFileCode = this.txtBidUnitFileCode.Text; table.ProjectId = this.CurrUser.LoginProjectId; if (string.IsNullOrEmpty(this.BidDocumentsStandingBookId)) { table.BidDocumentsStandingBookId = SQLHelper.GetNewID(typeof(Model.PHTGL_BidDocumentsStandingBook)); BLL.BidDocStandingBookService.AddPHTGL_BidDocumentsStandingBook(table); } else { table.BidDocumentsStandingBookId = this.BidDocumentsStandingBookId; var q = BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(table.BidDocumentsStandingBookId); if (q != null) { BLL.BidDocStandingBookService.UpdatePHTGL_BidDocumentsStandingBook(table); } else { BLL.BidDocStandingBookService.AddPHTGL_BidDocumentsStandingBook(table); } } PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } #endregion #region 获取按钮权限 /// /// 获取按钮权限 /// /// /// private void GetButtonPower() { if (!string.IsNullOrEmpty(BidDocumentsStandingBookId)) { var q = BLL.BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(BidDocumentsStandingBookId); if (q != null && q.State == 1) { btnSave.Hidden = true; btnSubmit.Hidden = true; } } } #endregion #region 附件上传 /// /// 中标单位投标文件 /// /// /// protected void btnAttachUrl_BidUnit_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(BidDocumentsStandingBookId)) { BidDocumentsStandingBookId = Guid.NewGuid().ToString(); } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId + "-BidUnit", BLL.Const.ProjectBidDocumentsStandingBookMenuId))); } /// /// 中标通知书 /// /// /// protected void btnAttachUrl_BidNotice_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(BidDocumentsStandingBookId)) { BidDocumentsStandingBookId = Guid.NewGuid().ToString(); } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId + "-BidNotice", BLL.Const.ProjectBidDocumentsStandingBookMenuId))); } /// /// 实施计划文件 /// /// /// protected void btnAttachUrl_ActionPlanCode_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(BidDocumentsStandingBookId)) { BidDocumentsStandingBookId = Guid.NewGuid().ToString(); } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId + "-ActionPlan", BLL.Const.ProjectBidDocumentsStandingBookMenuId))); } /// /// 招标文件 /// /// /// protected void btnAttachUrl_BidDocumentsCode_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(BidDocumentsStandingBookId)) { BidDocumentsStandingBookId = Guid.NewGuid().ToString(); } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId + "-BidDocuments", BLL.Const.ProjectBidDocumentsStandingBookMenuId))); } /// /// 评委名单审批表文件 /// /// /// protected void btnAttachUrl_ApprovePersonFormCode_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(BidDocumentsStandingBookId)) { BidDocumentsStandingBookId = Guid.NewGuid().ToString(); } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId + "-ApprovePersonForm", BLL.Const.ProjectBidDocumentsStandingBookMenuId))); } /// /// 确定中标人审批表文件 /// /// /// protected void btnAttachUrl_SetSubReviewCode_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(BidDocumentsStandingBookId)) { BidDocumentsStandingBookId = Guid.NewGuid().ToString(); } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId + "-SetSubReview", BLL.Const.ProjectBidDocumentsStandingBookMenuId))); } /// /// 短名单审批表文件 /// /// /// protected void btnAttachUrl_ShortListApprovalCode_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(BidDocumentsStandingBookId)) { BidDocumentsStandingBookId = Guid.NewGuid().ToString(); } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/BidDocumentsStandingBook&menuId={1}", this.BidDocumentsStandingBookId + "-ShortListApproval", BLL.Const.ProjectBidDocumentsStandingBookMenuId))); } #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(_BidDoc.ProjectId); 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; } } }