2023-03-24

This commit is contained in:
2023-03-24 15:57:37 +08:00
parent b1bdd30665
commit 06afe1aca0
22 changed files with 1373 additions and 273 deletions
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web.UI.DataVisualization.Charting;
namespace FineUIPro.Web.PHTGL.Filing
{
@@ -62,39 +63,11 @@ namespace FineUIPro.Web.PHTGL.Filing
/// </summary>
private void BindGrid()
{
string strSql = @"select
BidBook.BidDocumentsStandingBookId
,ActPlan.EPCCode
,Project.ShortName
,Project.ProjectCode
,(case IsOnLine
when '1' then '线上'
when '0'then '线下' end )as IsOnLine
,BidDoc.BidType
,ActPlan.ActionPlanCode
,BidDoc.BidDocumentsCode
,ActPlan.BidProject
,BidBook.ShortListApprovalCode
,BidBook.ProposedInviter
,BidDoc.Bidding_SendTime
,BidDoc.Bidding_StartTime
,BidBook.ApprovePersonFormCode
,BidBook.BidWinner
,SetSub.SetSubReviewCode
from PHTGL_BidDocumentsStandingBook as BidBook
left join PHTGL_SetSubReview as SetSub on SetSub.SetSubReviewCode=BidBook.SetSubReviewCode
left join PHTGL_BidApproveUserReview as BidUser on BidUser.ApproveUserReviewID =SetSub.ApproveUserReviewID
left join PHTGL_BidDocumentsReview as BidDoc on BidDoc.BidDocumentsReviewId= BidUser.BidDocumentsReviewId
left join PHTGL_ActionPlanFormation as ActPlan on ActPlan.ActionPlanID =BidDoc.ActionPlanID
left join Base_Project as Project on Project.ProjectId=ActPlan.ProjectID where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
Model.PHTGL_BidDocumentsStandingBook _BidDocumentsStandingBook = new Model.PHTGL_BidDocumentsStandingBook();
if (!(this.CurrUser.PersonId == Const.sysglyId || this.CurrUser.PersonId == Const.hfnbdId))
{
strSql += " and ActPlan.ProjectId =@ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
_BidDocumentsStandingBook.ProjectId = this.CurrUser.LoginProjectId;
}
if (!string.IsNullOrEmpty(drpDepartId.SelectedValue) )
{
@@ -103,21 +76,21 @@ namespace FineUIPro.Web.PHTGL.Filing
}
if (!string.IsNullOrEmpty(txtProjectCode.Text))
{
_BidDocumentsStandingBook.ProjectCode= txtProjectCode.Text;
}
if (!string.IsNullOrEmpty(txtShortName.Text))
{
_BidDocumentsStandingBook.ProjectShortName= txtShortName.Text;
}
if (!string.IsNullOrEmpty(txtContractNum.Text))
{
_BidDocumentsStandingBook.EPCCode= txtContractNum.Text;
}
if (!string.IsNullOrEmpty(txtContractName.Text))
{
}
var q= BLL.BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookByModle(_BidDocumentsStandingBook);
Grid1.RecordCount = q.Count;
Grid1.DataSource=q;
Grid1.DataBind();
}
#endregion
@@ -184,7 +157,7 @@ namespace FineUIPro.Web.PHTGL.Filing
txtShortName.Text = string.Empty;
txtContractNum.Text = string.Empty;
txtContractName.Text = string.Empty;
txtSubConstruction.Text = string.Empty;
//txtSubConstruction.Text = string.Empty;
}
#region
@@ -213,20 +186,21 @@ namespace FineUIPro.Web.PHTGL.Filing
/// </summary>
private void EditData()
{
//if (Grid1.SelectedRowIndexArray.Length == 0)
//{
// Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
// return;
//}
//string id = Grid1.SelectedRowID;
//var contract = BLL.ContractService.GetContractById(id);
//Model.PHTGL_Contract _Contract = BLL.ContractService.GetContractById(id);
//_Contract.ApproveState = 0;
//ContractService.UpdateContract(_Contract);
//if (contract != null)
//{
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContractFormationEdit.aspx?ContractId={0}", id, "编辑 - ")));
//}
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string id = Grid1.SelectedRowID;
var model=BLL.BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(id);
if (model != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("BidDocumentsStandingBookEdit.aspx?BidDocumentsStandingBookId={0}", id, "编辑 - ")));
}
}
protected void btnEdit_Click(object sender, EventArgs e)
{
EditData();
}
#endregion
@@ -318,10 +292,12 @@ namespace FineUIPro.Web.PHTGL.Filing
if (buttonList.Contains(Const.BtnModify))
{
// btnMenuEdit.Hidden = false;
btnEdit.Hidden = false;
}
if (buttonList.Contains(Const.BtnDelete))
{
// btnMenuDelete.Hidden = false;
btnDelete.Hidden = false;
}
}
}
@@ -388,5 +364,78 @@ namespace FineUIPro.Web.PHTGL.Filing
// return sb.ToString();
// }
#endregion
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("BidDocumentsStandingBookIn.aspx?", "导入 - ")));
}
public string ConvertState(object State)
{
string StateName = string.Empty;
if (State!=null&&!string.IsNullOrEmpty(State.ToString()))
{
switch (State.ToString())
{
case "0":
StateName = "未提交";
break;
case "1":
StateName = "已提交";
break;
default:
StateName = "未提交";
break;
}
}
else
{
StateName = "未提交";
}
return StateName;
}
protected void btnDelete_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
bool isShow = false;
if (Grid1.SelectedRowIndexArray.Length == 1)
{
isShow = true;
}
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
if (this.judgementDelete(rowID, isShow))
{
var p = BLL.BidDocStandingBookService.GetPHTGL_BidDocumentsStandingBookById(rowID);
if (p != null)
{
if (p.State==1)
{
ShowNotify(message: "已提交,删除失败!", MessageBoxIcon.Error);
return;
}
// BLL.LogService.AddSys_Log(this.CurrUser, p.ContractName, p.ContractId, BLL.Const.ContractMenuId, BLL.Const.BtnDelete);
BLL.BidDocStandingBookService.DeletePHTGL_BidDocumentsStandingBookById(rowID);
AttachFileService.DeleteAttachFile(Funs.RootPath, rowID + "-BidUnit", Const.BidDocumentsStandingBookMenuId);
AttachFileService.DeleteAttachFile(Funs.RootPath, rowID + "-BidNotice", Const.BidDocumentsStandingBookMenuId);
AttachFileService.DeleteAttachFile(Funs.RootPath, rowID + "-ActionPlan", Const.BidDocumentsStandingBookMenuId);
AttachFileService.DeleteAttachFile(Funs.RootPath, rowID + "-BidDocuments", Const.BidDocumentsStandingBookMenuId);
AttachFileService.DeleteAttachFile(Funs.RootPath, rowID + "-ApprovePersonForm", Const.BidDocumentsStandingBookMenuId);
AttachFileService.DeleteAttachFile(Funs.RootPath, rowID + "-SetSubReview", Const.BidDocumentsStandingBookMenuId);
AttachFileService.DeleteAttachFile(Funs.RootPath, rowID +"-ShortListApproval", Const.BidDocumentsStandingBookMenuId);
}
}
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
}
}