Webshell Akmal archtte id
System:
Microsoft Windows NT 10.0.20348.0
Server:
Microsoft-IIS/10.0
User:
buyyou
Directory:
C:
\
MyData
\
WWW
\
asc365
\
Name
Size
Type
Actions
ASC365_CANADA
-
Directory
Rename
Delete
ASC365_Store01
-
Directory
Rename
Delete
aspnet_client
-
Directory
Rename
Delete
CompanyImage
-
Directory
Rename
Delete
TJGS_USA
-
Directory
Rename
Delete
zhijian
-
Directory
Rename
Delete
Memo.inc
0 bytes
.inc
Edit
Rename
Delete
web.config
213 bytes
.config
Edit
Rename
Delete
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using wzLib; using System.Security.Cryptography; using System.Text; using System.Data; namespace App.prog { public partial class moneylist : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string year = DateTime.Today.Year.ToString(); string month = DateTime.Today.Month.ToString().PadLeft(2, '0'); DropDownList1.SelectedValue = year; DropDownList3.SelectedValue = year; DropDownList2.SelectedValue = "01"; DropDownList4.SelectedValue = month; } } protected void Button1_Click(object sender, EventArgs e) { string[,] DataList = new string[50, 100]; string[] shijian = new string[100]; int a = 0; string date1 = DropDownList1.SelectedValue.ToString() + "-" + DropDownList2.SelectedValue.ToString() + "-01"; string date2 = DropDownList3.SelectedValue.ToString() + "-" + DropDownList4.SelectedValue.ToString() + "-01"; string str = "select distinct(zubie) from CW_YEJI order by zubie"; DataTable dt1 = SQLHelper.getDataTable(str); for (int i = 0; i < dt1.Rows.Count; i++) { DataList[i, 0] = dt1.Rows[i][0].ToString(); } string str1 = "select sum(money),zubie from CW_YEJI where yuefen between '" + date1 + "' and '" + date2 + "' group by zubie"; DataTable dt2 = SQLHelper.getDataTable(str1); decimal allmoney = 0; for (int k = 0; k < dt1.Rows.Count; k++) { for (int i = 0; i < dt2.Rows.Count; i++) { if (DataList[k, 0].ToString() == dt2.Rows[i][1].ToString()) { string ttt = dt2.Rows[i][0].ToString(); if (ttt == null) { ttt = "0"; } DataList[k, 1] = ttt; allmoney = allmoney + decimal.Parse(ttt); } } } DataList[dt1.Rows.Count, 0] = "总合计"; if (allmoney == 0) { allmoney = 1; } DataList[dt1.Rows.Count, 1] = allmoney.ToString(); for (int i = 0; i < 100; i++) { string date3 = DateTime.Parse(date1).AddMonths(i).ToString("yyyy-MM-dd"); string date4 = DateTime.Parse(date1).AddMonths(i - 1).ToString("yyyy-MM-dd"); if (DateTime.Parse(date3) <= DateTime.Parse(date2)) { shijian[a] = date3.ToString().Substring(0, 7); string str3 = "select sum(money),zubie,Cast(sum(money)/(select sum(money) from CW_YEJI where yuefen='" + date3 + "')*100 as decimal(15,2)),Cast(sum(money)/(select sum(money) from CW_YEJI where yuefen='" + date4 + "' and zubie=a.zubie)*100-100 as decimal(15,2)) as tongbi from CW_YEJI a where yuefen='" + date3 + "' group by zubie"; decimal allmoney1 = 0; DataTable dt3 = SQLHelper.getDataTable(str3); for (int s = 0; s < dt3.Rows.Count; s++) { for (int j = 0; j < dt1.Rows.Count; j++) { if (DataList[j, 0] == dt3.Rows[s][1].ToString()) { string tttt = dt3.Rows[s][0].ToString(); if (tttt == null) { tttt = "0"; } DataList[j, 3 * i + 2] = tttt; DataList[j, 3 * i + 3] = dt3.Rows[s][2].ToString(); DataList[j, 3 * i + 4] = dt3.Rows[s][3].ToString(); allmoney1 = allmoney1 + decimal.Parse(tttt); } } string str4 = "select sum(money),Cast(sum(money)/(select sum(money) from CW_YEJI where yuefen='" + date4 + "')*100-100 as decimal(15,2)) as tongbi from CW_YEJI a where yuefen='" + date3 + "'"; DataTable dt4 = SQLHelper.getDataTable(str4); DataList[dt1.Rows.Count, i * 3 + 2] = dt4.Rows[0][0].ToString(); DataList[dt1.Rows.Count, i * 3 + 4] = dt4.Rows[0][1].ToString(); } a += 1; } } DataTable dt = new DataTable(); dt.Columns.Add("zubie", typeof(string)); dt.Columns.Add("money", typeof(string)); dt.Columns.Add("moneybili", typeof(string)); //dt.Columns[0].Caption = "组别"; for (int b = a - 1; b >= 0; b--) { dt.Columns.Add("money" + b, typeof(string)); dt.Columns.Add("money" + b + "bili", typeof(string)); dt.Columns.Add("money" + b + "tongbi", typeof(string)); } GridView1.Columns.Clear(); //GridView1.Width = new Unit(0); /* CreateGridColumn("zubie", "组别", 100, "cuntleft", "cuntleft"); CreateGridColumn("money", "总金额", 100, "cuntleft", "cuntleft"); for (int c = 0; c < a; c++) { string data4 = DateTime.Parse(date1).AddMonths(c).ToString("yyyy-MM-dd").Substring(0,7); CreateGridColumn("money" + c, data4, 80, "cuntleft", "cuntleft"); } * */ for (int i = 0; i <= dt1.Rows.Count; i++) { DataRow dr = dt.NewRow(); dr["zubie"] = DataList[i, 0]; dr["money"] = DataList[i, 1]; string temp ="0"; string temp1 = "0"; if ( DataList[dt1.Rows.Count, 1] != null) { temp = DataList[dt1.Rows.Count, 1]; } if (DataList[i, 1] != null) { temp1 = DataList[i, 1]; } dr["moneybili"] = (Decimal.Parse(temp1) / decimal.Parse(temp) * 100).ToString("0.00"); for (int j = 0; j < a; j++) { //string data4 = DateTime.Parse(date1).AddMonths(j).ToString("yyyy-MM-dd").Substring(0, 7); string newname = "money" + j; string newname1 = "money" + j + "bili"; string newname2 = "money" + j + "tongbi"; if (DataList[i, j + 2] == null) { DataList[i, j + 2] = "0"; } dr[newname] = DataList[i, j * 3 + 2]; dr[newname1] = DataList[i, j * 3 + 3]; dr[newname2] = DataList[i, j * 3 + 4]; } dt.Rows.Add(dr); } GridView1.DataSource = dt; GridView1.DataBind(); } // 创建GridView列的方法 private void CreateGridColumn(string dataField, string headerText, int width, string headerStyle, string itemStyle) { BoundField bc = new BoundField(); bc.DataField = dataField; bc.HeaderText = headerText; bc.HeaderStyle.CssClass = headerStyle; //若有默认样式,此行代码及对应的参数可以移除 bc.ItemStyle.CssClass = itemStyle; //若有默认样式,此行代码及对应的参数可以移除 GridView1.Columns.Add(bc); //把动态创建的列,添加到GridView中 GridView1.Width = new Unit(GridView1.Width.Value + width); //每添加一列后,要增加GridView的总体宽度 } protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { TableCellCollection header = e.Row.Cells; header.Clear(); string headtxt = "组别</th><th rowspan='2'>总金额</th><th rowspan='2'>销售占比</th>"; string date1 = DropDownList1.SelectedValue.ToString() + "-" + DropDownList2.SelectedValue.ToString() + "-01"; string date2 = DropDownList3.SelectedValue.ToString() + "-" + DropDownList4.SelectedValue.ToString() + "-01"; for (int i = 0; i < 100; i++) { string date3 = DateTime.Parse(date2).AddMonths(-i).ToString("yyyy-MM-dd"); if (DateTime.Parse(date3) >= DateTime.Parse(date1)) { headtxt += "<th colspan='3'>" + date3.Substring(0, 7) + "</th>"; } } headtxt += "</tr><tr>"; for (int i = 0; i < 100; i++) { string date3 = DateTime.Parse(date2).AddMonths(-i).ToString("yyyy-MM-dd"); if (DateTime.Parse(date3) >= DateTime.Parse(date1)) { headtxt += "<th>当月金额</th><th>占比(%)</th><th>增长率(%)</th>"; } } headtxt += "</tr>"; TableHeaderCell cell = new TableHeaderCell(); cell.Attributes.Add("rowspan", "2"); //跨两行 cell.Text = (headtxt); header.Add(cell); } } } }