📄 bill.aspx.cs
字号:
namespace PowerEasy.WebSite.User.Shop
{
using PowerEasy.Accessories;
using PowerEasy.Common;
using PowerEasy.Components;
using PowerEasy.Controls;
using PowerEasy.Web.UI;
using PowerEasy.WebSite.Controls;
using System;
using System.Collections;
using System.Data;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class Bill : DynamicPage
{
protected ExtendedGridView EgvBill;
protected HtmlForm form1;
private decimal m_TotalIncome;
private decimal m_TotalPayout;
protected ObjectDataSource OdsBill;
protected UserNavigation UserCenterNavigation;
protected ExtendedSiteMapPath YourPosition;
private static Table CreateTable(string content1, string content2)
{
Table table = new Table();
table.Width = Unit.Percentage(100.0);
table.Controls.Add(CreateTableRow());
table.Controls.Add(CreateTableRow());
table.Rows[0].Cells[0].Text = content1;
table.Rows[1].Cells[0].Text = content2;
return table;
}
private static TableRow CreateTableRow()
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
cell.Attributes.Add("align", "right");
row.Cells.Add(cell);
return row;
}
protected void EgvBill_OnDataBound(object sender, EventArgs e)
{
if (this.EgvBill.Rows.Count > 0)
{
GridViewRow footerRow = this.EgvBill.FooterRow;
while (footerRow.Cells.Count != 4)
{
footerRow.Cells.RemoveAt(0);
}
footerRow.Cells[0].ColumnSpan = 2;
ArrayList totalInComeAndPayOutAll = BankrollItem.GetTotalInComeAndPayOutAll(PEContext.Current.User.UserName);
double num = DataConverter.CDouble(totalInComeAndPayOutAll[0]);
double num2 = DataConverter.CDouble(totalInComeAndPayOutAll[1]);
footerRow.Cells[0].Controls.Add(CreateTable("本页合计:", "总计金额:"));
footerRow.Cells[1].Controls.Add(CreateTable(this.m_TotalIncome.ToString("N2"), num.ToString("N2")));
footerRow.Cells[2].Controls.Add(CreateTable(Math.Abs(this.m_TotalPayout).ToString("N2"), Math.Abs(num2).ToString("N2")));
double num5 = num + num2;
footerRow.Cells[3].Controls.Add(CreateTable("", "资金余额:" + num5.ToString("N2")));
}
}
protected void EgvBill_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView dataItem = e.Row.DataItem as DataRowView;
decimal num = (decimal) dataItem["Money"];
if (num > 0M)
{
this.m_TotalIncome += num;
}
else
{
this.m_TotalPayout += num;
}
Label label = e.Row.FindControl("LblRecieveMoney") as Label;
Label label2 = e.Row.FindControl("LblPayoutMoney") as Label;
if ((label != null) && (num > 0M))
{
label.Text = num.ToString("0.00");
}
if ((label2 != null) && (num < 0M))
{
label2.Text = Math.Abs(num).ToString("0.00");
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -