initFCL
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CCPUpload.aspx.cs" Inherits="FineUIPro.Web.CCP.CCPUpload" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<style>
|
||||
.result img {
|
||||
border: 1px solid #CCCCCC;
|
||||
max-width: 550px;
|
||||
padding: 3px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" BodyPadding="10px" Margin="0 5px 0 0" AutoScroll="true" runat="server" EnableCollapse="true" Title="" ShowHeader="true">
|
||||
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:FileUpload runat="server" ID="ccpFile" EmptyText="Please select the file" Label="File" LabelAlign="Right" ButtonIcon="Add">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList runat="server" ID="ddlType" Label="Type" LabelAlign="Right">
|
||||
<f:ListItem Text="CCP" Value="CCP" />
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="Remark" ID="txtRemark" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" ValidateForms="SimpleForm1"
|
||||
Text="Submit">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</Items>
|
||||
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" IsFluid="true" CssClass="blockpanel" ShowBorder="true" ShowHeader="false" Title="附件列表" runat="server" AllowPaging="true" IsDatabasePaging="true" PageSize="5" OnPageIndexChange="Grid1_PageIndexChange" SortDirection="DESC" SortField="UploadDate" OnSort="Grid1_Sort" EnableColumnLines="true"
|
||||
DataKeyNames="FileId" OnRowCommand="Grid1_RowCommand">
|
||||
<Columns>
|
||||
<f:BoundField Width="200px" DataField="FileName" HeaderText="File Name" HeaderTextAlign="Center" ExpandUnusedSpace="true" />
|
||||
<f:BoundField Width="260px" DataField="FO" HeaderText="CCPInfo" HeaderTextAlign="Center" />
|
||||
<f:BoundField Width="100px" DataField="UploadDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="Data" HeaderTextAlign="Center" />
|
||||
<f:LinkButtonField EnableAjax="false" Width="120px" HeaderText="附件下载" ConfirmTarget="Top" CommandName="IsDownload" TextAlign="Center" ToolTip="附件下载" Text="附件下载" />
|
||||
<f:TemplateField HeaderText="附件查看" Width="120px" HeaderTextAlign="Center" TextAlign="Left" Hidden="true">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lblLock" runat="server" ToolTip="附件查看" EnableAjax="false" Height="20px" CommandArgument='<%# Bind("FileUrl") %>'></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:LinkButtonField Width="80px" ConfirmText="Confirm to delete?" ConfirmTarget="Top" CommandName="Delete" Icon="Delete" />
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
<f:HiddenField runat="server" ID="hidId"></f:HiddenField>
|
||||
<f:HiddenField runat="server" ID="hidContractNo"></f:HiddenField>
|
||||
<f:HiddenField runat="server" ID="hidccpNo"></f:HiddenField>
|
||||
<f:HiddenField runat="server" ID="hidtype"></f:HiddenField>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,185 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.CCP
|
||||
{
|
||||
public partial class CCPUpload : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
hidId.Text = Request["id"];
|
||||
hidContractNo.Text = Request["contractNo"];
|
||||
hidccpNo.Text = Request["ccpno"];
|
||||
hidtype.Text = Request["type"];
|
||||
if (hidtype.Text == "view")
|
||||
{
|
||||
Form2.Hidden = true;
|
||||
}
|
||||
Panel1.Title = "File Management(" + string.Format("{0:d3}", int.Parse(hidccpNo.Text)) + ")";
|
||||
if (!string.IsNullOrEmpty(hidId.Text))
|
||||
{
|
||||
BindGrid(hidId.Text, hidContractNo.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
public void BindGrid(string id, string contractNo)
|
||||
{
|
||||
var fileManageList = new List<Model.FilesManagement>();
|
||||
Expression<Func<Model.FilesManagement, bool>> express = PredicateExtensions.True<Model.FilesManagement>();
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
express = express.And(p => p.FO == string.Format("{0}_合同({1})_类型({2})", hidId.Text, hidContractNo.Text, ddlType.SelectedValue));
|
||||
}
|
||||
fileManageList = Funs.DB.FilesManagement.Where(express).OrderByDescending(p => p.UploadDate).ToList();
|
||||
Grid1.RecordCount = fileManageList.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, fileManageList);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
for (int i = 0; i < Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (hidtype.Text == "view")
|
||||
{
|
||||
Grid1.Columns[5].Hidden = true;
|
||||
}
|
||||
System.Web.UI.WebControls.LinkButton lblLock = ((System.Web.UI.WebControls.LinkButton)(this.Grid1.Rows[i].FindControl("lblLock")));
|
||||
string url = lblLock.CommandArgument.ToString();
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
url = url.Replace('\\', '/');
|
||||
lblLock.Text = BLL.UploadAttachmentService.ShowAttachment("../", url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid(hidId.Text, hidContractNo.Text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid(hidId.Text, hidContractNo.Text);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
FilesManagement fileModel = new FilesManagement();
|
||||
if (ccpFile.HasFile)
|
||||
{
|
||||
string fileName = ccpFile.ShortFileName;
|
||||
//文件预上传路径
|
||||
string url = "File\\" + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
|
||||
string path = Funs.RootPath + url;
|
||||
|
||||
//文件路径
|
||||
string filePath = ccpFile.PostedFile.FileName;
|
||||
if (!string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
string filePathUrl = path + fileName;
|
||||
ccpFile.SaveAs(filePathUrl);
|
||||
fileModel.FileName = fileName;
|
||||
fileModel.FileType = ddlType.SelectedValue;
|
||||
fileModel.FileLength = ccpFile.PostedFile.ContentLength.ToString();
|
||||
fileModel.FileUrl = url + fileName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fileModel.FileId = Guid.NewGuid().ToString();
|
||||
fileModel.FO = string.Format("{0}_合同({1})_类型({2})", hidId.Text, hidContractNo.Text, ddlType.SelectedValue);
|
||||
fileModel.UploadUser = CurrUser.UserName;
|
||||
fileModel.UploadDate = DateTime.Now;
|
||||
fileModel.Remark = txtRemark.Text.Trim();
|
||||
Funs.DB.FilesManagement.InsertOnSubmit(fileModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
Form2.Reset();
|
||||
BindGrid(hidId.Text, hidContractNo.Text);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 列点击事件
|
||||
/// <summary>
|
||||
/// 列点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
var fileid = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
var fileModel = Funs.DB.FilesManagement.FirstOrDefault(p => p.FileId == fileid);
|
||||
if (e.CommandName == "Delete")
|
||||
{
|
||||
if (!string.IsNullOrEmpty(fileid))
|
||||
{
|
||||
|
||||
if (fileModel.FileUrl != null)
|
||||
{
|
||||
if (File.Exists(Server.MapPath("~/") + fileModel.FileUrl))
|
||||
{
|
||||
Directory.Delete(Server.MapPath("~/") + fileModel.FileUrl.Replace(fileModel.FileName, ""), true);
|
||||
}
|
||||
}
|
||||
Funs.DB.FilesManagement.DeleteOnSubmit(fileModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
BindGrid(hidId.Text, hidContractNo.Text);
|
||||
ShowNotify("Delete Successful!");
|
||||
}
|
||||
else if (e.CommandName == "IsDownload")
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.CPTViewListMenuId);
|
||||
if (buttonList.Contains(BLL.Const.BtnAttachment))
|
||||
{
|
||||
ShowFile(fileModel.FileUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("No permission, please contact the administrator", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CCP
|
||||
{
|
||||
|
||||
|
||||
public partial class CCPUpload
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Form2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// ccpFile 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload ccpFile;
|
||||
|
||||
/// <summary>
|
||||
/// ddlType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlType;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemark;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSubmit;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// lblLock 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lblLock;
|
||||
|
||||
/// <summary>
|
||||
/// hidId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hidId;
|
||||
|
||||
/// <summary>
|
||||
/// hidContractNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hidContractNo;
|
||||
|
||||
/// <summary>
|
||||
/// hidccpNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hidccpNo;
|
||||
|
||||
/// <summary>
|
||||
/// hidtype 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hidtype;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CcpEdit.aspx.cs" Inherits="FineUIPro.Web.CCP.CcpEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel2" />
|
||||
<f:Panel ID="Panel2" CssClass="blockpanel" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelTopRegion" RegionPosition="Center"
|
||||
Title="中间面板" ShowBorder="false" ShowHeader="false" Layout="VBox">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="ID,CPT_No,Contract_No,Tax" AllowCellEditing="true" DataIDField="CPT_NO"
|
||||
SortField="Contract_No" SortDirection="ASC" OnSort="Grid1_Sort" IsDatabasePaging="true" EnableCheckBoxSelect="true" KeepCurrentSelection="true" OnRowClick="Grid1_RowClick" EnableRowSelectEvent="true" EnableRowClickEvent="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:DropDownList runat="server" ID="ddlContractNo" Label="Contract No" EnableEdit="true" LabelWidth="100px" Width="210px"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="ddlContractNo_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="txtCPT_No" runat="server" Label="CPT No." LabelAlign="Right" EmptyText="Search by CPT No." NextFocusControl="btnSearch" LabelWidth="90px" Width="230px"></f:TextBox>
|
||||
<f:Button ID="btnSearch" Text="Search" Icon="SystemSearch" runat="server" Size="Medium" CssClass="marginr" OnClick="btnSearch_Click" />
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:TextBox ID="txtCcpNo" runat="server" Required="true" Label="CCP No." LabelAlign="Right" LabelWidth="90px" Width="160px"></f:TextBox>
|
||||
<f:DropDownList ID="ddlPaymentTerm" runat="server" Label="结算方式" LabelWidth="100px" LabelAlign="Right" Required="true" ShowRedStar="true" Width="180px">
|
||||
<f:ListItem Text="-Please select-" Value="" Selected="true" />
|
||||
<f:ListItem Text="按月" Value="0" />
|
||||
<f:ListItem Text="按季" Value="1" />
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="ddlDeductionDeductionRate" runat="server" Label="高核减扣款" LabelWidth="100px" LabelAlign="Right" Width="180px" >
|
||||
<f:ListItem Text="适用" Value="1" />
|
||||
<f:ListItem Text="不适用" Value="2" />
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="ddlDelayedDeduction" runat="server" Label="延迟递交结算扣款" LabelWidth="140px" LabelAlign="Right" Width="220px" MarginRight="10px">
|
||||
<f:ListItem Text="适用" Value="1" />
|
||||
<f:ListItem Text="不适用" Value="2" />
|
||||
</f:DropDownList>
|
||||
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="Save" ToolTip="Save" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" MarginRight="10px">
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="180px" ColumnID="ID" DataField="ID" SortField="ID"
|
||||
FieldType="String" HeaderTextAlign="Center" Hidden="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="CPT_No" DataField="CPT_No" SortField="CPT_No"
|
||||
FieldType="String" HeaderText="CPT No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Contract_No" DataField="Contract_No" SortField="Contract_No"
|
||||
FieldType="String" HeaderText="Contract No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="500px" ColumnID="Contractor" DataField="Contractor" SortField="Contractor"
|
||||
FieldType="String" HeaderText="Contractor" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="140px" ColumnID="FC_Desctription" DataField="FC_Desctription" SortField="FC_Desctription"
|
||||
FieldType="String" HeaderText="FC Description" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Report_Date" DataField="Report_Date" SortField="Report_Date"
|
||||
FieldType="String" HeaderText="Created Time" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="PriceScheme" DataField="PriceScheme" SortField="PriceScheme"
|
||||
FieldType="String" HeaderText="FC Price scheme" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="FC_Start_Date" DataField="FC_Start_Date" SortField="FC_Start_Date"
|
||||
FieldType="Date" Renderer="Date" HeaderText="FC Start Date" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="FC_End_Date" DataField="FC_End_Date" SortField="FC_End_Date"
|
||||
FieldType="Date" Renderer="Date" HeaderText="FC End Date" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="UserName" DataField="UserName" SortField="UserName"
|
||||
FieldType="String" HeaderText="Contract Admin" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelBottomRegion" RegionPosition="Bottom" RegionSplit="true" RegionSplitWidth="20px" EnableCollapse="true" Height="400px"
|
||||
Title="底部面板" ShowBorder="false" ShowHeader="false" Layout="Fit">
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" CssClass="blockpanel" ShowBorder="true" ShowHeader="true" EnableCollapse="false" runat="server"
|
||||
DataKeyNames="Id,CPT_No" AllowSorting="true" SortField="SES" ClicksToEdit="1" SortDirection="ASC"
|
||||
AllowCellEditing="true" IsFluid="true" AutoSelectEditor="true"
|
||||
EnableSummary="true" SummaryPosition="Bottom">
|
||||
|
||||
<Columns>
|
||||
<f:TemplateField Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="120px" ColumnID="Contract_No" DataField="Contract_No" SortField="Contract_No"
|
||||
FieldType="String" HeaderText="合同号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="CPT_No" DataField="CPT_No" SortField="CPT_No"
|
||||
FieldType="String" HeaderText="CPT No" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Ses" DataField="Ses" SortField="Ses"
|
||||
FieldType="String" HeaderText="Ses No" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="Short_Description" DataField="Short_Description" SortField="Short_Description"
|
||||
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Quotation" DataField="Quotation" SortField="Quotation"
|
||||
FieldType="Float" HeaderText="承包商报价" HeaderTextAlign="Center" RendererFunction="renderSalaryFloat">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Tax_Value" DataField="Tax_Value" SortField="Tax_Value"
|
||||
FieldType="Float" HeaderText="CTE/D审价" HeaderTextAlign="Center" RendererFunction="renderSalaryFloat">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ThirdParty_PriceReview" DataField="ThirdParty_PriceReview" SortField="ThirdParty_PriceReview" FieldType="Float"
|
||||
HeaderText="第三方审价" TextAlign="Right">
|
||||
<Editor>
|
||||
<f:NumberBox NoDecimal="false" DecimalPrecision="2" NoNegative="true" runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="Reduction" FieldType="Float" HeaderText="核减额" HeaderTextAlign="Center" TextAlign="Right"></f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="Reduction_Rate" FieldType="Float" HeaderText="核减率" HeaderTextAlign="Center" TextAlign="Right"></f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="DeductionDeduction_Rate" FieldType="Float" HeaderText="高核减率扣款" HeaderTextAlign="Center" TextAlign="Right"></f:RenderField>
|
||||
|
||||
<f:RenderField Width="100px" ColumnID="Con_Days" DataField="Con_Days" SortField="Con_Days"
|
||||
FieldType="Int" HeaderText="SSR结算提交天数" HeaderTextAlign="Center" TextAlign="Right">
|
||||
<Editor>
|
||||
<f:NumberBox NoDecimal="true" NoNegative="true" runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField Width="100px" ColumnID="DelayedDeduction" FieldType="Float" HeaderText="延迟扣款" HeaderTextAlign="Center" TextAlign="Right"></f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Final_SettlementAmount" FieldType="Float" HeaderText="最终结算金额(含税)" HeaderTextAlign="Right" TextAlign="Center"></f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="afteredit" Handler="onGridAfterEdit" />
|
||||
<f:Listener Event="dataload" Handler="LoadPage" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
<f:HiddenField ID="hidCcpId" runat="server" Text=""></f:HiddenField>
|
||||
<f:HiddenField ID="hidContractNo" runat="server" Text=""></f:HiddenField>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="Pop-up window" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="1200px" Height="680px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var grid2ClientID = '<%= Grid2.ClientID %>';
|
||||
var ddldeductionRate = '<%= ddlDeductionDeductionRate.ClientID %>';
|
||||
var ddldelayedTion = '<%= ddlDelayedDeduction.ClientID %>';
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
|
||||
// 页面渲染完毕
|
||||
F.ready(function () {
|
||||
LoadPage();
|
||||
F(ddldeductionRate).on('change', function () {
|
||||
LoadPage();
|
||||
});
|
||||
F(ddldelayedTion).on('change', function () {
|
||||
LoadPage();
|
||||
});
|
||||
});
|
||||
|
||||
function onGridAfterEdit(event, value, params) {
|
||||
var me = this, columnId = params.columnId, rowId = params.rowId;
|
||||
var rowValue = params.rowValue;
|
||||
if (columnId === 'ThirdParty_PriceReview' || columnId === 'Con_Days') {
|
||||
var reduction = 0.00;
|
||||
var reductionRate = 0.00;
|
||||
var deductionDeductionRate = 0.00;
|
||||
var delayedDeduction = 0.00;
|
||||
var finalSettlementAmount = 0.00;
|
||||
|
||||
var thirdPartyPriceReview = rowValue["ThirdParty_PriceReview"];
|
||||
var tax = rowValue["Tax_Value"];
|
||||
var quotation = rowValue["Quotation"];
|
||||
var conDays = rowValue["Con_Days"];
|
||||
|
||||
if (thirdPartyPriceReview > 0) {
|
||||
//核减额=-(CTE/D审价-第三方审价)
|
||||
reduction = (tax - thirdPartyPriceReview);
|
||||
me.updateCellValue(rowId, 'Reduction', parseFloat(-reduction).toFixed(2));
|
||||
//核减率=(承包商报价-第三方审价)/承包商报价
|
||||
reductionRate = ((quotation - thirdPartyPriceReview) / quotation) * 100;
|
||||
me.updateCellValue(rowId, 'Reduction_Rate', parseFloat(reductionRate).toFixed(2));
|
||||
//高核减率扣款(如果核减率超10%,则扣除终审金额的2%)=-(第三方审价*2%)
|
||||
deductionDeductionRate = reductionRate > 10 ? thirdPartyPriceReview * 0.02 : 0.00;
|
||||
me.updateCellValue(rowId, 'DeductionDeduction_Rate', parseFloat(-deductionDeductionRate).toFixed(2));
|
||||
//延迟扣款(如果提交天数Con超出15天,则按终审金额10%扣款)=-(第三方审价*10%)
|
||||
delayedDeduction = conDays > 15 ? thirdPartyPriceReview * 0.1 : 0.00;
|
||||
me.updateCellValue(rowId, 'DelayedDeduction', parseFloat(-delayedDeduction).toFixed(2));
|
||||
} else {
|
||||
//核减额为空
|
||||
me.updateCellValue(rowId, 'Reduction', 0.00);
|
||||
//核减率=(承包商报价-CTE/D审价)/承包商报价
|
||||
reductionRate = ((quotation - tax) / quotation) * 100;
|
||||
me.updateCellValue(rowId, 'Reduction_Rate', parseFloat(reductionRate).toFixed(2));
|
||||
//高核减率扣款= -(CTE/D审价*2%)
|
||||
deductionDeductionRate = reductionRate > 10 ? tax * 0.02 : 0;
|
||||
me.updateCellValue(rowId, 'DeductionDeduction_Rate', parseFloat(-deductionDeductionRate).toFixed(2));
|
||||
//延迟扣款(如果提交天数Con超出15天,则按终审金额10%扣款)= -(CTE/D审价*10%)
|
||||
delayedDeduction = conDays > 15 ? tax * 0.1 : 0;
|
||||
me.updateCellValue(rowId, 'DelayedDeduction', parseFloat(-delayedDeduction).toFixed(2));
|
||||
}
|
||||
//最终结算金额(含税)= CTE/D审价+(-核减额)+(-高核减率扣款)+(-延迟扣款)
|
||||
finalSettlementAmount = tax - reduction - deductionDeductionRate - delayedDeduction;
|
||||
me.updateCellValue(rowId, 'Final_SettlementAmount', parseFloat(finalSettlementAmount).toFixed(2));
|
||||
//合计列方法
|
||||
updateSummary();
|
||||
}
|
||||
}
|
||||
|
||||
//合计赋值
|
||||
function updateSummary() {
|
||||
var me = F(grid2ClientID), reduction = 0.00, deductionDeductionRate = 0.00, delayedDeduction = 0.00, finalSettlementAmount = 0.00;
|
||||
me.getRowEls().each(function (index, tr) {
|
||||
reduction += me.getCellValue(tr, 'Reduction');
|
||||
deductionDeductionRate += me.getCellValue(tr, 'DeductionDeduction_Rate');
|
||||
delayedDeduction += me.getCellValue(tr, 'DelayedDeduction');
|
||||
finalSettlementAmount += me.getCellValue(tr, 'Final_SettlementAmount');
|
||||
});
|
||||
// 第三个参数 true,强制更新,不显示左上角的更改标识
|
||||
me.updateSummaryCellValue('Reduction', renderSalaryFloat(parseFloat(reduction)), true);
|
||||
me.updateSummaryCellValue('DeductionDeduction_Rate', renderSalaryFloat(parseFloat(deductionDeductionRate)), true);
|
||||
me.updateSummaryCellValue('DelayedDeduction', renderSalaryFloat(parseFloat(delayedDeduction)), true);
|
||||
me.updateSummaryCellValue('Final_SettlementAmount', renderSalaryFloat(parseFloat(finalSettlementAmount)), true);
|
||||
}
|
||||
|
||||
function LoadPage() {
|
||||
var grid = F(grid2ClientID);
|
||||
grid.getRowEls().each(function (index, tr) {
|
||||
var me = F(grid2ClientID), rowId = index;
|
||||
var reduction = 0.00;
|
||||
var reductionRate = 0.00;
|
||||
var deductionDeductionRate = 0.00;
|
||||
var delayedDeduction = 0.00;
|
||||
var finalSettlementAmount = 0.00;
|
||||
|
||||
var thirdPartyPriceReview = me.getCellValue(tr, 'ThirdParty_PriceReview');
|
||||
var tax = me.getCellValue(tr, 'Tax_Value');
|
||||
var quotation = me.getCellValue(tr, 'Quotation');
|
||||
var conDays = me.getCellValue(tr, 'Con_Days');
|
||||
|
||||
if (thirdPartyPriceReview > 0) {
|
||||
//核减额=-(CTE/D审价-第三方审价)
|
||||
reduction = (tax - thirdPartyPriceReview);
|
||||
me.updateCellValue(rowId, 'Reduction', parseFloat(-reduction).toFixed(2));
|
||||
//核减率=(承包商报价-第三方审价)/承包商报价
|
||||
reductionRate = ((quotation - thirdPartyPriceReview) / quotation) * 100;
|
||||
me.updateCellValue(rowId, 'Reduction_Rate', parseFloat(reductionRate).toFixed(2));
|
||||
//高核减率扣款(如果核减率超10%,则扣除终审金额的2%)=-(第三方审价*2%)
|
||||
if (F(ddldeductionRate).value == 1) {
|
||||
deductionDeductionRate = reductionRate > 10 ? thirdPartyPriceReview * 0.02 : 0.00;
|
||||
me.updateCellValue(rowId, 'DeductionDeduction_Rate', parseFloat(-deductionDeductionRate).toFixed(2));
|
||||
} else {
|
||||
me.updateCellValue(rowId, 'DeductionDeduction_Rate', 0.00);
|
||||
}
|
||||
//延迟扣款(如果提交天数Con超出15天,则按终审金额10%扣款)=-(第三方审价*10%)
|
||||
if (F(ddldelayedTion).value == 1) {
|
||||
delayedDeduction = conDays > 15 ? thirdPartyPriceReview * 0.1 : 0.00;
|
||||
me.updateCellValue(rowId, 'DelayedDeduction', parseFloat(-delayedDeduction).toFixed(2));
|
||||
} else {
|
||||
me.updateCellValue(rowId, 'DelayedDeduction', 0.00);
|
||||
}
|
||||
} else {
|
||||
//核减额为空
|
||||
me.updateCellValue(rowId, 'Reduction', 0.00);
|
||||
//核减率=(承包商报价-CTE/D审价)/承包商报价
|
||||
reductionRate = ((quotation - tax) / quotation) * 100;
|
||||
me.updateCellValue(rowId, 'Reduction_Rate', parseFloat(reductionRate).toFixed(2));
|
||||
//高核减率扣款= -(CTE/D审价*2%)
|
||||
if (F(ddldeductionRate).value == 1) {
|
||||
deductionDeductionRate = reductionRate > 10 ? tax * 0.02 : 0;
|
||||
me.updateCellValue(rowId, 'DeductionDeduction_Rate', parseFloat(-deductionDeductionRate).toFixed(2));
|
||||
} else {
|
||||
me.updateCellValue(rowId, 'DeductionDeduction_Rate', 0.00);
|
||||
}
|
||||
//延迟扣款(如果提交天数Con超出15天,则按终审金额10%扣款)= -(CTE/D审价*10%)
|
||||
if (F(ddldelayedTion).value == 1) {
|
||||
delayedDeduction = conDays > 15 ? tax * 0.1 : 0;
|
||||
me.updateCellValue(rowId, 'DelayedDeduction', parseFloat(-delayedDeduction).toFixed(2));
|
||||
} else {
|
||||
me.updateCellValue(rowId, 'DelayedDeduction', 0.00);
|
||||
}
|
||||
}
|
||||
//最终结算金额(含税)= CTE/D审价+(-核减额)+(-高核减率扣款)+(-延迟扣款)
|
||||
finalSettlementAmount = tax - reduction - deductionDeductionRate - delayedDeduction;
|
||||
me.updateCellValue(rowId, 'Final_SettlementAmount', parseFloat(finalSettlementAmount).toFixed(2));
|
||||
//合计列方法
|
||||
updateSummary();
|
||||
});
|
||||
}
|
||||
|
||||
function renderSalaryFloat(value) {
|
||||
return F.addCommas(value.toFixed(2));
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,667 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.CCP
|
||||
{
|
||||
public partial class CcpEdit : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
hidCcpId.Text = Request.Params["CcpId"] != null ? Request.Params["CcpId"].ToString() : string.Empty;
|
||||
hidContractNo.Text = Request.Params["contractNo"] != null ? Request.Params["contractNo"].ToString() : string.Empty;
|
||||
var contractNos = from contractNo in Funs.DB.FC_SESRelatedData
|
||||
join cpt in Funs.DB.CPTList on contractNo.FO_NO equals cpt.Contract_No
|
||||
group contractNo by contractNo.FO_NO into g
|
||||
select g.Key;
|
||||
if (contractNos.Count() == 0)
|
||||
{
|
||||
Grid1.DataSource = null;
|
||||
Grid1.DataBind();
|
||||
return;
|
||||
}
|
||||
ddlContractNo.DataTextField = "FO_NO";
|
||||
ddlContractNo.DataValueField = "FO_NO";
|
||||
ddlContractNo.DataSource = contractNos.ToList();
|
||||
ddlContractNo.DataBind();
|
||||
//Funs.FineUIPleaseSelect(ddlContractNo);
|
||||
ddlContractNo.SelectedValue = contractNos.FirstOrDefault();
|
||||
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定CPTlist
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ddlContractNo.SelectedValue))
|
||||
{
|
||||
Alert.ShowInParent("必须选择一个合同号!");
|
||||
return;
|
||||
}
|
||||
|
||||
var ccpNo = string.Empty;
|
||||
|
||||
int ccpId = 0;
|
||||
var upCptLs = new List<CCP_List>();
|
||||
string strSql = @"SELECT cpt.ID,cpt.CPT_No,cpt.Contract_No,cpt.Tax,
|
||||
(cpt.ContractorEng+' '+cpt.ContractorCN) AS Contractor,
|
||||
cpt.FC_Desctription,cpt.Report_Date,ps.PriceScheme,
|
||||
cpt.FC_Start_Date,cpt.FC_End_Date,u.UserName
|
||||
FROM dbo.CPTList cpt
|
||||
LEFT JOIN dbo.Base_PriceScheme ps ON ps.PriceSchemeId=cpt.FC_Price_Scheme
|
||||
LEFT JOIN dbo.Sys_User u ON u.UserId = cpt.UserId
|
||||
WHERE 1=1";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
if (!string.IsNullOrEmpty(hidCcpId.Text))
|
||||
{
|
||||
strSql = strSql + " AND cpt.Contract_No=@Contract_No";
|
||||
listStr.Add(new SqlParameter("@Contract_No", hidContractNo.Text));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ddlContractNo.SelectedValue) && ddlContractNo.SelectedValue != Const._Null)
|
||||
{
|
||||
strSql = strSql + " AND cpt.Contract_No=@Contract_No";
|
||||
listStr.Add(new SqlParameter("@Contract_No", ddlContractNo.SelectedValue.Trim()));
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtCPT_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND cpt.CPT_No=@CPT_No";
|
||||
listStr.Add(new SqlParameter("@CPT_No", txtCPT_No.Text));
|
||||
}
|
||||
//添加的时候隐藏已经选择的cpt
|
||||
if (string.IsNullOrEmpty(hidCcpId.Text))
|
||||
{
|
||||
var adCptLs = Funs.DB.CCP_List.Select(p => p.CPT_Id).ToList();
|
||||
if (adCptLs.Count > 0)
|
||||
{
|
||||
var idstr = string.Format("'{0}'", string.Join("','", string.Join(",", adCptLs).Split(',')));
|
||||
strSql += string.Format(" and cpt.ID not in ({0})", idstr);
|
||||
}
|
||||
var itemContractNo = string.IsNullOrEmpty(hidContractNo.Text) ? ddlContractNo.SelectedValue : hidContractNo.Text;
|
||||
if (Funs.DB.CCP_List.Count(p => p.Contract_No == itemContractNo) > 0)
|
||||
{
|
||||
txtCcpNo.Text = string.Format("{0:d3}", Funs.DB.CCP_List.Where(p => p.Contract_No == itemContractNo).Max(p => p.CCP_No) + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
txtCcpNo.Text = string.Format("{0:d3}", 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ccpId = int.Parse(hidCcpId.Text);
|
||||
upCptLs = Funs.DB.CCP_List.Where(p => p.Contract_No == hidContractNo.Text).ToList();
|
||||
if (upCptLs.Count > 0)
|
||||
{
|
||||
var itemCpt = upCptLs.Where(p => p.ID != ccpId).ToList();
|
||||
if (itemCpt.Count > 0)
|
||||
{
|
||||
var idstr = string.Format("'{0}'", string.Join("','", string.Join(",", itemCpt.Select(p => p.CPT_Id)).Split(',')));
|
||||
strSql += string.Format(" and cpt.ID not in ({0})", idstr);
|
||||
}
|
||||
ddlContractNo.SelectedValue = upCptLs.FirstOrDefault().Contract_No;
|
||||
ddlContractNo.Enabled = false;
|
||||
|
||||
txtCcpNo.Text = string.Format("{0:d3}", upCptLs.FirstOrDefault(p => p.ID == ccpId).CCP_No);
|
||||
}
|
||||
else
|
||||
{
|
||||
txtCcpNo.Text = string.Format("{0:d3}", 1);
|
||||
}
|
||||
}
|
||||
|
||||
strSql = strSql + " ORDER BY cpt.Contract_No ASC";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
//Grid1.RecordCount = dt.Rows.Count;
|
||||
//var table = this.GetPagedDataTable(Grid1, dt);
|
||||
//Grid1.DataSource = table;
|
||||
Grid1.DataSource = dt;
|
||||
Grid1.DataBind();
|
||||
//修改获取ses
|
||||
if (!string.IsNullOrEmpty(hidCcpId.Text))
|
||||
{
|
||||
var ccpModel = upCptLs.FirstOrDefault(p => p.ID == ccpId);
|
||||
if (ccpModel != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ccpModel.Payment_Term)) ddlPaymentTerm.SelectedValue = ccpModel.Payment_Term;
|
||||
if (ccpModel.DeductionDeductionRateType != null) ddlDeductionDeductionRate.SelectedValue = ccpModel.DeductionDeductionRateType.ToString();
|
||||
if (ccpModel.DelayedDeductionType != null) ddlDelayedDeduction.SelectedValue = ccpModel.DelayedDeductionType.ToString();
|
||||
|
||||
var cptls = Array.ConvertAll(ccpModel.CPT_Id.Split(','), p => int.TryParse(p, out int s) ? s : 0);
|
||||
var cptNos = dt.AsEnumerable().Where(p => cptls.Contains(p.Field<int>("ID"))).Select(p => p.Field<string>("CPT_No")).Distinct().ToList();
|
||||
BindGrid1(cptNos);
|
||||
|
||||
List<int> selectedLs = new List<int>();
|
||||
var selectedCptIds = Array.ConvertAll(ccpModel.CPT_Id.Split(','), p => int.TryParse(p, out int s) ? s : 0);
|
||||
for (int i = 0; i < Grid1.Rows.Count; i++)
|
||||
{
|
||||
int rowCptId = Convert.ToInt32(Grid1.DataKeys[i][0]);
|
||||
//选中列
|
||||
if (selectedCptIds.Contains(rowCptId)) selectedLs.Add(i);
|
||||
}
|
||||
Grid1.SelectedRowIndexArray = selectedLs.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定SESList
|
||||
/// </summary>
|
||||
private void BindGrid1(List<string> cptNos)
|
||||
{
|
||||
if (cptNos.Count > 0)
|
||||
{
|
||||
string strSql = @"SELECT a.ID,a.SES,a.CPT_No,a.Requistioner,a.Short_Description,a.End_Date,
|
||||
a.Budget,a.Quotation,a.Net_Value,a.Tax_Value,a.Deviation,a.By_Perc,
|
||||
a.Deduction,ISNULL(c.Con_Days,a.Con_Days) as Con_Days,a.BoQ_Days,a.SES_Days,
|
||||
a.Submit_Date,a.Remark,a.UserId,b.ContractorCN+' '+b.ContractorEng as ContractorName,
|
||||
b.Contract_No,c.ThirdParty_PriceReview
|
||||
FROM dbo.SESList as a
|
||||
inner join CPTList as b on a.CPT_No=b.CPT_No
|
||||
left join CCP_SESList as c on c.Ses_No=a.SES
|
||||
WHERE a.CPT_No in ('{0}') ";
|
||||
|
||||
strSql = string.Format(strSql, string.Join("','", cptNos.ToArray()));
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid2.RecordCount = dt.Rows.Count;
|
||||
Grid2.DataSource = dt;
|
||||
Grid2.DataBind();
|
||||
|
||||
JObject summary = new JObject();
|
||||
summary.Add("Quotation", dt.AsEnumerable().Sum(s => s.Field<decimal>("Quotation")).ToString("#,##0.00"));
|
||||
summary.Add("Tax_Value", dt.AsEnumerable().Sum(s => s.Field<decimal>("Tax_Value")).ToString("#,##0.00"));
|
||||
|
||||
summary.Add("Reduction", 0.00);
|
||||
summary.Add("DeductionDeduction_Rate", 0.00);
|
||||
summary.Add("DelayedDeduction", 0.00);
|
||||
summary.Add("Final_SettlementAmount", 0.00);
|
||||
Grid2.SummaryData = summary;
|
||||
}
|
||||
else
|
||||
{
|
||||
Grid2.DataSource = null;
|
||||
Grid2.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 排序
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 搜索
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合同号筛选
|
||||
/// </summary>
|
||||
protected void ddlContractNo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 选择加载
|
||||
|
||||
/// <summary>
|
||||
/// 选择加载
|
||||
/// </summary>
|
||||
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
//判断选中的行中是否存在不同的合同
|
||||
var cptNos = new List<string>();
|
||||
var cptTaxs = new List<string>();
|
||||
int[] selections = Grid1.SelectedRowIndexArray;
|
||||
|
||||
foreach (int rowIndex in selections)
|
||||
{
|
||||
cptNos.Add(Grid1.DataKeys[rowIndex][1].ToString());
|
||||
cptTaxs.Add(Grid1.DataKeys[rowIndex][3].ToString());
|
||||
}
|
||||
//判断选中的合同是否是同一个合同
|
||||
if (cptNos.Select(p => p.Substring(0, p.LastIndexOf("-"))).Distinct().Count() > 1)
|
||||
{
|
||||
Grid1.ClearSelection();
|
||||
Alert.ShowInParent("不同合同的CPT不允许创建CCP!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cptTaxs.Distinct().Count() > 1)
|
||||
{
|
||||
Grid1.ClearSelection();
|
||||
Alert.ShowInParent("不同税率的CPT不允许创建CCP!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid1(cptNos);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
//判断必须选择一行
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
//判断付款条件是否选择
|
||||
if (string.IsNullOrWhiteSpace(ddlPaymentTerm.SelectedValue))
|
||||
{
|
||||
Alert.ShowInParent("请选择付款条件!");
|
||||
return;
|
||||
}
|
||||
//判断CCP是否填写
|
||||
if (string.IsNullOrWhiteSpace(txtCcpNo.Text))
|
||||
{
|
||||
Alert.ShowInParent("CCP No不能为空!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsNumeric(txtCcpNo.Text) == false)
|
||||
{
|
||||
Alert.ShowInParent("请输入正确的CCP No!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//判断选中的行中是否存在不同的合同
|
||||
var cptNos = new List<string>();
|
||||
var cptTaxs = new List<string>();
|
||||
var contractNo = string.Empty;
|
||||
int[] selections = Grid1.SelectedRowIndexArray;
|
||||
foreach (int rowIndex in selections)
|
||||
{
|
||||
cptNos.Add(Grid1.DataKeys[rowIndex][1].ToString());
|
||||
contractNo = Grid1.DataKeys[rowIndex][2].ToString();
|
||||
cptTaxs.Add(Grid1.DataKeys[rowIndex][3].ToString());
|
||||
}
|
||||
//判断选中的合同是否是同一个合同
|
||||
if (cptNos.Select(p => p.Substring(0, p.LastIndexOf("-"))).Distinct().Count() > 1 && string.IsNullOrEmpty(hidCcpId.Text))
|
||||
{
|
||||
Grid1.ClearSelection();
|
||||
Alert.ShowInParent("不同合同的CPT不允许创建CCP!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cptTaxs.Distinct().Count() > 1)
|
||||
{
|
||||
Grid1.ClearSelection();
|
||||
Alert.ShowInParent("不同税率的CPT不允许创建CCP!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//获取合同表
|
||||
var contractModel = Funs.DB.View_FC_SESRelatedData.FirstOrDefault(p => p.FO_NO == contractNo);
|
||||
//获取CCP合同最大序号
|
||||
var ccpNo = Funs.DB.CCP_List.Count(p => p.Contract_Id == contractModel.ID) == 0 ? 0 : Funs.DB.CCP_List.Where(p => p.Contract_Id == contractModel.ID).Max(p => p.CCP_No);
|
||||
//获取CPT信息
|
||||
var cpts = Funs.DB.CPTList.Where(p => cptNos.Contains(p.CPT_No)).ToList();
|
||||
//获取SES信息
|
||||
var sess = Funs.DB.SESList.Where(p => cptNos.Contains(p.CPT_No)).ToList();
|
||||
//筛选第一个cpt
|
||||
var cptModel = cpts.FirstOrDefault();
|
||||
//数据操作
|
||||
if (string.IsNullOrEmpty(hidCcpId.Text))
|
||||
{
|
||||
var itemCcpId = int.Parse(txtCcpNo.Text);
|
||||
if (Funs.DB.CCP_List.Count(p => p.Contract_No == ddlContractNo.SelectedValue && p.CCP_No == itemCcpId) > 0)
|
||||
{
|
||||
Alert.ShowInParent("CCP No重复!");
|
||||
return;
|
||||
}
|
||||
|
||||
//添加CCP合同主表
|
||||
var ccp = new CCP_List();
|
||||
ccp.CPT_Id = string.Join(",", cpts.ConvertAll(p => p.ID));
|
||||
ccp.Contract_Id = contractModel.ID;
|
||||
ccp.Contractor_CN = cptModel.ContractorCN;
|
||||
ccp.Contractor_Eng = cptModel.ContractorEng;
|
||||
ccp.Vendor_Code = contractModel.Vendor_NO;
|
||||
ccp.Contract_Title = cptModel.FC_Desctription;
|
||||
ccp.Contract_No = cptModel.Contract_No;
|
||||
ccp.Contract_Type = "Frame Contract 框架合同";
|
||||
ccp.Buyer = CurrUser.UserName;
|
||||
ccp.Pricing_Method = contractModel.Pricing_Scheme;
|
||||
ccp.Contract_Budget = contractModel.Actual_Budget;
|
||||
ccp.Contract_PaymentTerm = string.Format("合同价款{0}支付,业主将在收到正确的发票原件以后{0}({1})日内支付。", ddlPaymentTerm.SelectedText, ddlPaymentTerm.SelectedValue == "0" ? "三十" : "九十", ddlPaymentTerm.SelectedValue == "0" ? "30" : "90");
|
||||
ccp.Payment_Term = ddlPaymentTerm.SelectedValue;
|
||||
ccp.CCP_No = int.Parse(txtCcpNo.Text); //ccpNo + 1;
|
||||
ccp.CPT_No = string.Join(",", cpts.ConvertAll(p => p.CPT_No));
|
||||
ccp.Created_Time = DateTime.Now;
|
||||
ccp.Created_UserId = CurrUser.UserId;
|
||||
ccp.Created_UserName = CurrUser.UserName;
|
||||
ccp.Created_ChineseName = CurrUser.ChineseName;
|
||||
ccp.DeductionDeductionRateType = int.Parse(ddlDeductionDeductionRate.SelectedValue);
|
||||
ccp.DelayedDeductionType = int.Parse(ddlDelayedDeduction.SelectedValue);
|
||||
Funs.DB.CCP_List.InsertOnSubmit(ccp);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
//循环添加ses信息
|
||||
List<CCP_SESList> ccpSess = new List<CCP_SESList>();
|
||||
var ccpModel = Funs.DB.CCP_List.FirstOrDefault(p => p.CCP_No == ccp.CCP_No && p.Contract_Id == ccp.Contract_Id);
|
||||
for (int i = 0; i < Grid2.Rows.Count; i++)
|
||||
{
|
||||
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid2.GetModifiedDict();
|
||||
if (modifiedDict == null) modifiedDict = new Dictionary<int, Dictionary<string, object>>();
|
||||
if (string.IsNullOrEmpty(Grid2.DataKeys[i][0].ToString())) continue;
|
||||
|
||||
int sesId = int.Parse(Grid2.DataKeys[i][0].ToString());
|
||||
var itemSes = sess.FirstOrDefault(p => p.ID == sesId);
|
||||
var itemCpt = cpts.FirstOrDefault(p => p.CPT_No == Grid2.DataKeys[i][1].ToString());
|
||||
|
||||
CCP_SESList itemCcpSes = new CCP_SESList();
|
||||
itemCcpSes.CCP_No = ccpModel.CCP_No;
|
||||
itemCcpSes.CCP_Id = ccpModel.ID;
|
||||
itemCcpSes.CPT_No = itemCpt.CPT_No;
|
||||
itemCcpSes.CPT_Id = itemCpt.ID;
|
||||
itemCcpSes.Ses_No = itemSes.SES;
|
||||
itemCcpSes.Ses_Id = itemSes.ID;
|
||||
itemCcpSes.Contract_No = contractModel.FO_NO;
|
||||
itemCcpSes.Contract_Id = contractModel.ID;
|
||||
itemCcpSes.Project_Name = itemSes.Short_Description;
|
||||
itemCcpSes.Contractor_Quotation = itemSes.Quotation;
|
||||
itemCcpSes.Incl_Tax = itemSes.Tax_Value;
|
||||
itemCcpSes.Con_Days = itemSes.Con_Days;
|
||||
if (modifiedDict.ContainsKey(i))
|
||||
{
|
||||
itemCcpSes.ThirdParty_PriceReview = (modifiedDict[i].ContainsKey("ThirdParty_PriceReview") && !string.IsNullOrWhiteSpace(modifiedDict[i]["ThirdParty_PriceReview"].ToString())) ? decimal.Parse(modifiedDict[i]["ThirdParty_PriceReview"].ToString()) : 0;
|
||||
itemCcpSes.Reduction = decimal.Parse(modifiedDict[i]["Reduction"].ToString());
|
||||
itemCcpSes.Reduction_Rate = decimal.Parse(modifiedDict[i]["Reduction_Rate"].ToString());
|
||||
if (ddlDeductionDeductionRate.SelectedValue == "1")
|
||||
{
|
||||
itemCcpSes.Deduction_DeductionRate = decimal.Parse(modifiedDict[i]["DeductionDeduction_Rate"].ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.Deduction_DeductionRate = 0;
|
||||
}
|
||||
if (ddlDelayedDeduction.SelectedValue == "1")
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = decimal.Parse(modifiedDict[i]["DelayedDeduction"].ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = 0;
|
||||
}
|
||||
itemCcpSes.Final_SettlementAmount = decimal.Parse(modifiedDict[i]["Final_SettlementAmount"].ToString());
|
||||
if (modifiedDict[i].ContainsKey("Con_Days") && !string.IsNullOrWhiteSpace(modifiedDict[i]["Con_Days"].ToString()))
|
||||
{
|
||||
itemCcpSes.Con_Days = int.Parse(modifiedDict[i]["Con_Days"].ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.ThirdParty_PriceReview = 0;
|
||||
itemCcpSes.Reduction = 0;
|
||||
itemCcpSes.Reduction_Rate = Math.Round(Convert.ToDecimal((itemSes.Quotation - itemSes.Tax_Value) / itemSes.Quotation) * 100, 2, MidpointRounding.AwayFromZero);
|
||||
if (ddlDeductionDeductionRate.SelectedValue == "1")
|
||||
{
|
||||
|
||||
itemCcpSes.Deduction_DeductionRate = itemCcpSes.Reduction_Rate > 10 ? -(Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.02), 2, MidpointRounding.AwayFromZero)) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.Deduction_DeductionRate = 0;
|
||||
}
|
||||
if (ddlDelayedDeduction.SelectedValue == "1")
|
||||
{
|
||||
if (itemSes.Con_Days != null)
|
||||
{
|
||||
if (itemSes.Con_Days > 15 && itemSes.Con_Days <= 20)
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = -Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.05));
|
||||
}
|
||||
else if (itemSes.Con_Days > 20)
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = -Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.1));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = 0;
|
||||
}
|
||||
//itemCcpSes.DelayedDeduction = itemSes.Con_Days > 15 ? -(Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.1))) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = 0;
|
||||
}
|
||||
itemCcpSes.Final_SettlementAmount = itemSes.Tax_Value + itemCcpSes.DelayedDeduction + itemCcpSes.DelayedDeduction;
|
||||
}
|
||||
itemCcpSes.Created_Time = DateTime.Now;
|
||||
itemCcpSes.Created_UserId = CurrUser.UserId;
|
||||
itemCcpSes.Created_UserName = CurrUser.UserName;
|
||||
itemCcpSes.Created_ChineseName = CurrUser.ChineseName;
|
||||
ccpSess.Add(itemCcpSes);
|
||||
}
|
||||
Funs.DB.CCP_SESList.InsertAllOnSubmit(ccpSess);
|
||||
Funs.DB.SubmitChanges();
|
||||
hidCcpId.Text = ccpModel.ID.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
//修改CCP合同主表
|
||||
int ccpId = int.Parse(hidCcpId.Text);
|
||||
var ccp = Funs.DB.CCP_List.FirstOrDefault(p => p.ID == ccpId);
|
||||
if (ccp != null)
|
||||
{
|
||||
var itemCcpId = int.Parse(txtCcpNo.Text);
|
||||
if (Funs.DB.CCP_List.Count(p => p.Contract_Id == ccp.Contract_Id && p.CCP_No == itemCcpId && p.ID != ccp.ID) > 0)
|
||||
{
|
||||
Alert.ShowInParent("CCP No重复!");
|
||||
return;
|
||||
}
|
||||
|
||||
ccp.CPT_Id = string.Join(",", cpts.ConvertAll(p => p.ID));
|
||||
ccp.Contract_Id = contractModel.ID;
|
||||
ccp.Contractor_CN = cptModel.ContractorCN;
|
||||
ccp.Contractor_Eng = cptModel.ContractorEng;
|
||||
ccp.Vendor_Code = contractModel.Vendor_NO;
|
||||
ccp.Contract_Title = cptModel.FC_Desctription;
|
||||
ccp.Buyer = CurrUser.UserName;
|
||||
ccp.Pricing_Method = contractModel.Pricing_Scheme;
|
||||
ccp.Contract_Budget = contractModel.Actual_Budget;
|
||||
ccp.Contract_PaymentTerm = string.Format("合同价款{0}支付,业主将在收到正确的发票原件以后{0}({1})日内支付。", ddlPaymentTerm.SelectedText, ddlPaymentTerm.SelectedValue == "0" ? "三十" : "九十", ddlPaymentTerm.SelectedValue == "0" ? "30" : "90");
|
||||
ccp.Payment_Term = ddlPaymentTerm.SelectedValue;
|
||||
ccp.CCP_No = int.Parse(txtCcpNo.Text);
|
||||
ccp.CPT_No = string.Join(",", cpts.ConvertAll(p => p.CPT_No));
|
||||
ccp.Modify_Time = DateTime.Now;
|
||||
ccp.Modify_UserId = CurrUser.UserId;
|
||||
ccp.Modify_UserName = CurrUser.UserName;
|
||||
ccp.Modify_ChineseName = CurrUser.ChineseName;
|
||||
ccp.DeductionDeductionRateType = int.Parse(ddlDeductionDeductionRate.SelectedValue);
|
||||
ccp.DelayedDeductionType = int.Parse(ddlDelayedDeduction.SelectedValue);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
//删除已经存在的ccpses
|
||||
var deleteccpses = Funs.DB.CCP_SESList.Where(p => p.CCP_Id == ccpId).ToList();
|
||||
Funs.DB.CCP_SESList.DeleteAllOnSubmit(deleteccpses);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
//循环添加ses信息
|
||||
List<CCP_SESList> ccpSess = new List<CCP_SESList>();
|
||||
for (int i = 0; i < Grid2.Rows.Count; i++)
|
||||
{
|
||||
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid2.GetModifiedDict();
|
||||
if (modifiedDict == null) modifiedDict = new Dictionary<int, Dictionary<string, object>>();
|
||||
if (string.IsNullOrEmpty(Grid2.DataKeys[i][0].ToString())) continue;
|
||||
|
||||
int sesId = int.Parse(Grid2.DataKeys[i][0].ToString());
|
||||
var itemSes = sess.FirstOrDefault(p => p.ID == sesId);
|
||||
var itemCpt = cpts.FirstOrDefault(p => p.CPT_No == Grid2.DataKeys[i][1].ToString());
|
||||
var itemDeleteCcp = deleteccpses.FirstOrDefault(p => p.Ses_No == itemSes.SES);
|
||||
CCP_SESList itemCcpSes = new CCP_SESList();
|
||||
itemCcpSes.CCP_No = ccp.CCP_No;
|
||||
itemCcpSes.CCP_Id = ccp.ID;
|
||||
itemCcpSes.CPT_No = itemCpt.CPT_No;
|
||||
itemCcpSes.CPT_Id = itemCpt.ID;
|
||||
itemCcpSes.Ses_No = itemSes.SES;
|
||||
itemCcpSes.Ses_Id = itemSes.ID;
|
||||
itemCcpSes.Contract_No = contractModel.FO_NO;
|
||||
itemCcpSes.Contract_Id = contractModel.ID;
|
||||
itemCcpSes.Project_Name = itemSes.Short_Description;
|
||||
itemCcpSes.Contractor_Quotation = itemSes.Quotation;
|
||||
itemCcpSes.Incl_Tax = itemSes.Tax_Value;
|
||||
itemCcpSes.Con_Days = itemSes.Con_Days;
|
||||
if (modifiedDict.ContainsKey(i))
|
||||
{
|
||||
if (itemDeleteCcp != null)
|
||||
{
|
||||
itemCcpSes.ThirdParty_PriceReview = (modifiedDict[i].ContainsKey("ThirdParty_PriceReview") && !string.IsNullOrWhiteSpace(modifiedDict[i]["ThirdParty_PriceReview"].ToString())) ? decimal.Parse(modifiedDict[i]["ThirdParty_PriceReview"].ToString()) : itemDeleteCcp.ThirdParty_PriceReview;
|
||||
itemCcpSes.Reduction = modifiedDict[i].ContainsKey("Reduction") ? decimal.Parse(modifiedDict[i]["Reduction"].ToString()) : itemDeleteCcp.Reduction;
|
||||
itemCcpSes.Reduction_Rate = modifiedDict[i].ContainsKey("Reduction_Rate") ? decimal.Parse(modifiedDict[i]["Reduction_Rate"].ToString()) : itemDeleteCcp.Reduction_Rate;
|
||||
itemCcpSes.Deduction_DeductionRate = modifiedDict[i].ContainsKey("DeductionDeduction_Rate") ? decimal.Parse(modifiedDict[i]["DeductionDeduction_Rate"].ToString()) : itemDeleteCcp.Deduction_DeductionRate;
|
||||
itemCcpSes.DelayedDeduction = modifiedDict[i].ContainsKey("DelayedDeduction") ? decimal.Parse(modifiedDict[i]["DelayedDeduction"].ToString()) : itemDeleteCcp.DelayedDeduction;
|
||||
itemCcpSes.Final_SettlementAmount = modifiedDict[i].ContainsKey("Final_SettlementAmount") ? decimal.Parse(modifiedDict[i]["Final_SettlementAmount"].ToString()) : itemDeleteCcp.Final_SettlementAmount;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.ThirdParty_PriceReview = (modifiedDict[i].ContainsKey("ThirdParty_PriceReview") && !string.IsNullOrWhiteSpace(modifiedDict[i]["ThirdParty_PriceReview"].ToString())) ? decimal.Parse(modifiedDict[i]["ThirdParty_PriceReview"].ToString()) : 0;
|
||||
itemCcpSes.Reduction = modifiedDict[i]["Reduction"] != null ? decimal.Parse(modifiedDict[i]["Reduction"].ToString()) : 0;
|
||||
itemCcpSes.Reduction_Rate = decimal.Parse(modifiedDict[i]["Reduction_Rate"].ToString());
|
||||
itemCcpSes.Deduction_DeductionRate = decimal.Parse(modifiedDict[i]["DeductionDeduction_Rate"].ToString());
|
||||
itemCcpSes.DelayedDeduction = decimal.Parse(modifiedDict[i]["DelayedDeduction"].ToString());
|
||||
itemCcpSes.Final_SettlementAmount = decimal.Parse(modifiedDict[i]["Final_SettlementAmount"].ToString());
|
||||
}
|
||||
|
||||
if (modifiedDict[i].ContainsKey("Con_Days") && !string.IsNullOrWhiteSpace(modifiedDict[i]["Con_Days"].ToString()))
|
||||
{
|
||||
itemCcpSes.Con_Days = int.Parse(modifiedDict[i]["Con_Days"].ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.ThirdParty_PriceReview = 0;
|
||||
itemCcpSes.Reduction = 0;
|
||||
itemCcpSes.Reduction_Rate = Math.Round(Convert.ToDecimal((itemSes.Quotation - itemSes.Tax_Value) / itemSes.Quotation) * 100, 2, MidpointRounding.AwayFromZero);
|
||||
itemCcpSes.Deduction_DeductionRate = itemCcpSes.Reduction_Rate > 10 ? -(Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.02), 2, MidpointRounding.AwayFromZero)) : 0;
|
||||
if (itemSes.Con_Days != null)
|
||||
{
|
||||
if (itemSes.Con_Days > 15 && itemSes.Con_Days <= 20)
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = -Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.05));
|
||||
}
|
||||
else if (itemSes.Con_Days > 20)
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = -Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.1));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemCcpSes.DelayedDeduction = 0;
|
||||
}
|
||||
// itemCcpSes.DelayedDeduction = itemSes.Con_Days > 15 ? -(Math.Round(Convert.ToDecimal((float)itemSes.Tax_Value * 0.1))) : 0;
|
||||
|
||||
itemCcpSes.Final_SettlementAmount = itemSes.Tax_Value + itemCcpSes.DelayedDeduction + itemCcpSes.DelayedDeduction;
|
||||
}
|
||||
|
||||
itemCcpSes.Created_Time = DateTime.Now;
|
||||
itemCcpSes.Created_UserId = CurrUser.UserId;
|
||||
itemCcpSes.Created_UserName = CurrUser.UserName;
|
||||
itemCcpSes.Created_ChineseName = CurrUser.ChineseName;
|
||||
ccpSess.Add(itemCcpSes);
|
||||
}
|
||||
Funs.DB.CCP_SESList.InsertAllOnSubmit(ccpSess);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
hidCcpId.Text = ccp.ID.ToString();
|
||||
}
|
||||
|
||||
hidContractNo.Text = contractModel.FO_NO;
|
||||
BindGrid();
|
||||
ShowNotify("操作成功!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否为数字
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsNumeric(string str)
|
||||
{
|
||||
var result = false;
|
||||
try
|
||||
{
|
||||
int.Parse(str);
|
||||
result = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+213
@@ -0,0 +1,213 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CCP {
|
||||
|
||||
|
||||
public partial class CcpEdit {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// panelTopRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelTopRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// ddlContractNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlContractNo;
|
||||
|
||||
/// <summary>
|
||||
/// txtCPT_No 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCPT_No;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// txtCcpNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCcpNo;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPaymentTerm 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPaymentTerm;
|
||||
|
||||
/// <summary>
|
||||
/// ddlDeductionDeductionRate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlDeductionDeductionRate;
|
||||
|
||||
/// <summary>
|
||||
/// ddlDelayedDeduction 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlDelayedDeduction;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// panelBottomRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelBottomRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid2;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// hidCcpId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hidCcpId;
|
||||
|
||||
/// <summary>
|
||||
/// hidContractNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hidContractNo;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CcpList.aspx.cs" Inherits="FineUIPro.Web.CCP.CcpList" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel2" />
|
||||
<f:Panel ID="Panel2" CssClass="blockpanel" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelTopRegion" RegionPosition="Center"
|
||||
Title="中间面板" ShowBorder="false" ShowHeader="false" Layout="VBox">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="ID,Contract_No,CCP_No" AllowCellEditing="true" DataIDField="ID"
|
||||
AllowSorting="true" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowSelectEvent="true" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtCCP_No" runat="server" Label="CCP No." LabelAlign="Right" EmptyText="Search by CCP No." NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:TextBox ID="txtContract_No" runat="server" Label="Contract No" LabelAlign="Right" EmptyText="Search by Contract No." NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:TextBox ID="txtSES_No" runat="server" Label="SES No." LabelAlign="Right" EmptyText="Search by SES No." NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:Button ID="btnSearch" Text="Search" Icon="SystemSearch" runat="server" Size="Medium" CssClass="marginr" OnClick="btnSearch_Click" />
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnAdd" ToolTip="Add" Text="Add" BoxConfigAlign="Center" Icon="Add" EnablePostBack="false" runat="server" EnableAjax="false"></f:Button>
|
||||
<f:Button ID="btnEdit" ToolTip="Modify" Text="Modify" Icon="Pencil" runat="server" OnClick="btnEdit_Click">
|
||||
</f:Button>
|
||||
|
||||
<f:Button ID="btnExportCcp" BoxConfigAlign="Center" runat="server" Text="导出CCP" ToolTip="ExportCCP Excel" Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnExportCcp_Click" EnablePress="true" Pressed="false">
|
||||
</f:Button>
|
||||
|
||||
<f:Button ID="btnExport" BoxConfigAlign="Center" runat="server" Text="导出" ToolTip="Export Excel" Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnExport_Click" EnablePress="true" Pressed="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="80px" ColumnID="CCP_No" DataField="CCP_No" SortField="CCP_No"
|
||||
FieldType="String" HeaderText="CCP No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Contract_No" DataField="Contract_No" SortField="Contract_No"
|
||||
FieldType="String" HeaderText="Contract No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="Contractor_Name" DataField="Contractor_Name" SortField="Contractor_Name"
|
||||
FieldType="String" HeaderText="Contractor Name" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="Contract_Title" DataField="Contract_Title" SortField="Contract_Title"
|
||||
FieldType="String" HeaderText="Contract Title" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Created_Time" DataField="Created_Time" SortField="Created_Time"
|
||||
FieldType="String" HeaderText="Created Time" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Pricing_Method" DataField="Pricing_Method" SortField="Pricing_Method"
|
||||
FieldType="String" HeaderText="Pricing Method" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Created_UserName" DataField="Created_UserName" SortField="Created_UserName"
|
||||
FieldType="String" HeaderText="Buyer" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="PaymentAmount" DataField="PaymentAmount" SortField="PaymentAmount"
|
||||
FieldType="String" HeaderText="付款金额" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:WindowField ColumnID="myWindowField" TextAlign="Center" Width="160px" WindowID="Window2" HeaderText="Upload Files"
|
||||
Icon="ApplicationGo" ToolTip="Upload Files" DataTextFormatString="{0}" DataIFrameUrlFields="ID,Contract_No,CCP_No"
|
||||
DataIFrameUrlFormatString="CCPUpload.aspx?id={0}&contractNo={1}&ccpno={2}&type=edit" DataWindowTitleField="Name"
|
||||
DataWindowTitleFormatString="附件上传 - {0}" />
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="Number of records per page:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="30" Value="30" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelBottomRegion" RegionPosition="Bottom" RegionSplit="true" RegionSplitWidth="20px" EnableCollapse="true" Height="400px"
|
||||
Title="底部面板" ShowBorder="false" ShowHeader="false" Layout="Fit">
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" CssClass="blockpanel" ShowBorder="true" ShowHeader="true" EnableCollapse="false" runat="server"
|
||||
DataKeyNames="Id" AllowSorting="true" SortField="SES" SortDirection="ASC"
|
||||
EnableSummary="true" SummaryPosition="Bottom">
|
||||
<Columns>
|
||||
<f:TemplateField Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="180px" ColumnID="Contract_No" DataField="Contract_No" SortField="Contract_No"
|
||||
FieldType="String" HeaderText="合同号" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="CCP_No" DataField="CCP_No" SortField="CCP_No"
|
||||
FieldType="String" HeaderText="CCP No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Ses_No" DataField="Ses_No" SortField="Ses_No"
|
||||
FieldType="String" HeaderText="Ses No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="Project_Name" DataField="Project_Name" SortField="Project_Name"
|
||||
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Contractor_Quotation" DataField="Contractor_Quotation" SortField="Contractor_Quotation"
|
||||
FieldType="String" HeaderText="承包商报价" HeaderTextAlign="Center" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Incl_Tax" DataField="Incl_Tax" SortField="Incl_Tax"
|
||||
FieldType="String" HeaderText="CTE/D审价" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ThirdParty_PriceReview" DataField="ThirdParty_PriceReview" SortField="ThirdParty_PriceReview"
|
||||
FieldType="String" HeaderText="第三方审价" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Reduction" DataField="Reduction" SortField="Reduction"
|
||||
FieldType="Float" HeaderText="核减额" HeaderTextAlign="Center" RendererFunction="renderSalaryFloat" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Reduction_Rate" DataField="Reduction_Rate" SortField="Reduction_Rate"
|
||||
FieldType="String" HeaderText="核减率" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Deduction_DeductionRate" DataField="Deduction_DeductionRate" SortField="Deduction_DeductionRate"
|
||||
FieldType="Float" HeaderText="高核减率扣款" HeaderTextAlign="Center" TextAlign="Right" RendererFunction="renderSalaryFloat">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Con_Days" DataField="Con_Days" SortField="Con_Days"
|
||||
FieldType="Int" HeaderText="SSR结算提交天数" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="DelayedDeduction" DataField="DelayedDeduction" SortField="DelayedDeduction"
|
||||
FieldType="Float" HeaderText="延迟扣款" HeaderTextAlign="Center" TextAlign="Right" RendererFunction="renderSalaryFloat">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Final_SettlementAmount" DataField="Final_SettlementAmount" SortField="Final_SettlementAmount"
|
||||
FieldType="String" HeaderText="最终结算金额(含税)" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="Pop-up window" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" AutoScroll="true" IsModal="false" CloseAction="HidePostBack"
|
||||
Width="1500px" Height="880px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="Pop-up window" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="Window2_Close" AutoScroll="true" IsModal="false" CloseAction="HidePostBack"
|
||||
Width="1000px" Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var grid2ClientID = '<%= Grid2.ClientID %>';
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
|
||||
function renderSalaryFloat(value) {
|
||||
return F.addCommas(value.toFixed(2));
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -0,0 +1,951 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.CCP
|
||||
{
|
||||
public partial class CcpList : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
//权限控制
|
||||
GetButtonPower();//权限设置
|
||||
//if (CurrUser.Account == Const.Gly || CurrUser.RoleId == "bcdefa35-19d5-4629-bc7d-e6bb4b8aaa74")
|
||||
//{
|
||||
// this.btnEdit.Hidden = false;
|
||||
// this.btnAdd.Hidden = false;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// this.btnEdit.Hidden = true;
|
||||
// this.btnAdd.Hidden = true;
|
||||
//}
|
||||
//添加
|
||||
btnAdd.OnClientClick = Window1.GetShowReference("CcpEdit.aspx", "添加CCP") + "return false;";
|
||||
}
|
||||
}
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定CCP_List
|
||||
/// </summary>
|
||||
private void BindGrid(int id = 0)
|
||||
{
|
||||
string strSql = @"SELECT ID,CCP_No,CPT_No,Contract_No,Contractor_CN+' '+Contractor_Eng as Contractor_Name,Contract_Title,
|
||||
Created_Time,Pricing_Method,Created_UserName,
|
||||
(select SUM(Final_SettlementAmount) from CCP_SESList as s where s.CCP_Id=a.ID ) as PaymentAmount
|
||||
FROM CCP_List as a where 1=1";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql = strSql + " AND a.Created_UserId=@Created_UserId";
|
||||
listStr.Add(new SqlParameter("@Created_UserId", CurrUser.UserId));
|
||||
if (!string.IsNullOrEmpty(txtCCP_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.CCP_No=@CCP_No";
|
||||
listStr.Add(new SqlParameter("@CCP_No", txtCCP_No.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtContract_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.Contract_No=@Contract_No";
|
||||
listStr.Add(new SqlParameter("@Contract_No", txtContract_No.Text.Trim()));
|
||||
}
|
||||
if (id > 0)
|
||||
{
|
||||
strSql = strSql + " AND a.Id=@Id";
|
||||
listStr.Add(new SqlParameter("@Id", id));
|
||||
}
|
||||
|
||||
strSql = strSql + " ORDER BY a.CCP_No ASC";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = dt.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, dt);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定CCP_SESList
|
||||
/// </summary>
|
||||
private void BindGrid1(int ccp_Id = 0)
|
||||
{
|
||||
|
||||
string strSql = @"SELECT ID,CCP_No,CCP_Id,CPT_No,CPT_Id,Ses_No,Ses_Id,Contract_No,Contract_Id,Project_Name,
|
||||
Contractor_Quotation,Incl_Tax,ThirdParty_PriceReview,Con_Days,Reduction,Reduction_Rate,
|
||||
Deduction_DeductionRate,DelayedDeduction,Final_SettlementAmount,Created_Time,Created_UserId,
|
||||
Created_UserName,Created_ChineseName
|
||||
FROM dbo.CCP_SESList where 1=1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql = strSql + " AND CCP_Id=@ccp_Id";
|
||||
listStr.Add(new SqlParameter("@ccp_Id", ccp_Id));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid2.RecordCount = dt.Rows.Count;
|
||||
Grid2.DataSource = dt;
|
||||
Grid2.DataBind();
|
||||
|
||||
JObject summary = new JObject();
|
||||
summary.Add("Contractor_Quotation", dt.AsEnumerable().Sum(s => s.Field<decimal>("Contractor_Quotation")).ToString("#,##0.00"));
|
||||
summary.Add("Incl_Tax", dt.AsEnumerable().Sum(s => s.Field<decimal>("Incl_Tax")).ToString("#,##0.00"));
|
||||
summary.Add("Reduction", dt.AsEnumerable().Sum(s => s.Field<decimal>("Reduction")).ToString("#,##0.00"));
|
||||
summary.Add("Deduction_DeductionRate", dt.AsEnumerable().Sum(s => s.Field<decimal>("Deduction_DeductionRate")).ToString("#,##0.00"));
|
||||
summary.Add("DelayedDeduction", dt.AsEnumerable().Sum(s => s.Field<decimal>("DelayedDeduction")).ToString("#,##0.00"));
|
||||
summary.Add("Final_SettlementAmount", dt.AsEnumerable().Sum(s => s.Field<decimal>("Final_SettlementAmount")).ToString("#,##0.00"));
|
||||
Grid2.SummaryData = summary;
|
||||
|
||||
for (int i = 0; i < Grid2.Rows.Count; i++)
|
||||
{
|
||||
Grid2.Rows[i].Values[9] = string.Format("{0}{1}", Grid2.Rows[i].Values[9], "%");
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭窗口1
|
||||
/// </summary>
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭窗口2
|
||||
/// </summary>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
//int row = int.Parse(Grid1.SelectedRowID) - 1;
|
||||
int row = Grid1.SelectedRowIndex;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("CcpEdit.aspx?CcpId={0}&contractNo={1}", Grid1.DataKeys[row][0], Grid1.DataKeys[row][1], "编辑CCP")));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 选择加载
|
||||
/// <summary>
|
||||
/// 选择加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
|
||||
{
|
||||
BindGrid1(Convert.ToInt32(this.Grid1.SelectedRowID));
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 搜索
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(txtSES_No.Text.Trim()))
|
||||
{
|
||||
var sesModel = Funs.DB.CCP_SESList.FirstOrDefault(p => p.Ses_No == txtSES_No.Text.Trim());
|
||||
if (sesModel != null)
|
||||
{
|
||||
var ccpModel = Funs.DB.CCP_List.FirstOrDefault(p => p.ID == sesModel.CCP_Id);
|
||||
BindGrid(sesModel.CCP_Id);
|
||||
BindGrid1(sesModel.CCP_Id);
|
||||
Alert.ShowInTop(string.Format("CCP:{0},Contract No:{1},Buyer:{2}", string.Format("{0:d3}", sesModel.CCP_No), sesModel.Contract_No, ccpModel.Buyer), MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("CCP:,Contract No:,Buyer:", MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
protected void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
//int row = int.Parse(Grid1.SelectedRowID) - 1;
|
||||
int row = Grid1.SelectedRowIndex;
|
||||
int Id = int.Parse(Grid1.DataKeys[row][0].ToString());
|
||||
string ContractNo = Grid1.DataKeys[row][1].ToString();
|
||||
int ccpNo = int.Parse(Grid1.DataKeys[row][2].ToString());
|
||||
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
|
||||
//模板文件
|
||||
string TempletFileName = rootPath + "CCPReport.xlsx";
|
||||
//导出文件
|
||||
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
|
||||
if (!Directory.Exists(filePath))
|
||||
{
|
||||
Directory.CreateDirectory(filePath);
|
||||
}
|
||||
string ReportFileName = filePath + "out.xls";
|
||||
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
|
||||
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
|
||||
XSSFSheet ws = (XSSFSheet)hssfworkbook.GetSheetAt(0);
|
||||
var ccp = Funs.DB.CCP_List.FirstOrDefault(x => x.ID == Id);
|
||||
//获取当前和此CCP之前的信息
|
||||
var ccpAllLs = Funs.DB.CCP_List.Where(p => p.CCP_No <= ccpNo && p.Contract_Id == ccp.Contract_Id).ToList();
|
||||
//获取CCP信息
|
||||
var ccpModel = ccpAllLs.FirstOrDefault(p => p.ID == Id);
|
||||
if (ccpModel != null)
|
||||
{
|
||||
//获取当前和之前所有的ccpses的信息
|
||||
var ccpAllSesLs = Funs.DB.CCP_SESList.Where(p => ccpAllLs.ConvertAll(s => s.ID).Contains(p.CCP_Id));
|
||||
//获取CcpSes信息
|
||||
var ccpSess = ccpAllSesLs.Where(p => p.CCP_Id == Id).OrderBy(p => p.CPT_No).ToList();
|
||||
if (ccpSess.Count > 0)
|
||||
{
|
||||
|
||||
#region 左边
|
||||
//承包商名称
|
||||
if (ws.GetRow(3).GetCell(1) == null) ws.GetRow(3).CreateCell(1);
|
||||
ws.GetRow(3).GetCell(1).SetCellValue(ccpModel.Contractor_CN + "\n" + ccpModel.Contractor_Eng);
|
||||
//合同名称
|
||||
if (ws.GetRow(4).GetCell(1) == null) ws.GetRow(4).CreateCell(1);
|
||||
ws.GetRow(4).GetCell(1).SetCellValue(ccpModel.Contract_Title);
|
||||
//合同类型
|
||||
if (ws.GetRow(5).GetCell(1) == null) ws.GetRow(5).CreateCell(1);
|
||||
ws.GetRow(5).GetCell(1).SetCellValue(ccpModel.Contract_Type);
|
||||
//合同计价方式
|
||||
if (ws.GetRow(6).GetCell(1) == null) ws.GetRow(6).CreateCell(1);
|
||||
ws.GetRow(6).GetCell(1).SetCellValue(ccpModel.Pricing_Method);
|
||||
//合同付款条件
|
||||
if (ws.GetRow(7).GetCell(1) == null) ws.GetRow(7).CreateCell(1);
|
||||
var payType = ccpModel.Payment_Term == "0" ? "按月" : "按季";
|
||||
//var payZnum = ccpModel.Payment_Term == "0" ? "三十" : "九十";
|
||||
//var paynum = ccpModel.Payment_Term == "0" ? "30" : "90";
|
||||
//var paymentTermExplain = string.Format("合同价款{0}支付,业主将在收到正确的发票原件以后{1}({2})日内支付。", payType, payZnum, paynum);
|
||||
var paymentTermExplain = string.Format("合同价款{0}支付,业主将在收到正确的发票原件以后三十(30)日内支付。", payType);
|
||||
ws.GetRow(7).GetCell(1).SetCellValue(paymentTermExplain);
|
||||
//本次付款确认单的序列号
|
||||
if (ws.GetRow(9).GetCell(2) == null) ws.GetRow(9).CreateCell(2);
|
||||
ws.GetRow(9).GetCell(2).SetCellValue(string.Format("{0:d3}", ccpModel.CCP_No));
|
||||
//已付总金额
|
||||
var yfzje = 0d;
|
||||
if (ccpAllSesLs.Count(p => p.CCP_Id != Id) > 0)
|
||||
{
|
||||
yfzje = (double)ccpAllSesLs.Where(p => p.CCP_Id != Id).Sum(p => p.Final_SettlementAmount).Value;
|
||||
}
|
||||
if (ws.GetRow(11).GetCell(2) == null) ws.GetRow(11).CreateCell(2);
|
||||
ws.GetRow(11).GetCell(2).SetCellValue(yfzje);
|
||||
//本次付款金额
|
||||
if (ws.GetRow(12).GetCell(2) == null) ws.GetRow(12).CreateCell(2);
|
||||
ws.GetRow(12).GetCell(2).SetCellValue(ccpSess.Count > 0 ? (double)ccpSess.Sum(p => p.Final_SettlementAmount).Value : 0);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 右边
|
||||
|
||||
//承包商代码
|
||||
if (ws.GetRow(3).GetCell(7) == null) ws.GetRow(3).CreateCell(7);
|
||||
ws.GetRow(3).GetCell(7).SetCellValue(ccpModel.Vendor_Code);
|
||||
//合同号
|
||||
if (ws.GetRow(4).GetCell(7) == null) ws.GetRow(4).CreateCell(7);
|
||||
ws.GetRow(4).GetCell(7).SetCellValue(ccpModel.Contract_No);
|
||||
//责任采购员
|
||||
if (ws.GetRow(5).GetCell(7) == null) ws.GetRow(5).CreateCell(7);
|
||||
ws.GetRow(5).GetCell(7).SetCellValue(ccpModel.Buyer);
|
||||
//合同预算值
|
||||
if (ws.GetRow(6).GetCell(7) == null) ws.GetRow(6).CreateCell(7);
|
||||
ws.GetRow(6).GetCell(7).SetCellValue((double)ccpModel.Contract_Budget);
|
||||
//次付款对应的CPT号
|
||||
var cpts = ccpModel.CPT_No.Split(',').Select(p => string.Format("{0:d3}", int.Parse(p.Split('-').LastOrDefault()))).ToList();
|
||||
if (ws.GetRow(9).GetCell(7) == null) ws.GetRow(9).CreateCell(7);
|
||||
ws.GetRow(9).GetCell(7).SetCellValue(string.Join(",", cpts.ToArray()));
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格
|
||||
|
||||
XSSFSheet wstwo = (XSSFSheet)hssfworkbook.GetSheet("sheet2");
|
||||
|
||||
#region 样式
|
||||
|
||||
//全局边框靠左
|
||||
XSSFFont font = (XSSFFont)hssfworkbook.CreateFont();
|
||||
font.FontHeightInPoints = 10;
|
||||
font.FontName = "Arial";
|
||||
ICellStyle style = hssfworkbook.CreateCellStyle();
|
||||
style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.VerticalAlignment = VerticalAlignment.Center;
|
||||
style.Alignment = HorizontalAlignment.Left;
|
||||
style.WrapText = true;
|
||||
style.SetFont(font);
|
||||
//全局边框靠左红色字体
|
||||
XSSFFont font1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
font1.FontHeightInPoints = 10;
|
||||
font1.FontName = "Arial";
|
||||
font1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle style1 = hssfworkbook.CreateCellStyle();
|
||||
style1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.VerticalAlignment = VerticalAlignment.Center;
|
||||
style1.Alignment = HorizontalAlignment.Left;
|
||||
style1.WrapText = true;
|
||||
style1.SetFont(font1);
|
||||
|
||||
//全局边框靠右
|
||||
XSSFFont rfont = (XSSFFont)hssfworkbook.CreateFont();
|
||||
rfont.FontHeightInPoints = 10;
|
||||
rfont.FontName = "Arial";
|
||||
ICellStyle rstyle = hssfworkbook.CreateCellStyle();
|
||||
rstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
rstyle.Alignment = HorizontalAlignment.Right;
|
||||
rstyle.WrapText = true;
|
||||
rstyle.SetFont(font);
|
||||
//全局边框靠右红色字体
|
||||
XSSFFont rfont1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
rfont1.FontHeightInPoints = 10;
|
||||
rfont1.FontName = "Arial";
|
||||
rfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle rstyle1 = hssfworkbook.CreateCellStyle();
|
||||
rstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
rstyle1.Alignment = HorizontalAlignment.Right;
|
||||
rstyle1.WrapText = true;
|
||||
rstyle1.SetFont(font1);
|
||||
|
||||
|
||||
IDataFormat dataformat = hssfworkbook.CreateDataFormat();
|
||||
//千分位全局边框靠右
|
||||
XSSFFont qfont = (XSSFFont)hssfworkbook.CreateFont();
|
||||
qfont.FontHeightInPoints = 10;
|
||||
qfont.FontName = "Arial";
|
||||
ICellStyle qstyle = hssfworkbook.CreateCellStyle();
|
||||
qstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle.Alignment = HorizontalAlignment.Right;
|
||||
qstyle.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle.SetFont(qfont);
|
||||
//千分位全局边框靠右红色字体
|
||||
XSSFFont qfont1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
qfont1.FontHeightInPoints = 10;
|
||||
qfont1.FontName = "Arial";
|
||||
qfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle qstyle1 = hssfworkbook.CreateCellStyle();
|
||||
qstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle1.Alignment = HorizontalAlignment.Right;
|
||||
qstyle1.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle1.SetFont(qfont1);
|
||||
|
||||
//百分比全局边框靠右
|
||||
XSSFFont bfont = (XSSFFont)hssfworkbook.CreateFont();
|
||||
bfont.FontHeightInPoints = 10;
|
||||
bfont.FontName = "Arial";
|
||||
ICellStyle bstyle = hssfworkbook.CreateCellStyle();
|
||||
bstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
bstyle.Alignment = HorizontalAlignment.Right;
|
||||
bstyle.DataFormat = dataformat.GetFormat("0.00%");
|
||||
bstyle.SetFont(bfont);
|
||||
//百分比全局边框靠右红色字体
|
||||
XSSFFont bfont1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
bfont1.FontHeightInPoints = 10;
|
||||
bfont1.FontName = "Arial";
|
||||
bfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle bstyle1 = hssfworkbook.CreateCellStyle();
|
||||
bstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
bstyle1.Alignment = HorizontalAlignment.Right;
|
||||
bstyle1.DataFormat = dataformat.GetFormat("0.00%");
|
||||
bstyle1.SetFont(bfont1);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格数据
|
||||
|
||||
int rowindex = 5;
|
||||
foreach (var item in ccpSess)
|
||||
{
|
||||
//合同号
|
||||
if (wstwo.GetRow(rowindex).GetCell(0) == null) wstwo.GetRow(rowindex).CreateCell(0);
|
||||
wstwo.GetRow(rowindex).GetCell(0).SetCellValue(item.Contract_No);
|
||||
wstwo.GetRow(rowindex).GetCell(0).CellStyle = style;
|
||||
//CCP No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(1) == null) wstwo.GetRow(rowindex).CreateCell(1);
|
||||
wstwo.GetRow(rowindex).GetCell(1).SetCellValue(string.Format("{0:d3}", item.CCP_No));
|
||||
wstwo.GetRow(rowindex).GetCell(1).CellStyle = style;
|
||||
//CPT No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(2) == null) wstwo.GetRow(rowindex).CreateCell(2);
|
||||
wstwo.GetRow(rowindex).GetCell(2).SetCellValue(item.CPT_No.Split('-').LastOrDefault());
|
||||
wstwo.GetRow(rowindex).GetCell(2).CellStyle = style;
|
||||
//SES No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(3) == null) wstwo.GetRow(rowindex).CreateCell(3);
|
||||
wstwo.GetRow(rowindex).GetCell(3).SetCellValue(item.Ses_No);
|
||||
wstwo.GetRow(rowindex).GetCell(3).CellStyle = style;
|
||||
//项目名称
|
||||
if (wstwo.GetRow(rowindex).GetCell(4) == null) wstwo.GetRow(rowindex).CreateCell(4);
|
||||
wstwo.GetRow(rowindex).GetCell(4).SetCellValue(item.Project_Name);
|
||||
wstwo.GetRow(rowindex).GetCell(4).CellStyle = style;
|
||||
//承包商报价
|
||||
if (wstwo.GetRow(rowindex).GetCell(5) == null) wstwo.GetRow(rowindex).CreateCell(5);
|
||||
wstwo.GetRow(rowindex).GetCell(5).SetCellValue((double)item.Contractor_Quotation);
|
||||
wstwo.GetRow(rowindex).GetCell(5).CellStyle = item.Contractor_Quotation.Value >= 0 ? qstyle : qstyle1;
|
||||
//CTE/D审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(6) == null) wstwo.GetRow(rowindex).CreateCell(6);
|
||||
wstwo.GetRow(rowindex).GetCell(6).SetCellValue((double)item.Incl_Tax);
|
||||
wstwo.GetRow(rowindex).GetCell(6).CellStyle = item.Incl_Tax.Value >= 0 ? qstyle : qstyle1;
|
||||
//第三方审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(7) == null) wstwo.GetRow(rowindex).CreateCell(7);
|
||||
wstwo.GetRow(rowindex).GetCell(7).SetCellValue((double)item.ThirdParty_PriceReview);
|
||||
wstwo.GetRow(rowindex).GetCell(7).CellStyle = item.ThirdParty_PriceReview.Value >= 0 ? qstyle : qstyle1;
|
||||
//核减额
|
||||
if (wstwo.GetRow(rowindex).GetCell(8) == null) wstwo.GetRow(rowindex).CreateCell(8);
|
||||
wstwo.GetRow(rowindex).GetCell(8).SetCellValue((double)item.Reduction);
|
||||
wstwo.GetRow(rowindex).GetCell(8).CellStyle = item.Reduction.Value >= 0 ? qstyle : qstyle1;
|
||||
//核减率
|
||||
if (wstwo.GetRow(rowindex).GetCell(9) == null) wstwo.GetRow(rowindex).CreateCell(9);
|
||||
wstwo.GetRow(rowindex).GetCell(9).SetCellValue((double)item.Reduction_Rate / 100);
|
||||
wstwo.GetRow(rowindex).GetCell(9).CellStyle = item.Reduction_Rate.Value >= 0 ? bstyle : bstyle1;
|
||||
//高核减率扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(10) == null) wstwo.GetRow(rowindex).CreateCell(10);
|
||||
wstwo.GetRow(rowindex).GetCell(10).SetCellValue((double)item.Deduction_DeductionRate);
|
||||
wstwo.GetRow(rowindex).GetCell(10).CellStyle = item.Deduction_DeductionRate.Value >= 0 ? qstyle : qstyle1;
|
||||
//SSR结算提交天数
|
||||
if (wstwo.GetRow(rowindex).GetCell(11) == null) wstwo.GetRow(rowindex).CreateCell(11);
|
||||
wstwo.GetRow(rowindex).GetCell(11).SetCellValue(item.Con_Days != null ? item.Con_Days.Value : 0);
|
||||
wstwo.GetRow(rowindex).GetCell(11).CellStyle = item.Con_Days != null && item.Con_Days.Value > 0 ? rstyle : rstyle1;
|
||||
//延迟扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(12) == null) wstwo.GetRow(rowindex).CreateCell(12);
|
||||
wstwo.GetRow(rowindex).GetCell(12).SetCellValue((double)item.DelayedDeduction);
|
||||
wstwo.GetRow(rowindex).GetCell(12).CellStyle = item.DelayedDeduction.Value >= 0 ? qstyle : qstyle1;
|
||||
//最终结算金额(含税)
|
||||
if (wstwo.GetRow(rowindex).GetCell(13) == null) wstwo.GetRow(rowindex).CreateCell(13);
|
||||
wstwo.GetRow(rowindex).GetCell(13).SetCellValue((double)item.Final_SettlementAmount);
|
||||
wstwo.GetRow(rowindex).GetCell(13).CellStyle = item.Final_SettlementAmount >= 0 ? qstyle : qstyle1;
|
||||
|
||||
rowindex++;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 合计
|
||||
//合同号
|
||||
if (wstwo.GetRow(rowindex).GetCell(0) == null) wstwo.GetRow(rowindex).CreateCell(0);
|
||||
wstwo.GetRow(rowindex).GetCell(0).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(0).CellStyle = style;
|
||||
//CCP No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(1) == null) wstwo.GetRow(rowindex).CreateCell(1);
|
||||
wstwo.GetRow(rowindex).GetCell(1).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(1).CellStyle = style;
|
||||
//CPT No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(2) == null) wstwo.GetRow(rowindex).CreateCell(2);
|
||||
wstwo.GetRow(rowindex).GetCell(2).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(2).CellStyle = style;
|
||||
//SES No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(3) == null) wstwo.GetRow(rowindex).CreateCell(3);
|
||||
wstwo.GetRow(rowindex).GetCell(3).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(3).CellStyle = style;
|
||||
//项目名称
|
||||
if (wstwo.GetRow(rowindex).GetCell(4) == null) wstwo.GetRow(rowindex).CreateCell(4);
|
||||
wstwo.GetRow(rowindex).GetCell(4).SetCellValue("总计");
|
||||
wstwo.GetRow(rowindex).GetCell(4).CellStyle = style;
|
||||
//承包商报价
|
||||
if (wstwo.GetRow(rowindex).GetCell(5) == null) wstwo.GetRow(rowindex).CreateCell(5);
|
||||
wstwo.GetRow(rowindex).GetCell(5).SetCellValue((double)ccpSess.Sum(p => p.Contractor_Quotation));
|
||||
wstwo.GetRow(rowindex).GetCell(5).CellStyle = ccpSess.Sum(p => p.Contractor_Quotation) >= 0 ? qstyle : qstyle1;
|
||||
//CTE/D审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(6) == null) wstwo.GetRow(rowindex).CreateCell(6);
|
||||
wstwo.GetRow(rowindex).GetCell(6).SetCellValue((double)ccpSess.Sum(p => p.Incl_Tax));
|
||||
wstwo.GetRow(rowindex).GetCell(6).CellStyle = ccpSess.Sum(p => p.Incl_Tax) >= 0 ? qstyle : qstyle1;
|
||||
//第三方审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(7) == null) wstwo.GetRow(rowindex).CreateCell(7);
|
||||
wstwo.GetRow(rowindex).GetCell(7).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(7).CellStyle = style;
|
||||
//核减额
|
||||
if (wstwo.GetRow(rowindex).GetCell(8) == null) wstwo.GetRow(rowindex).CreateCell(8);
|
||||
wstwo.GetRow(rowindex).GetCell(8).SetCellValue((double)ccpSess.Sum(p => p.Reduction));
|
||||
wstwo.GetRow(rowindex).GetCell(8).CellStyle = ccpSess.Sum(p => p.Reduction) >= 0 ? qstyle : qstyle1;
|
||||
//核减率
|
||||
if (wstwo.GetRow(rowindex).GetCell(9) == null) wstwo.GetRow(rowindex).CreateCell(9);
|
||||
wstwo.GetRow(rowindex).GetCell(9).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(9).CellStyle = style;
|
||||
//高核减率扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(10) == null) wstwo.GetRow(rowindex).CreateCell(10);
|
||||
wstwo.GetRow(rowindex).GetCell(10).SetCellValue((double)ccpSess.Sum(p => p.Deduction_DeductionRate));
|
||||
wstwo.GetRow(rowindex).GetCell(10).CellStyle = ccpSess.Sum(p => p.Deduction_DeductionRate) >= 0 ? qstyle : qstyle1;
|
||||
//SSR结算提交天数
|
||||
if (wstwo.GetRow(rowindex).GetCell(11) == null) wstwo.GetRow(rowindex).CreateCell(11);
|
||||
wstwo.GetRow(rowindex).GetCell(11).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(11).CellStyle = style;
|
||||
//延迟扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(12) == null) wstwo.GetRow(rowindex).CreateCell(12);
|
||||
wstwo.GetRow(rowindex).GetCell(12).SetCellValue((double)ccpSess.Sum(p => p.DelayedDeduction));
|
||||
wstwo.GetRow(rowindex).GetCell(12).CellStyle = ccpSess.Sum(p => p.DelayedDeduction) >= 0 ? qstyle : qstyle1;
|
||||
//最终结算金额(含税)
|
||||
if (wstwo.GetRow(rowindex).GetCell(13) == null) wstwo.GetRow(rowindex).CreateCell(13);
|
||||
wstwo.GetRow(rowindex).GetCell(13).SetCellValue((double)ccpSess.Sum(p => p.Final_SettlementAmount));
|
||||
wstwo.GetRow(rowindex).GetCell(13).CellStyle = ccpSess.Sum(p => p.Final_SettlementAmount) >= 0 ? qstyle : qstyle1;
|
||||
|
||||
#endregion
|
||||
|
||||
#region TT30和BD90
|
||||
|
||||
int ttrate = 0;
|
||||
double ttMount = 0;
|
||||
int dbrate = 0;
|
||||
double dbMount = 0;
|
||||
var ttDbhsl = (ccpSess.Sum(p => p.Contractor_Quotation) - ccpSess.Sum(p => p.Final_SettlementAmount)) / ccpSess.Sum(p => p.Contractor_Quotation) * 100;
|
||||
if (ttDbhsl < 10)
|
||||
{
|
||||
ttrate = 100;
|
||||
ttMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount);
|
||||
}
|
||||
else if (ttDbhsl >= 10 && ttDbhsl < 20)
|
||||
{
|
||||
ttrate = 70;
|
||||
ttMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount) * 0.7;
|
||||
dbrate = 30;
|
||||
dbMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount) - ttMount;
|
||||
}
|
||||
else
|
||||
{
|
||||
ttrate = 50;
|
||||
ttMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount) / 2;
|
||||
dbrate = 50;
|
||||
dbMount = ttMount;
|
||||
}
|
||||
//TT30比例
|
||||
if (wstwo.GetRow(1).GetCell(12) == null) wstwo.GetRow(1).CreateCell(12);
|
||||
wstwo.GetRow(1).GetCell(12).SetCellValue(ttrate);
|
||||
wstwo.GetRow(1).GetCell(12).CellStyle = style;
|
||||
//TT30金额
|
||||
if (wstwo.GetRow(1).GetCell(13) == null) wstwo.GetRow(1).CreateCell(13);
|
||||
wstwo.GetRow(1).GetCell(13).SetCellValue(ttMount);
|
||||
wstwo.GetRow(1).GetCell(13).CellStyle = ttMount >= 0 ? qstyle : qstyle1;
|
||||
|
||||
//BD90比例
|
||||
if (wstwo.GetRow(2).GetCell(12) == null) wstwo.GetRow(2).CreateCell(12);
|
||||
wstwo.GetRow(2).GetCell(12).SetCellValue(dbrate);
|
||||
wstwo.GetRow(2).GetCell(12).CellStyle = style;
|
||||
//BD90金额
|
||||
if (wstwo.GetRow(2).GetCell(13) == null) wstwo.GetRow(2).CreateCell(13);
|
||||
wstwo.GetRow(2).GetCell(13).SetCellValue(dbMount);
|
||||
wstwo.GetRow(2).GetCell(13).CellStyle = dbMount >= 0 ? qstyle : qstyle1;
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
ws.ForceFormulaRecalculation = true;
|
||||
wstwo.ForceFormulaRecalculation = true;
|
||||
using (FileStream filess = File.OpenWrite(ReportFileName))
|
||||
{
|
||||
hssfworkbook.Write(filess);
|
||||
}
|
||||
FileInfo filet = new FileInfo(ReportFileName);
|
||||
Response.Clear();
|
||||
Response.Charset = "GB2312";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(string.Format("{0}-CCP-{1}", ccpModel.Contract_No, string.Format("{0:d3}", ccpModel.CCP_No))) + ".xlsx");
|
||||
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
|
||||
Response.AddHeader("Content-Length", filet.Length.ToString());
|
||||
// 指定返回的是一个不能被客户端读取的流,必须被下载
|
||||
Response.ContentType = "application/ms-excel";
|
||||
// 把文件流发送到客户端
|
||||
Response.WriteFile(filet.FullName);
|
||||
// 停止页面的执行
|
||||
Response.End();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("当前CCP没有SES明细信息,无法导出!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出ccp列表
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnExportCcp_Click(object sender, EventArgs e)
|
||||
{
|
||||
var fileName = string.Format("{0}_{1}", "CCP", DateTime.Now.ToString("yyyy-MM-dd"));
|
||||
|
||||
XSSFWorkbook book = new XSSFWorkbook();
|
||||
System.IO.MemoryStream ms = new System.IO.MemoryStream();
|
||||
string strSql = @"SELECT ID,CCP_No,CPT_No,Contract_No,Contractor_CN+' '+Contractor_Eng as Contractor_Name,Contract_Title,Created_Time,Pricing_Method,Created_UserName,(select SUM(Final_SettlementAmount) from CCP_SESList as s where s.CCP_Id=a.ID ) as PaymentAmount FROM CCP_List as a where 1=1";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql = strSql + " AND a.Created_UserId=@Created_UserId";
|
||||
listStr.Add(new SqlParameter("@Created_UserId", CurrUser.UserId));
|
||||
if (!string.IsNullOrEmpty(txtCCP_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.CCP_No=@CCP_No";
|
||||
listStr.Add(new SqlParameter("@CCP_No", txtCCP_No.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtContract_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.Contract_No=@Contract_No";
|
||||
listStr.Add(new SqlParameter("@Contract_No", txtContract_No.Text.Trim()));
|
||||
}
|
||||
strSql = strSql + " ORDER BY a.CCP_No ASC";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
if (dt.Rows.Count == 0)
|
||||
{
|
||||
Alert.ShowInParent("当前CCP没有无数据,无法导出!");
|
||||
return;
|
||||
}
|
||||
|
||||
//sheet名称
|
||||
XSSFSheet sheet = (XSSFSheet)book.CreateSheet(fileName);
|
||||
|
||||
#region 样式
|
||||
|
||||
//列头居中样式
|
||||
XSSFFont tfont = (XSSFFont)book.CreateFont();
|
||||
tfont.FontHeightInPoints = 10;
|
||||
tfont.FontName = "Arial";
|
||||
tfont.IsBold = true;
|
||||
ICellStyle titleStyle = book.CreateCellStyle();
|
||||
titleStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
titleStyle.Alignment = HorizontalAlignment.Center;
|
||||
titleStyle.WrapText = true;
|
||||
titleStyle.SetFont(tfont);
|
||||
|
||||
//全局边框靠左
|
||||
XSSFFont font = (XSSFFont)book.CreateFont();
|
||||
font.FontHeightInPoints = 10;
|
||||
font.FontName = "Arial";
|
||||
ICellStyle style = book.CreateCellStyle();
|
||||
style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.VerticalAlignment = VerticalAlignment.Center;
|
||||
style.Alignment = HorizontalAlignment.Left;
|
||||
style.WrapText = true;
|
||||
style.SetFont(font);
|
||||
|
||||
//全局边框靠右
|
||||
XSSFFont rfont = (XSSFFont)book.CreateFont();
|
||||
rfont.FontHeightInPoints = 10;
|
||||
rfont.FontName = "Arial";
|
||||
ICellStyle rstyle = book.CreateCellStyle();
|
||||
rstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
rstyle.Alignment = HorizontalAlignment.Right;
|
||||
rstyle.WrapText = true;
|
||||
rstyle.SetFont(font);
|
||||
|
||||
IDataFormat dataformat = book.CreateDataFormat();
|
||||
//千分位全局边框靠右
|
||||
XSSFFont qfont = (XSSFFont)book.CreateFont();
|
||||
qfont.FontHeightInPoints = 10;
|
||||
qfont.FontName = "Arial";
|
||||
ICellStyle qstyle = book.CreateCellStyle();
|
||||
qstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle.Alignment = HorizontalAlignment.Right;
|
||||
qstyle.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle.SetFont(qfont);
|
||||
//千分位全局边框靠右红色字体
|
||||
XSSFFont qfont1 = (XSSFFont)book.CreateFont();
|
||||
qfont1.FontHeightInPoints = 10;
|
||||
qfont1.FontName = "Arial";
|
||||
qfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle qstyle1 = book.CreateCellStyle();
|
||||
qstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle1.Alignment = HorizontalAlignment.Right;
|
||||
qstyle1.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle1.SetFont(qfont1);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 设置列宽度
|
||||
|
||||
sheet.SetColumnWidth(0, 10 * 256);
|
||||
sheet.SetColumnWidth(1, 20 * 256);
|
||||
sheet.SetColumnWidth(2, 70 * 256);
|
||||
sheet.SetColumnWidth(3, 30 * 256);
|
||||
sheet.SetColumnWidth(4, 20 * 256);
|
||||
sheet.SetColumnWidth(5, 30 * 256);
|
||||
sheet.SetColumnWidth(6, 20 * 256);
|
||||
sheet.SetColumnWidth(7, 20 * 256);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 列头
|
||||
|
||||
XSSFRow headerRow = (XSSFRow)sheet.CreateRow(0);
|
||||
headerRow.CreateCell(0).SetCellValue("CCP No");
|
||||
headerRow.GetCell(0).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(1).SetCellValue("Contract No");
|
||||
headerRow.GetCell(1).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(2).SetCellValue("Contractor Name");
|
||||
headerRow.GetCell(2).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(3).SetCellValue("Contract Title");
|
||||
headerRow.GetCell(3).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(4).SetCellValue("Created Time");
|
||||
headerRow.GetCell(4).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(5).SetCellValue("Pricing Method");
|
||||
headerRow.GetCell(5).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(6).SetCellValue("Buyer");
|
||||
headerRow.GetCell(6).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(7).SetCellValue("承包商报价");
|
||||
headerRow.GetCell(7).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(8).SetCellValue("CTE/D审价");
|
||||
headerRow.GetCell(8).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(9).SetCellValue("高核减率扣款");
|
||||
headerRow.GetCell(9).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(10).SetCellValue("延迟扣款");
|
||||
headerRow.GetCell(10).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(11).SetCellValue("付款金额");
|
||||
headerRow.GetCell(11).CellStyle = titleStyle;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 数据
|
||||
|
||||
int rowIndex = 1;
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
var ccpAllLs = dt.AsEnumerable().Select(s => s.Field<int>("ID")).ToList();
|
||||
//获取当前和之前所有的ccpses的信息
|
||||
var ccpAllSesLs = Funs.DB.CCP_SESList.Where(p => ccpAllLs.ConvertAll(s => s).Contains(p.CCP_Id));
|
||||
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
int itemId = !string.IsNullOrEmpty(dt.Rows[i]["ID"].ToString()) ? int.Parse(dt.Rows[i]["ID"].ToString()) : 0;
|
||||
if (itemId == 0) continue;
|
||||
//获取CcpSes信息
|
||||
var ccpSess = ccpAllSesLs.Where(p => p.CCP_Id == itemId).ToList();
|
||||
|
||||
//创建行
|
||||
XSSFRow row = (XSSFRow)sheet.CreateRow(rowIndex);
|
||||
|
||||
row.CreateCell(0).SetCellValue(dt.Rows[i]["CCP_No"] != null ? dt.Rows[i]["CCP_No"].ToString() : string.Empty);
|
||||
row.GetCell(0).CellStyle = style;
|
||||
|
||||
row.CreateCell(1).SetCellValue(dt.Rows[i]["Contract_No"] != null ? dt.Rows[i]["Contract_No"].ToString() : string.Empty);
|
||||
row.GetCell(1).CellStyle = style;
|
||||
|
||||
row.CreateCell(2).SetCellValue(dt.Rows[i]["Contractor_Name"] != null ? dt.Rows[i]["Contractor_Name"].ToString() : string.Empty);
|
||||
row.GetCell(2).CellStyle = style;
|
||||
|
||||
row.CreateCell(3).SetCellValue(dt.Rows[i]["Contract_Title"] != null ? dt.Rows[i]["Contract_Title"].ToString() : string.Empty);
|
||||
row.GetCell(3).CellStyle = style;
|
||||
|
||||
row.CreateCell(4).SetCellValue(dt.Rows[i]["Created_Time"] != null ? dt.Rows[i]["Created_Time"].ToString() : string.Empty);
|
||||
row.GetCell(4).CellStyle = style;
|
||||
|
||||
row.CreateCell(5).SetCellValue(dt.Rows[i]["Pricing_Method"] != null ? dt.Rows[i]["Pricing_Method"].ToString() : string.Empty);
|
||||
row.GetCell(5).CellStyle = style;
|
||||
|
||||
row.CreateCell(6).SetCellValue(dt.Rows[i]["Created_UserName"] != null ? dt.Rows[i]["Created_UserName"].ToString() : string.Empty);
|
||||
row.GetCell(6).CellStyle = style;
|
||||
|
||||
//承包商报价
|
||||
row.CreateCell(7).SetCellValue((double)ccpSess.Sum(p => p.Contractor_Quotation));
|
||||
row.GetCell(7).CellStyle = ccpSess.Sum(p => p.Contractor_Quotation) >= 0 ? qstyle : qstyle1;
|
||||
//CTE/D审价
|
||||
row.CreateCell(8).SetCellValue((double)ccpSess.Sum(p => p.Incl_Tax));
|
||||
row.GetCell(8).CellStyle = ccpSess.Sum(p => p.Incl_Tax) >= 0 ? qstyle : qstyle1;
|
||||
//高核减率扣款
|
||||
row.CreateCell(9).SetCellValue((double)ccpSess.Sum(p => p.Deduction_DeductionRate));
|
||||
row.GetCell(9).CellStyle = ccpSess.Sum(p => p.Deduction_DeductionRate) >= 0 ? qstyle : qstyle1;
|
||||
//延迟扣款
|
||||
row.CreateCell(10).SetCellValue((double)ccpSess.Sum(p => p.DelayedDeduction));
|
||||
row.GetCell(10).CellStyle = ccpSess.Sum(p => p.DelayedDeduction) >= 0 ? qstyle : qstyle1;
|
||||
|
||||
row.CreateCell(11).SetCellValue(dt.Rows[i]["PaymentAmount"] != null ? dt.Rows[i]["PaymentAmount"].ToString() : string.Empty);
|
||||
row.GetCell(11).CellStyle = rstyle;
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
book.Write(ms);
|
||||
byte[] strmByte = ms.ToArray();
|
||||
ms.Dispose();
|
||||
|
||||
Response.Clear();
|
||||
Response.Charset = "GB2312";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
|
||||
Response.AddHeader("Content-Disposition", "attachment; fileName=" + fileName + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx");
|
||||
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
|
||||
Response.AddHeader("Content-Length", strmByte.Length.ToString());
|
||||
// 指定返回的是一个不能被客户端读取的流,必须被下载
|
||||
Response.ContentType = "application/ms-excel";
|
||||
// 把文件流发送到客户端
|
||||
Response.BinaryWrite(strmByte);
|
||||
// 停止页面的执行
|
||||
Response.End();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 权限设置
|
||||
/// <summary>
|
||||
/// 菜单按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.CCPListMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnAdd.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CCP
|
||||
{
|
||||
|
||||
|
||||
public partial class CcpList
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// panelTopRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelTopRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtCCP_No 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCCP_No;
|
||||
|
||||
/// <summary>
|
||||
/// txtContract_No 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtContract_No;
|
||||
|
||||
/// <summary>
|
||||
/// txtSES_No 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSES_No;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAdd 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAdd;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnExportCcp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnExportCcp;
|
||||
|
||||
/// <summary>
|
||||
/// btnExport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnExport;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// panelBottomRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelBottomRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid2;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CcpViewList.aspx.cs" Inherits="FineUIPro.Web.CCP.CcpViewList" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel2" />
|
||||
<f:Panel ID="Panel2" CssClass="blockpanel" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelTopRegion" RegionPosition="Center"
|
||||
Title="中间面板" ShowBorder="false" ShowHeader="false" Layout="VBox">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="ID,Contract_No,CCP_No" AllowCellEditing="true" DataIDField="ID"
|
||||
AllowSorting="true" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" EnableRowSelectEvent="true" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtCCP_No" runat="server" Label="CCP No." LabelAlign="Right" EmptyText="Search by CCP No." NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:TextBox ID="txtContract_No" runat="server" Label="Contract No" LabelAlign="Right" EmptyText="Search by Contract No." NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:TextBox ID="txtSES_No" runat="server" Label="SES No." LabelAlign="Right" EmptyText="Search by SES No." NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:Button ID="btnSearch" Text="Search" Icon="SystemSearch" runat="server" Size="Medium" CssClass="marginr" OnClick="btnSearch_Click" />
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnExportCcp" BoxConfigAlign="Center" runat="server" Text="导出CCP" ToolTip="ExportCCP Excel" Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnExportCcp_Click" EnablePress="true" Pressed="false">
|
||||
</f:Button>
|
||||
<f:Button ID="btnExport" BoxConfigAlign="Center" runat="server" Text="导出" ToolTip="Export Excel" Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnExport_Click" EnablePress="true" Pressed="false">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" ToolTip="Delete" Text="Delete" Icon="Delete" ConfirmText="Make sure to delete the current data?" OnClick="btnDelete_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="80px" ColumnID="CCP_No" DataField="CCP_No" SortField="CCP_No"
|
||||
FieldType="String" HeaderText="CCP No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Contract_No" DataField="Contract_No" SortField="Contract_No"
|
||||
FieldType="String" HeaderText="Contract No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="Contractor_Name" DataField="Contractor_Name" SortField="Contractor_Name"
|
||||
FieldType="String" HeaderText="Contractor Name" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="Contract_Title" DataField="Contract_Title" SortField="Contract_Title"
|
||||
FieldType="String" HeaderText="Contract Title" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Created_Time" DataField="Created_Time" SortField="Created_Time"
|
||||
FieldType="String" HeaderText="Created Time" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Pricing_Method" DataField="Pricing_Method" SortField="Pricing_Method"
|
||||
FieldType="String" HeaderText="Pricing Method" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Created_UserName" DataField="Created_UserName" SortField="Created_UserName"
|
||||
FieldType="String" HeaderText="Buyer" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="PaymentAmount" DataField="PaymentAmount" SortField="PaymentAmount"
|
||||
FieldType="String" HeaderText="付款金额" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:WindowField ColumnID="myWindowField" TextAlign="Center" Width="160px" WindowID="Window2" HeaderText="Upload Files"
|
||||
Icon="ApplicationGo" ToolTip="Upload Files" DataTextFormatString="{0}" DataIFrameUrlFields="ID,Contract_No,CCP_No"
|
||||
DataIFrameUrlFormatString="CCPUpload.aspx?id={0}&contractNo={1}&ccpno={2}&type=view" DataWindowTitleField="Name"
|
||||
DataWindowTitleFormatString="附件上传 - {0}" />
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="Number of records per page:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="30" Value="30" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelBottomRegion" RegionPosition="Bottom" RegionSplit="true" RegionSplitWidth="20px" EnableCollapse="true" Height="400px"
|
||||
Title="底部面板" ShowBorder="false" ShowHeader="false" Layout="Fit">
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" CssClass="blockpanel" ShowBorder="true" ShowHeader="true" EnableCollapse="false" runat="server"
|
||||
DataKeyNames="Id" AllowSorting="true" SortField="SES" SortDirection="ASC"
|
||||
EnableSummary="true" SummaryPosition="Bottom">
|
||||
<Columns>
|
||||
<f:TemplateField Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="180px" ColumnID="Contract_No" DataField="Contract_No" SortField="Contract_No"
|
||||
FieldType="String" HeaderText="合同号" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="CCP_No" DataField="CCP_No" SortField="CCP_No"
|
||||
FieldType="String" HeaderText="CCP No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Ses_No" DataField="Ses_No" SortField="Ses_No"
|
||||
FieldType="String" HeaderText="Ses No" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="Project_Name" DataField="Project_Name" SortField="Project_Name"
|
||||
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Contractor_Quotation" DataField="Contractor_Quotation" SortField="Contractor_Quotation"
|
||||
FieldType="String" HeaderText="承包商报价" HeaderTextAlign="Center" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Incl_Tax" DataField="Incl_Tax" SortField="Incl_Tax"
|
||||
FieldType="String" HeaderText="CTE/D审价" HeaderTextAlign="Center" TextAlign="Right" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ThirdParty_PriceReview" DataField="ThirdParty_PriceReview" SortField="ThirdParty_PriceReview"
|
||||
FieldType="String" HeaderText="第三方审价" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Reduction" DataField="Reduction" SortField="Reduction"
|
||||
FieldType="Float" HeaderText="核减额" HeaderTextAlign="Center" TextAlign="Right" RendererFunction="renderSalaryFloat">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Reduction_Rate" DataField="Reduction_Rate" SortField="Reduction_Rate"
|
||||
FieldType="String" HeaderText="核减率" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Deduction_DeductionRate" DataField="Deduction_DeductionRate" SortField="Deduction_DeductionRate"
|
||||
FieldType="Float" HeaderText="高核减率扣款" HeaderTextAlign="Center" TextAlign="Right" RendererFunction="renderSalaryFloat">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Con_Days" DataField="Con_Days" SortField="Con_Days"
|
||||
FieldType="Int" HeaderText="SSR结算提交天数" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="DelayedDeduction" DataField="DelayedDeduction" SortField="DelayedDeduction"
|
||||
FieldType="Float" HeaderText="延迟扣款" HeaderTextAlign="Center" RendererFunction="renderSalaryFloat" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Final_SettlementAmount" DataField="Final_SettlementAmount" SortField="Final_SettlementAmount"
|
||||
FieldType="String" HeaderText="最终结算金额(含税)" HeaderTextAlign="Center" TextAlign="Right" >
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="Pop-up window" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" AutoScroll="true" IsModal="false" CloseAction="HidePostBack"
|
||||
Width="1500px" Height="880px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="Pop-up window" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="Window2_Close" AutoScroll="true" IsModal="false" CloseAction="HidePostBack"
|
||||
Width="1000px" Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var grid2ClientID = '<%= Grid2.ClientID %>';
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
|
||||
function renderSalaryFloat(value) {
|
||||
return F.addCommas(value.toFixed(2));
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -0,0 +1,934 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.CCP
|
||||
{
|
||||
public partial class CcpViewList : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
GetButtonPower();//权限设置
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定CCP_List
|
||||
/// </summary>
|
||||
private void BindGrid(int id = 0)
|
||||
{
|
||||
string strSql = @"SELECT ID,CCP_No,CPT_No,Contract_No,Contractor_CN+' '+Contractor_Eng as Contractor_Name,Contract_Title,
|
||||
Created_Time,Pricing_Method,Created_UserName,
|
||||
(select SUM(Final_SettlementAmount) from CCP_SESList as s where s.CCP_Id=a.ID ) as PaymentAmount
|
||||
FROM CCP_List as a where 1=1";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(txtCCP_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.CCP_No=@CCP_No";
|
||||
listStr.Add(new SqlParameter("@CCP_No", txtCCP_No.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtContract_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.Contract_No=@Contract_No";
|
||||
listStr.Add(new SqlParameter("@Contract_No", txtContract_No.Text.Trim()));
|
||||
}
|
||||
if (id > 0)
|
||||
{
|
||||
strSql = strSql + " AND a.Id=@Id";
|
||||
listStr.Add(new SqlParameter("@Id", id));
|
||||
}
|
||||
|
||||
strSql = strSql + " ORDER BY a.CCP_No ASC";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = dt.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, dt);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定CCP_SESList
|
||||
/// </summary>
|
||||
private void BindGrid1(int ccp_Id = 0)
|
||||
{
|
||||
string strSql = @"SELECT ID,CCP_No,CCP_Id,CPT_No,CPT_Id,Ses_No,Ses_Id,Contract_No,Contract_Id,Project_Name,
|
||||
Contractor_Quotation,Incl_Tax,ThirdParty_PriceReview,Con_Days,Reduction,Reduction_Rate,
|
||||
Deduction_DeductionRate,DelayedDeduction,Final_SettlementAmount,Created_Time,Created_UserId,
|
||||
Created_UserName,Created_ChineseName
|
||||
FROM dbo.CCP_SESList
|
||||
where 1=1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql = strSql + " AND CCP_Id=@ccp_Id";
|
||||
listStr.Add(new SqlParameter("@ccp_Id", ccp_Id));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid2.RecordCount = dt.Rows.Count;
|
||||
Grid2.DataSource = dt;
|
||||
Grid2.DataBind();
|
||||
|
||||
JObject summary = new JObject();
|
||||
summary.Add("Contractor_Quotation", dt.AsEnumerable().Sum(s => s.Field<decimal>("Contractor_Quotation")).ToString("#,##0.00"));
|
||||
summary.Add("Incl_Tax", dt.AsEnumerable().Sum(s => s.Field<decimal>("Incl_Tax")).ToString("#,##0.00"));
|
||||
summary.Add("Reduction", dt.AsEnumerable().Sum(s => s.Field<decimal>("Reduction")).ToString("#,##0.00"));
|
||||
summary.Add("Deduction_DeductionRate", dt.AsEnumerable().Sum(s => s.Field<decimal>("Deduction_DeductionRate")).ToString("#,##0.00"));
|
||||
summary.Add("DelayedDeduction", dt.AsEnumerable().Sum(s => s.Field<decimal>("DelayedDeduction")).ToString("#,##0.00"));
|
||||
summary.Add("Final_SettlementAmount", dt.AsEnumerable().Sum(s => s.Field<decimal>("Final_SettlementAmount")).ToString("#,##0.00"));
|
||||
Grid2.SummaryData = summary;
|
||||
|
||||
for (int i = 0; i < Grid2.Rows.Count; i++)
|
||||
{
|
||||
Grid2.Rows[i].Values[9] = string.Format("{0}{1}", Grid2.Rows[i].Values[9], "%");
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭窗口1
|
||||
/// </summary>
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭窗口2
|
||||
/// </summary>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 选择加载
|
||||
/// <summary>
|
||||
/// 选择加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
|
||||
{
|
||||
BindGrid1(Convert.ToInt32(this.Grid1.SelectedRowID));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 搜索
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(txtSES_No.Text.Trim()))
|
||||
{
|
||||
var sesModel = Funs.DB.CCP_SESList.FirstOrDefault(p => p.Ses_No == txtSES_No.Text.Trim());
|
||||
if (sesModel != null)
|
||||
{
|
||||
var ccpModel = Funs.DB.CCP_List.FirstOrDefault(p => p.ID == sesModel.CCP_Id);
|
||||
BindGrid(sesModel.CCP_Id);
|
||||
BindGrid1(sesModel.CCP_Id);
|
||||
Alert.ShowInTop(string.Format("CCP:{0},Contract No:{1},Buyer:{2}", string.Format("{0:d3}", sesModel.CCP_No), sesModel.Contract_No, ccpModel.Buyer), MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("CCP:,Contract No:,Buyer:", MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
|
||||
{
|
||||
var ccpList = from x in Funs.DB.CCP_List where x.ID == Convert.ToInt32(Grid1.SelectedRowID) select x;
|
||||
var sesCcpList = from x in Funs.DB.CCP_SESList where x.CCP_Id == Convert.ToInt32(Grid1.SelectedRowID) select x;
|
||||
|
||||
Funs.DB.CCP_SESList.DeleteAllOnSubmit(sesCcpList);
|
||||
Funs.DB.CCP_List.DeleteAllOnSubmit(ccpList);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Delete CCP");
|
||||
// 重新绑定表格
|
||||
BindGrid();
|
||||
BindGrid1(0);
|
||||
ShowNotify("Delete successfully!", MessageBoxIcon.Success);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
protected void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
int row = Grid1.SelectedRowIndex;
|
||||
int Id = int.Parse(Grid1.DataKeys[row][0].ToString());
|
||||
string ContractNo = Grid1.DataKeys[row][1].ToString();
|
||||
int ccpNo = int.Parse(Grid1.DataKeys[row][2].ToString());
|
||||
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
|
||||
//模板文件
|
||||
string TempletFileName = rootPath + "CCPReport.xlsx";
|
||||
//导出文件
|
||||
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
|
||||
if (!Directory.Exists(filePath))
|
||||
{
|
||||
Directory.CreateDirectory(filePath);
|
||||
}
|
||||
string ReportFileName = filePath + "out.xls";
|
||||
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
|
||||
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
|
||||
XSSFSheet ws = (XSSFSheet)hssfworkbook.GetSheetAt(0);
|
||||
var ccp = Funs.DB.CCP_List.FirstOrDefault(x => x.ID == Id);
|
||||
//获取当前和此CCP之前的信息
|
||||
var ccpAllLs = Funs.DB.CCP_List.Where(p => p.CCP_No <= ccpNo && p.Contract_Id == ccp.Contract_Id).ToList();
|
||||
//获取CCP信息
|
||||
var ccpModel = ccpAllLs.FirstOrDefault(p => p.ID == Id);
|
||||
if (ccpModel != null)
|
||||
{
|
||||
//获取当前和之前所有的ccpses的信息
|
||||
var ccpAllSesLs = Funs.DB.CCP_SESList.Where(p => ccpAllLs.ConvertAll(s => s.ID).Contains(p.CCP_Id));
|
||||
//获取CcpSes信息
|
||||
var ccpSess = ccpAllSesLs.Where(p => p.CCP_Id == Id).OrderBy(p => p.CPT_No).ToList();
|
||||
|
||||
if (ccpSess.Count > 0)
|
||||
{
|
||||
#region 左边
|
||||
//承包商名称
|
||||
if (ws.GetRow(3).GetCell(1) == null) ws.GetRow(3).CreateCell(1);
|
||||
ws.GetRow(3).GetCell(1).SetCellValue(ccpModel.Contractor_CN + "\n" + ccpModel.Contractor_Eng);
|
||||
//合同名称
|
||||
if (ws.GetRow(4).GetCell(1) == null) ws.GetRow(4).CreateCell(1);
|
||||
ws.GetRow(4).GetCell(1).SetCellValue(ccpModel.Contract_Title);
|
||||
//合同类型
|
||||
if (ws.GetRow(5).GetCell(1) == null) ws.GetRow(5).CreateCell(1);
|
||||
ws.GetRow(5).GetCell(1).SetCellValue(ccpModel.Contract_Type);
|
||||
//合同计价方式
|
||||
if (ws.GetRow(6).GetCell(1) == null) ws.GetRow(6).CreateCell(1);
|
||||
ws.GetRow(6).GetCell(1).SetCellValue(ccpModel.Pricing_Method);
|
||||
//合同付款条件
|
||||
if (ws.GetRow(7).GetCell(1) == null) ws.GetRow(7).CreateCell(1);
|
||||
var payType = ccpModel.Payment_Term == "0" ? "按月" : "按季";
|
||||
//var payZnum = ccpModel.Payment_Term == "0" ? "三十" : "九十";
|
||||
//var paynum = ccpModel.Payment_Term == "0" ? "30" : "90";
|
||||
//var paymentTermExplain = string.Format("合同价款{0}支付,业主将在收到正确的发票原件以后{1}({2})日内支付。", payType, payZnum, paynum);
|
||||
var paymentTermExplain = string.Format("合同价款{0}支付,业主将在收到正确的发票原件以后三十(30)日内支付。", payType);
|
||||
ws.GetRow(7).GetCell(1).SetCellValue(paymentTermExplain);
|
||||
//本次付款确认单的序列号
|
||||
if (ws.GetRow(9).GetCell(2) == null) ws.GetRow(9).CreateCell(2);
|
||||
ws.GetRow(9).GetCell(2).SetCellValue(string.Format("{0:d3}", ccpModel.CCP_No));
|
||||
//已付总金额
|
||||
var yfzje = 0d;
|
||||
if (ccpAllSesLs.Count(p => p.CCP_Id != Id) > 0)
|
||||
{
|
||||
yfzje = (double)ccpAllSesLs.Where(p => p.CCP_Id != Id).Sum(p => p.Final_SettlementAmount).Value;
|
||||
}
|
||||
if (ws.GetRow(11).GetCell(2) == null) ws.GetRow(11).CreateCell(2);
|
||||
ws.GetRow(11).GetCell(2).SetCellValue(yfzje);
|
||||
//本次付款金额
|
||||
if (ws.GetRow(12).GetCell(2) == null) ws.GetRow(12).CreateCell(2);
|
||||
ws.GetRow(12).GetCell(2).SetCellValue(ccpSess.Count > 0 ? (double)ccpSess.Sum(p => p.Final_SettlementAmount).Value : 0);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 右边
|
||||
|
||||
//承包商代码
|
||||
if (ws.GetRow(3).GetCell(7) == null) ws.GetRow(3).CreateCell(7);
|
||||
ws.GetRow(3).GetCell(7).SetCellValue(ccpModel.Vendor_Code);
|
||||
//合同号
|
||||
if (ws.GetRow(4).GetCell(7) == null) ws.GetRow(4).CreateCell(7);
|
||||
ws.GetRow(4).GetCell(7).SetCellValue(ccpModel.Contract_No);
|
||||
//责任采购员
|
||||
if (ws.GetRow(5).GetCell(7) == null) ws.GetRow(5).CreateCell(7);
|
||||
ws.GetRow(5).GetCell(7).SetCellValue(ccpModel.Buyer);
|
||||
//合同预算值
|
||||
if (ws.GetRow(6).GetCell(7) == null) ws.GetRow(6).CreateCell(7);
|
||||
ws.GetRow(6).GetCell(7).SetCellValue((double)ccpModel.Contract_Budget);
|
||||
//次付款对应的CPT号
|
||||
var cpts = ccpModel.CPT_No.Split(',').Select(p => string.Format("{0:d3}", int.Parse(p.Split('-').LastOrDefault()))).ToList();
|
||||
if (ws.GetRow(9).GetCell(7) == null) ws.GetRow(9).CreateCell(7);
|
||||
ws.GetRow(9).GetCell(7).SetCellValue(string.Join(",", cpts.ToArray()));
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格
|
||||
|
||||
XSSFSheet wstwo = (XSSFSheet)hssfworkbook.GetSheet("sheet2");
|
||||
|
||||
#region 样式
|
||||
|
||||
//全局边框靠左
|
||||
XSSFFont font = (XSSFFont)hssfworkbook.CreateFont();
|
||||
font.FontHeightInPoints = 10;
|
||||
font.FontName = "Arial";
|
||||
ICellStyle style = hssfworkbook.CreateCellStyle();
|
||||
style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.VerticalAlignment = VerticalAlignment.Center;
|
||||
style.Alignment = HorizontalAlignment.Left;
|
||||
style.WrapText = true;
|
||||
style.SetFont(font);
|
||||
//全局边框靠左红色字体
|
||||
XSSFFont font1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
font1.FontHeightInPoints = 10;
|
||||
font1.FontName = "Arial";
|
||||
font1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle style1 = hssfworkbook.CreateCellStyle();
|
||||
style1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style1.VerticalAlignment = VerticalAlignment.Center;
|
||||
style1.Alignment = HorizontalAlignment.Left;
|
||||
style1.WrapText = true;
|
||||
style1.SetFont(font1);
|
||||
|
||||
//全局边框靠右
|
||||
XSSFFont rfont = (XSSFFont)hssfworkbook.CreateFont();
|
||||
rfont.FontHeightInPoints = 10;
|
||||
rfont.FontName = "Arial";
|
||||
ICellStyle rstyle = hssfworkbook.CreateCellStyle();
|
||||
rstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
rstyle.Alignment = HorizontalAlignment.Right;
|
||||
rstyle.WrapText = true;
|
||||
rstyle.SetFont(font);
|
||||
//全局边框靠右红色字体
|
||||
XSSFFont rfont1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
rfont1.FontHeightInPoints = 10;
|
||||
rfont1.FontName = "Arial";
|
||||
rfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle rstyle1 = hssfworkbook.CreateCellStyle();
|
||||
rstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
rstyle1.Alignment = HorizontalAlignment.Right;
|
||||
rstyle1.WrapText = true;
|
||||
rstyle1.SetFont(font1);
|
||||
|
||||
|
||||
IDataFormat dataformat = hssfworkbook.CreateDataFormat();
|
||||
//千分位全局边框靠右
|
||||
XSSFFont qfont = (XSSFFont)hssfworkbook.CreateFont();
|
||||
qfont.FontHeightInPoints = 10;
|
||||
qfont.FontName = "Arial";
|
||||
ICellStyle qstyle = hssfworkbook.CreateCellStyle();
|
||||
qstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle.Alignment = HorizontalAlignment.Right;
|
||||
qstyle.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle.SetFont(qfont);
|
||||
//千分位全局边框靠右红色字体
|
||||
XSSFFont qfont1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
qfont1.FontHeightInPoints = 10;
|
||||
qfont1.FontName = "Arial";
|
||||
qfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle qstyle1 = hssfworkbook.CreateCellStyle();
|
||||
qstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle1.Alignment = HorizontalAlignment.Right;
|
||||
qstyle1.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle1.SetFont(qfont1);
|
||||
|
||||
//百分比全局边框靠右
|
||||
XSSFFont bfont = (XSSFFont)hssfworkbook.CreateFont();
|
||||
bfont.FontHeightInPoints = 10;
|
||||
bfont.FontName = "Arial";
|
||||
ICellStyle bstyle = hssfworkbook.CreateCellStyle();
|
||||
bstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
bstyle.Alignment = HorizontalAlignment.Right;
|
||||
bstyle.DataFormat = dataformat.GetFormat("0.00%");
|
||||
bstyle.SetFont(bfont);
|
||||
//百分比全局边框靠右红色字体
|
||||
XSSFFont bfont1 = (XSSFFont)hssfworkbook.CreateFont();
|
||||
bfont1.FontHeightInPoints = 10;
|
||||
bfont1.FontName = "Arial";
|
||||
bfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle bstyle1 = hssfworkbook.CreateCellStyle();
|
||||
bstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
bstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
bstyle1.Alignment = HorizontalAlignment.Right;
|
||||
bstyle1.DataFormat = dataformat.GetFormat("0.00%");
|
||||
bstyle1.SetFont(bfont1);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格数据
|
||||
|
||||
int rowindex = 5;
|
||||
foreach (var item in ccpSess)
|
||||
{
|
||||
//合同号
|
||||
if (wstwo.GetRow(rowindex).GetCell(0) == null) wstwo.GetRow(rowindex).CreateCell(0);
|
||||
wstwo.GetRow(rowindex).GetCell(0).SetCellValue(item.Contract_No);
|
||||
wstwo.GetRow(rowindex).GetCell(0).CellStyle = style;
|
||||
//CCP No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(1) == null) wstwo.GetRow(rowindex).CreateCell(1);
|
||||
wstwo.GetRow(rowindex).GetCell(1).SetCellValue(string.Format("{0:d3}", item.CCP_No));
|
||||
wstwo.GetRow(rowindex).GetCell(1).CellStyle = style;
|
||||
//CPT No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(2) == null) wstwo.GetRow(rowindex).CreateCell(2);
|
||||
wstwo.GetRow(rowindex).GetCell(2).SetCellValue(item.CPT_No.Split('-').LastOrDefault());
|
||||
wstwo.GetRow(rowindex).GetCell(2).CellStyle = style;
|
||||
//SES No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(3) == null) wstwo.GetRow(rowindex).CreateCell(3);
|
||||
wstwo.GetRow(rowindex).GetCell(3).SetCellValue(item.Ses_No);
|
||||
wstwo.GetRow(rowindex).GetCell(3).CellStyle = style;
|
||||
//项目名称
|
||||
if (wstwo.GetRow(rowindex).GetCell(4) == null) wstwo.GetRow(rowindex).CreateCell(4);
|
||||
wstwo.GetRow(rowindex).GetCell(4).SetCellValue(item.Project_Name);
|
||||
wstwo.GetRow(rowindex).GetCell(4).CellStyle = style;
|
||||
//承包商报价
|
||||
if (wstwo.GetRow(rowindex).GetCell(5) == null) wstwo.GetRow(rowindex).CreateCell(5);
|
||||
wstwo.GetRow(rowindex).GetCell(5).SetCellValue((double)item.Contractor_Quotation);
|
||||
wstwo.GetRow(rowindex).GetCell(5).CellStyle = item.Contractor_Quotation.Value >= 0 ? qstyle : qstyle1;
|
||||
//CTE/D审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(6) == null) wstwo.GetRow(rowindex).CreateCell(6);
|
||||
wstwo.GetRow(rowindex).GetCell(6).SetCellValue((double)item.Incl_Tax);
|
||||
wstwo.GetRow(rowindex).GetCell(6).CellStyle = item.Incl_Tax.Value >= 0 ? qstyle : qstyle1;
|
||||
//第三方审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(7) == null) wstwo.GetRow(rowindex).CreateCell(7);
|
||||
wstwo.GetRow(rowindex).GetCell(7).SetCellValue((double)item.ThirdParty_PriceReview);
|
||||
wstwo.GetRow(rowindex).GetCell(7).CellStyle = item.ThirdParty_PriceReview.Value >= 0 ? qstyle : qstyle1;
|
||||
//核减额
|
||||
if (wstwo.GetRow(rowindex).GetCell(8) == null) wstwo.GetRow(rowindex).CreateCell(8);
|
||||
wstwo.GetRow(rowindex).GetCell(8).SetCellValue((double)item.Reduction);
|
||||
wstwo.GetRow(rowindex).GetCell(8).CellStyle = item.Reduction.Value >= 0 ? qstyle : qstyle1;
|
||||
//核减率
|
||||
if (wstwo.GetRow(rowindex).GetCell(9) == null) wstwo.GetRow(rowindex).CreateCell(9);
|
||||
wstwo.GetRow(rowindex).GetCell(9).SetCellValue((double)item.Reduction_Rate / 100);
|
||||
wstwo.GetRow(rowindex).GetCell(9).CellStyle = item.Reduction_Rate.Value >= 0 ? bstyle : bstyle1;
|
||||
//高核减率扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(10) == null) wstwo.GetRow(rowindex).CreateCell(10);
|
||||
wstwo.GetRow(rowindex).GetCell(10).SetCellValue((double)item.Deduction_DeductionRate);
|
||||
wstwo.GetRow(rowindex).GetCell(10).CellStyle = item.Deduction_DeductionRate.Value >= 0 ? qstyle : qstyle1;
|
||||
//SSR结算提交天数
|
||||
if (wstwo.GetRow(rowindex).GetCell(11) == null) wstwo.GetRow(rowindex).CreateCell(11);
|
||||
wstwo.GetRow(rowindex).GetCell(11).SetCellValue(item.Con_Days != null ? item.Con_Days.Value : 0);
|
||||
wstwo.GetRow(rowindex).GetCell(11).CellStyle = item.Con_Days != null && item.Con_Days.Value > 0 ? rstyle : rstyle1;
|
||||
//延迟扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(12) == null) wstwo.GetRow(rowindex).CreateCell(12);
|
||||
wstwo.GetRow(rowindex).GetCell(12).SetCellValue((double)item.DelayedDeduction);
|
||||
wstwo.GetRow(rowindex).GetCell(12).CellStyle = item.DelayedDeduction.Value >= 0 ? qstyle : qstyle1;
|
||||
//最终结算金额(含税)
|
||||
if (wstwo.GetRow(rowindex).GetCell(13) == null) wstwo.GetRow(rowindex).CreateCell(13);
|
||||
wstwo.GetRow(rowindex).GetCell(13).SetCellValue((double)item.Final_SettlementAmount);
|
||||
wstwo.GetRow(rowindex).GetCell(13).CellStyle = item.Final_SettlementAmount >= 0 ? qstyle : qstyle1;
|
||||
|
||||
rowindex++;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 合计
|
||||
//合同号
|
||||
if (wstwo.GetRow(rowindex).GetCell(0) == null) wstwo.GetRow(rowindex).CreateCell(0);
|
||||
wstwo.GetRow(rowindex).GetCell(0).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(0).CellStyle = style;
|
||||
//CCP No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(1) == null) wstwo.GetRow(rowindex).CreateCell(1);
|
||||
wstwo.GetRow(rowindex).GetCell(1).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(1).CellStyle = style;
|
||||
//CPT No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(2) == null) wstwo.GetRow(rowindex).CreateCell(2);
|
||||
wstwo.GetRow(rowindex).GetCell(2).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(2).CellStyle = style;
|
||||
//SES No.
|
||||
if (wstwo.GetRow(rowindex).GetCell(3) == null) wstwo.GetRow(rowindex).CreateCell(3);
|
||||
wstwo.GetRow(rowindex).GetCell(3).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(3).CellStyle = style;
|
||||
//项目名称
|
||||
if (wstwo.GetRow(rowindex).GetCell(4) == null) wstwo.GetRow(rowindex).CreateCell(4);
|
||||
wstwo.GetRow(rowindex).GetCell(4).SetCellValue("总计");
|
||||
wstwo.GetRow(rowindex).GetCell(4).CellStyle = style;
|
||||
//承包商报价
|
||||
if (wstwo.GetRow(rowindex).GetCell(5) == null) wstwo.GetRow(rowindex).CreateCell(5);
|
||||
wstwo.GetRow(rowindex).GetCell(5).SetCellValue((double)ccpSess.Sum(p => p.Contractor_Quotation));
|
||||
wstwo.GetRow(rowindex).GetCell(5).CellStyle = ccpSess.Sum(p => p.Contractor_Quotation) >= 0 ? qstyle : qstyle1;
|
||||
//CTE/D审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(6) == null) wstwo.GetRow(rowindex).CreateCell(6);
|
||||
wstwo.GetRow(rowindex).GetCell(6).SetCellValue((double)ccpSess.Sum(p => p.Incl_Tax));
|
||||
wstwo.GetRow(rowindex).GetCell(6).CellStyle = ccpSess.Sum(p => p.Incl_Tax) >= 0 ? qstyle : qstyle1;
|
||||
//第三方审价
|
||||
if (wstwo.GetRow(rowindex).GetCell(7) == null) wstwo.GetRow(rowindex).CreateCell(7);
|
||||
wstwo.GetRow(rowindex).GetCell(7).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(7).CellStyle = style;
|
||||
//核减额
|
||||
if (wstwo.GetRow(rowindex).GetCell(8) == null) wstwo.GetRow(rowindex).CreateCell(8);
|
||||
wstwo.GetRow(rowindex).GetCell(8).SetCellValue((double)ccpSess.Sum(p => p.Reduction));
|
||||
wstwo.GetRow(rowindex).GetCell(8).CellStyle = ccpSess.Sum(p => p.Reduction) >= 0 ? qstyle : qstyle1;
|
||||
//核减率
|
||||
if (wstwo.GetRow(rowindex).GetCell(9) == null) wstwo.GetRow(rowindex).CreateCell(9);
|
||||
wstwo.GetRow(rowindex).GetCell(9).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(9).CellStyle = style;
|
||||
//高核减率扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(10) == null) wstwo.GetRow(rowindex).CreateCell(10);
|
||||
wstwo.GetRow(rowindex).GetCell(10).SetCellValue((double)ccpSess.Sum(p => p.Deduction_DeductionRate));
|
||||
wstwo.GetRow(rowindex).GetCell(10).CellStyle = ccpSess.Sum(p => p.Deduction_DeductionRate) >= 0 ? qstyle : qstyle1;
|
||||
//SSR结算提交天数
|
||||
if (wstwo.GetRow(rowindex).GetCell(11) == null) wstwo.GetRow(rowindex).CreateCell(11);
|
||||
wstwo.GetRow(rowindex).GetCell(11).SetCellValue("");
|
||||
wstwo.GetRow(rowindex).GetCell(11).CellStyle = style;
|
||||
//延迟扣款
|
||||
if (wstwo.GetRow(rowindex).GetCell(12) == null) wstwo.GetRow(rowindex).CreateCell(12);
|
||||
wstwo.GetRow(rowindex).GetCell(12).SetCellValue((double)ccpSess.Sum(p => p.DelayedDeduction));
|
||||
wstwo.GetRow(rowindex).GetCell(12).CellStyle = ccpSess.Sum(p => p.DelayedDeduction) >= 0 ? qstyle : qstyle1;
|
||||
//最终结算金额(含税)
|
||||
if (wstwo.GetRow(rowindex).GetCell(13) == null) wstwo.GetRow(rowindex).CreateCell(13);
|
||||
wstwo.GetRow(rowindex).GetCell(13).SetCellValue((double)ccpSess.Sum(p => p.Final_SettlementAmount));
|
||||
wstwo.GetRow(rowindex).GetCell(13).CellStyle = ccpSess.Sum(p => p.Final_SettlementAmount) >= 0 ? qstyle : qstyle1;
|
||||
|
||||
#endregion
|
||||
|
||||
#region TT30和BD90
|
||||
|
||||
int ttrate = 0;
|
||||
double ttMount = 0;
|
||||
int dbrate = 0;
|
||||
double dbMount = 0;
|
||||
var ttDbhsl = (ccpSess.Sum(p => p.Contractor_Quotation) - ccpSess.Sum(p => p.Final_SettlementAmount)) / ccpSess.Sum(p => p.Contractor_Quotation) * 100;
|
||||
if (ttDbhsl < 10)
|
||||
{
|
||||
ttrate = 100;
|
||||
ttMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount);
|
||||
}
|
||||
else if (ttDbhsl >= 10 && ttDbhsl < 20)
|
||||
{
|
||||
ttrate = 70;
|
||||
ttMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount) * 0.7;
|
||||
dbrate = 30;
|
||||
dbMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount) - ttMount;
|
||||
}
|
||||
else
|
||||
{
|
||||
ttrate = 50;
|
||||
ttMount = (double)ccpSess.Sum(p => p.Final_SettlementAmount) / 2;
|
||||
dbrate = 50;
|
||||
dbMount = ttMount;
|
||||
}
|
||||
//TT30比例
|
||||
if (wstwo.GetRow(1).GetCell(12) == null) wstwo.GetRow(1).CreateCell(12);
|
||||
wstwo.GetRow(1).GetCell(12).SetCellValue(ttrate);
|
||||
wstwo.GetRow(1).GetCell(12).CellStyle = style;
|
||||
//TT30金额
|
||||
if (wstwo.GetRow(1).GetCell(13) == null) wstwo.GetRow(1).CreateCell(13);
|
||||
wstwo.GetRow(1).GetCell(13).SetCellValue(ttMount);
|
||||
wstwo.GetRow(1).GetCell(13).CellStyle = ttMount >= 0 ? qstyle : qstyle1;
|
||||
|
||||
//BD90比例
|
||||
if (wstwo.GetRow(2).GetCell(12) == null) wstwo.GetRow(2).CreateCell(12);
|
||||
wstwo.GetRow(2).GetCell(12).SetCellValue(dbrate);
|
||||
wstwo.GetRow(2).GetCell(12).CellStyle = style;
|
||||
//BD90金额
|
||||
if (wstwo.GetRow(2).GetCell(13) == null) wstwo.GetRow(2).CreateCell(13);
|
||||
wstwo.GetRow(2).GetCell(13).SetCellValue(dbMount);
|
||||
wstwo.GetRow(2).GetCell(13).CellStyle = dbMount >= 0 ? qstyle : qstyle1;
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
ws.ForceFormulaRecalculation = true;
|
||||
wstwo.ForceFormulaRecalculation = true;
|
||||
using (FileStream filess = File.OpenWrite(ReportFileName))
|
||||
{
|
||||
hssfworkbook.Write(filess);
|
||||
}
|
||||
FileInfo filet = new FileInfo(ReportFileName);
|
||||
Response.Clear();
|
||||
Response.Charset = "GB2312";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(string.Format("{0}-CCP-{1}", ccpModel.Contract_No, string.Format("{0:d3}", ccpModel.CCP_No))) + ".xlsx");
|
||||
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
|
||||
Response.AddHeader("Content-Length", filet.Length.ToString());
|
||||
// 指定返回的是一个不能被客户端读取的流,必须被下载
|
||||
Response.ContentType = "application/ms-excel";
|
||||
// 把文件流发送到客户端
|
||||
Response.WriteFile(filet.FullName);
|
||||
// 停止页面的执行
|
||||
Response.End();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("当前CCP没有SES明细信息,无法导出!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出ccp列表
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnExportCcp_Click(object sender, EventArgs e)
|
||||
{
|
||||
var fileName = string.Format("{0}_{1}", "CCP", DateTime.Now.ToString("yyyy-MM-dd"));
|
||||
|
||||
XSSFWorkbook book = new XSSFWorkbook();
|
||||
System.IO.MemoryStream ms = new System.IO.MemoryStream();
|
||||
string strSql = @"SELECT ID,CCP_No,CPT_No,Contract_No,Contractor_CN+' '+Contractor_Eng as Contractor_Name,Contract_Title,Created_Time,Pricing_Method,Created_UserName,(select SUM(Final_SettlementAmount) from CCP_SESList as s where s.CCP_Id=a.ID ) as PaymentAmount FROM CCP_List as a where 1=1";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(txtCCP_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.CCP_No=@CCP_No";
|
||||
listStr.Add(new SqlParameter("@CCP_No", txtCCP_No.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtContract_No.Text))
|
||||
{
|
||||
strSql = strSql + " AND a.Contract_No=@Contract_No";
|
||||
listStr.Add(new SqlParameter("@Contract_No", txtContract_No.Text.Trim()));
|
||||
}
|
||||
|
||||
strSql = strSql + " ORDER BY a.CCP_No ASC";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
if (dt.Rows.Count == 0)
|
||||
{
|
||||
Alert.ShowInParent("当前CCP没有无数据,无法导出!");
|
||||
return;
|
||||
}
|
||||
|
||||
//sheet名称
|
||||
XSSFSheet sheet = (XSSFSheet)book.CreateSheet(fileName);
|
||||
|
||||
#region 样式
|
||||
|
||||
//列头居中样式
|
||||
XSSFFont tfont = (XSSFFont)book.CreateFont();
|
||||
tfont.FontHeightInPoints = 10;
|
||||
tfont.FontName = "Arial";
|
||||
tfont.IsBold = true;
|
||||
ICellStyle titleStyle = book.CreateCellStyle();
|
||||
titleStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
titleStyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
titleStyle.Alignment = HorizontalAlignment.Center;
|
||||
titleStyle.WrapText = true;
|
||||
titleStyle.SetFont(tfont);
|
||||
|
||||
//全局边框靠左
|
||||
XSSFFont font = (XSSFFont)book.CreateFont();
|
||||
font.FontHeightInPoints = 10;
|
||||
font.FontName = "Arial";
|
||||
ICellStyle style = book.CreateCellStyle();
|
||||
style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
style.VerticalAlignment = VerticalAlignment.Center;
|
||||
style.Alignment = HorizontalAlignment.Left;
|
||||
style.WrapText = true;
|
||||
style.SetFont(font);
|
||||
|
||||
//全局边框靠右
|
||||
XSSFFont rfont = (XSSFFont)book.CreateFont();
|
||||
rfont.FontHeightInPoints = 10;
|
||||
rfont.FontName = "Arial";
|
||||
ICellStyle rstyle = book.CreateCellStyle();
|
||||
rstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
rstyle.Alignment = HorizontalAlignment.Right;
|
||||
rstyle.WrapText = true;
|
||||
rstyle.SetFont(font);
|
||||
|
||||
IDataFormat dataformat = book.CreateDataFormat();
|
||||
//千分位全局边框靠右
|
||||
XSSFFont qfont = (XSSFFont)book.CreateFont();
|
||||
qfont.FontHeightInPoints = 10;
|
||||
qfont.FontName = "Arial";
|
||||
ICellStyle qstyle = book.CreateCellStyle();
|
||||
qstyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle.Alignment = HorizontalAlignment.Right;
|
||||
qstyle.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle.SetFont(qfont);
|
||||
//千分位全局边框靠右红色字体
|
||||
XSSFFont qfont1 = (XSSFFont)book.CreateFont();
|
||||
qfont1.FontHeightInPoints = 10;
|
||||
qfont1.FontName = "Arial";
|
||||
qfont1.Color = IndexedColors.Red.Index;
|
||||
ICellStyle qstyle1 = book.CreateCellStyle();
|
||||
qstyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
qstyle1.VerticalAlignment = VerticalAlignment.Center;
|
||||
qstyle1.Alignment = HorizontalAlignment.Right;
|
||||
qstyle1.DataFormat = dataformat.GetFormat("#,##0.00");
|
||||
qstyle1.SetFont(qfont1);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 设置列宽度
|
||||
|
||||
sheet.SetColumnWidth(0, 10 * 256);
|
||||
sheet.SetColumnWidth(1, 20 * 256);
|
||||
sheet.SetColumnWidth(2, 70 * 256);
|
||||
sheet.SetColumnWidth(3, 30 * 256);
|
||||
sheet.SetColumnWidth(4, 20 * 256);
|
||||
sheet.SetColumnWidth(5, 30 * 256);
|
||||
sheet.SetColumnWidth(6, 20 * 256);
|
||||
sheet.SetColumnWidth(7, 20 * 256);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 列头
|
||||
|
||||
XSSFRow headerRow = (XSSFRow)sheet.CreateRow(0);
|
||||
headerRow.CreateCell(0).SetCellValue("CCP No");
|
||||
headerRow.GetCell(0).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(1).SetCellValue("Contract No");
|
||||
headerRow.GetCell(1).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(2).SetCellValue("Contractor Name");
|
||||
headerRow.GetCell(2).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(3).SetCellValue("Contract Title");
|
||||
headerRow.GetCell(3).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(4).SetCellValue("Created Time");
|
||||
headerRow.GetCell(4).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(5).SetCellValue("Pricing Method");
|
||||
headerRow.GetCell(5).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(6).SetCellValue("Buyer");
|
||||
headerRow.GetCell(6).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(7).SetCellValue("承包商报价");
|
||||
headerRow.GetCell(7).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(8).SetCellValue("CTE/D审价");
|
||||
headerRow.GetCell(8).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(9).SetCellValue("高核减率扣款");
|
||||
headerRow.GetCell(9).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(10).SetCellValue("延迟扣款");
|
||||
headerRow.GetCell(10).CellStyle = titleStyle;
|
||||
|
||||
headerRow.CreateCell(11).SetCellValue("付款金额");
|
||||
headerRow.GetCell(11).CellStyle = titleStyle;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 数据
|
||||
|
||||
int rowIndex = 1;
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
var ccpAllLs = dt.AsEnumerable().Select(s => s.Field<int>("ID")).ToList();
|
||||
//获取当前和之前所有的ccpses的信息
|
||||
var ccpAllSesLs = Funs.DB.CCP_SESList.Where(p => ccpAllLs.ConvertAll(s => s).Contains(p.CCP_Id));
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
int itemId = !string.IsNullOrEmpty(dt.Rows[i]["ID"].ToString()) ? int.Parse(dt.Rows[i]["ID"].ToString()) : 0;
|
||||
if (itemId == 0) continue;
|
||||
//获取CcpSes信息
|
||||
var ccpSess = ccpAllSesLs.Where(p => p.CCP_Id == itemId).ToList();
|
||||
|
||||
//创建行
|
||||
XSSFRow row = (XSSFRow)sheet.CreateRow(rowIndex);
|
||||
|
||||
row.CreateCell(0).SetCellValue(dt.Rows[i]["CCP_No"] != null ? dt.Rows[i]["CCP_No"].ToString() : string.Empty);
|
||||
row.GetCell(0).CellStyle = style;
|
||||
|
||||
row.CreateCell(1).SetCellValue(dt.Rows[i]["Contract_No"] != null ? dt.Rows[i]["Contract_No"].ToString() : string.Empty);
|
||||
row.GetCell(1).CellStyle = style;
|
||||
|
||||
row.CreateCell(2).SetCellValue(dt.Rows[i]["Contractor_Name"] != null ? dt.Rows[i]["Contractor_Name"].ToString() : string.Empty);
|
||||
row.GetCell(2).CellStyle = style;
|
||||
|
||||
row.CreateCell(3).SetCellValue(dt.Rows[i]["Contract_Title"] != null ? dt.Rows[i]["Contract_Title"].ToString() : string.Empty);
|
||||
row.GetCell(3).CellStyle = style;
|
||||
|
||||
row.CreateCell(4).SetCellValue(dt.Rows[i]["Created_Time"] != null ? dt.Rows[i]["Created_Time"].ToString() : string.Empty);
|
||||
row.GetCell(4).CellStyle = style;
|
||||
|
||||
row.CreateCell(5).SetCellValue(dt.Rows[i]["Pricing_Method"] != null ? dt.Rows[i]["Pricing_Method"].ToString() : string.Empty);
|
||||
row.GetCell(5).CellStyle = style;
|
||||
|
||||
row.CreateCell(6).SetCellValue(dt.Rows[i]["Created_UserName"] != null ? dt.Rows[i]["Created_UserName"].ToString() : string.Empty);
|
||||
row.GetCell(6).CellStyle = style;
|
||||
|
||||
//承包商报价
|
||||
row.CreateCell(7).SetCellValue((double)ccpSess.Sum(p => p.Contractor_Quotation));
|
||||
row.GetCell(7).CellStyle = ccpSess.Sum(p => p.Contractor_Quotation) >= 0 ? qstyle : qstyle1;
|
||||
//CTE/D审价
|
||||
row.CreateCell(8).SetCellValue((double)ccpSess.Sum(p => p.Incl_Tax));
|
||||
row.GetCell(8).CellStyle = ccpSess.Sum(p => p.Incl_Tax) >= 0 ? qstyle : qstyle1;
|
||||
//高核减率扣款
|
||||
row.CreateCell(9).SetCellValue((double)ccpSess.Sum(p => p.Deduction_DeductionRate));
|
||||
row.GetCell(9).CellStyle = ccpSess.Sum(p => p.Deduction_DeductionRate) >= 0 ? qstyle : qstyle1;
|
||||
//延迟扣款
|
||||
row.CreateCell(10).SetCellValue((double)ccpSess.Sum(p => p.DelayedDeduction));
|
||||
row.GetCell(10).CellStyle = ccpSess.Sum(p => p.DelayedDeduction) >= 0 ? qstyle : qstyle1;
|
||||
|
||||
row.CreateCell(11).SetCellValue(dt.Rows[i]["PaymentAmount"] != null ? dt.Rows[i]["PaymentAmount"].ToString() : string.Empty);
|
||||
row.GetCell(11).CellStyle = rstyle;
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
book.Write(ms);
|
||||
byte[] strmByte = ms.ToArray();
|
||||
ms.Dispose();
|
||||
|
||||
Response.Clear();
|
||||
Response.Charset = "GB2312";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
|
||||
Response.AddHeader("Content-Disposition", "attachment; fileName=" + fileName + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx");
|
||||
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
|
||||
Response.AddHeader("Content-Length", strmByte.Length.ToString());
|
||||
// 指定返回的是一个不能被客户端读取的流,必须被下载
|
||||
Response.ContentType = "application/ms-excel";
|
||||
// 把文件流发送到客户端
|
||||
Response.BinaryWrite(strmByte);
|
||||
// 停止页面的执行
|
||||
Response.End();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 权限设置
|
||||
/// <summary>
|
||||
/// 菜单按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.CPTViewListMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnDelete.Hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+224
@@ -0,0 +1,224 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CCP
|
||||
{
|
||||
|
||||
|
||||
public partial class CcpViewList
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// panelTopRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelTopRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtCCP_No 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCCP_No;
|
||||
|
||||
/// <summary>
|
||||
/// txtContract_No 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtContract_No;
|
||||
|
||||
/// <summary>
|
||||
/// txtSES_No 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSES_No;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnExportCcp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnExportCcp;
|
||||
|
||||
/// <summary>
|
||||
/// btnExport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnExport;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// panelBottomRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelBottomRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid2;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user