📄 salelistsearch.aspx.cs
字号:
namespace PowerEasy.WebSite.Admin.Shop
{
using PowerEasy.Common;
using PowerEasy.Controls;
using PowerEasy.Model.Shop;
using PowerEasy.Shop;
using PowerEasy.Web.UI;
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
public class SaleListSearch : AdminPage
{
protected Button BtnExportExcel;
protected Button BtnSearch;
protected DatePicker DpkBegin;
protected DatePicker DpkEnd;
protected ExtendedSiteMapPath SmpNavigator;
protected TextBox TxtBeginId;
protected TextBox TxtClientName;
protected TextBox TxtEndId;
protected TextBox TxtOrderNum;
protected TextBox TxtProductName;
protected TextBox TxtUserName;
protected CompareValidator ValcBegin;
protected CompareValidator ValcBeginId;
protected CompareValidator ValcEnd;
protected CompareValidator ValcEndId;
protected void BtnExportExcel_Click(object sender, EventArgs e)
{
IList<SaleListInfo> list = SaleList.GetSaleList(0, 0x7fffffff, 11, 0, this.GetKeywords());
StringBuilder builder = new StringBuilder();
base.Response.Clear();
base.Response.AppendHeader("content-disposition", "attachment;filename=SaleList.xls");
base.Response.ContentEncoding = Encoding.GetEncoding("GB2312");
base.Response.ContentType = "application/vnd.xls";
builder.Append("<table border='0' cellspacing='1' style='border-collapse: collapse;table-layout:fixed' id='AutoNumber1' height='32'><tr>");
builder.Append("<td align='center'><b>下单时间</b></td>");
builder.Append("<td align='center'><b>订单编号</b></td>");
builder.Append("<td align='center'><b>客户名称</b></td>");
builder.Append("<td align='center'><b>用户名</b></td>");
builder.Append("<td align='center'><b>商品名称</b></td>");
builder.Append("<td align='center'><b>单位</b></td>");
builder.Append("<td align='center'><b>数量</b></td>");
builder.Append("<td align='center'><b>实价</b></td>");
builder.Append("<td align='center'><b>指定价</b></td>");
builder.Append("<td align='center'><b>金额</b></td>");
builder.Append("<td align='center'><b>积分</b></td></tr>");
foreach (SaleListInfo info in list)
{
builder.Append("<tr>");
builder.Append("<td align='center'>" + info.InputTime.ToString() + "</td>");
builder.Append("<td align='center'>" + info.OrderNum + "</td>");
builder.Append("<td align='center'>" + info.ClientName + "</td>");
builder.Append("<td align='center'>" + info.UserName + "</td>");
builder.Append("<td align='center'>" + info.ProductName + "</td>");
builder.Append("<td align='center'>" + info.Unit + "</td>");
builder.Append("<td align='center'>" + info.Amount.ToString() + "</td>");
builder.Append("<td align='center'>" + info.Price.ToString("N2") + "</td>");
builder.Append("<td align='center'>" + info.TruePrice.ToString("N2") + "</td>");
builder.Append("<td align='center'>" + info.SubTotal.ToString("N2") + "</td>");
builder.Append("<td align='center'>" + info.PresentExp.ToString() + "</td>");
builder.Append("</tr>");
}
base.Response.Write(builder.ToString());
base.Response.End();
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
if (base.IsValid)
{
BasePage.ResponseRedirect("SaleList.aspx?SearchType=11&KeyWord=" + this.GetKeywords());
}
}
private string GetKeywords()
{
string str = this.TxtBeginId.Text.Trim().Replace("|", "");
string str2 = this.TxtEndId.Text.Trim().Replace("|", "");
string text = this.DpkBegin.Text;
string str4 = this.DpkEnd.Text;
string str5 = DataSecurity.FilterBadChar(this.TxtOrderNum.Text.Trim().Replace("|", ""));
string str6 = DataSecurity.FilterBadChar(this.TxtClientName.Text.Trim().Replace("|", ""));
string str7 = DataSecurity.FilterBadChar(this.TxtUserName.Text.Trim().Replace("|", ""));
string str8 = DataSecurity.FilterBadChar(this.TxtProductName.Text.Trim().Replace("|", ""));
return string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}", new object[] { str, str2, text, str4, str5, str6, str7, str8 });
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -