private void BindData() { OrderStatisticsQuery orderStatisticsQuery = new OrderStatisticsQuery(); orderStatisticsQuery.BeginDate = this.BeginDate; orderStatisticsQuery.EndDate = this.EndDate; orderStatisticsQuery.PageIndex = this.pager.PageIndex; orderStatisticsQuery.PageSize = this.pager.PageSize; orderStatisticsQuery.SortOrder = SortAction.Desc; orderStatisticsQuery.SortBy = "SaleAmountFee"; Globals.EntityCoding(orderStatisticsQuery, true); DbQueryResult dbQueryResult = ShopStatisticHelper.Product_GetStatisticReport(orderStatisticsQuery); this.rptList.DataSource = dbQueryResult.Data; this.rptList.DataBind(); this.pager.TotalRecords = dbQueryResult.TotalRecords; }
private void BindData() { OrderStatisticsQuery entity = new OrderStatisticsQuery { BeginDate = this.BeginDate, EndDate = this.EndDate, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, SortOrder = SortAction.Desc, SortBy = "OrderTotal" }; Globals.EntityCoding(entity, true); DbQueryResult result = ShopStatisticHelper.Member_GetStatisticReport(entity); this.rptList.DataSource = result.Data; this.rptList.DataBind(); this.pager.TotalRecords = result.TotalRecords; }
public DbQueryResult GetOrderStatisticReport(OrderStatisticsQuery query) { StringBuilder builder = new StringBuilder(); builder.Append(" 1=1 "); if (!query.BeginDate.HasValue) { query.BeginDate = new DateTime?(DateTime.Today.AddDays(-7.0)); } if (!query.EndDate.HasValue) { query.EndDate = new DateTime?(DateTime.Today); } //builder.AppendFormat(" and wid='{0}'", query.wid); string table = string.Format("\r\n (\r\n select T1.*, b.RealName, b.CellPhone, b.UserName, b.UserHead , b.StoreName\r\n from \r\n (\r\n\t select AgentId,\r\n\t sum(OrderNumber) as OrderNumber, sum(SaleAmountFee) as SaleAmountFee, sum(BuyerNumber) as BuyerNumber, \r\n\t AVG(BuyerAvgPrice) as BuyerAvgPrice , sum(CommissionAmountFee) as CommissionAmountFee\r\n\t from dbo.vshop_Statistics_Distributors a\r\n\t where 1=1\r\n\t and AgentID>0 \r\n\t and CONVERT( varchar(10), RecDate, 120) >= CONVERT( varchar(10), '{0}', 120)\r\n\t and CONVERT( varchar(10), RecDate, 120) <= CONVERT( varchar(10), '{1}', 120) \r\n\t group by \t AgentID \r\n ) T1\r\n left join vw_Hishop_DistributorsMembers b on T1.AgentId= b.UserId and b.wid='{2}' \r\n -- where b.ReferralStatus<=1\r\n ) P \r\n ", query.BeginDate.Value.ToString("yyyy-MM-dd"), query.EndDate.Value.ToString("yyyy-MM-dd"), query.wid); return(DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, table, "AgentId", (builder.Length > 0) ? builder.ToString() : null, "*")); }
private void BindData() { OrderStatisticsQuery entity = new OrderStatisticsQuery(); DateTime local1 = this.BeginDate.Value; entity.BeginDate = this.txtBeginDate.TextToDate; DateTime local2 = this.EndDate.Value; entity.EndDate = this.txtEndDate.TextToDate; entity.SortOrder = SortAction.Desc; entity.SortBy = "RecDate"; Globals.EntityCoding(entity, true); DataTable dtDist = ShopStatisticHelper.Member_GetInCreateReport(entity); TimeSpan span = entity.EndDate.Value - entity.BeginDate.Value; this.lastDay = span.Days + 1; this.LoadTradeDataList(dtDist, this.BeginDate.Value, this.lastDay); }
private void BindData() { OrderStatisticsQuery orderStatisticsQuery = new OrderStatisticsQuery(); OrderStatisticsQuery arg_1E_0 = orderStatisticsQuery; System.DateTime arg_12_0 = this.BeginDate.Value; arg_1E_0.BeginDate = this.txtBeginDate.TextToDate; OrderStatisticsQuery arg_3B_0 = orderStatisticsQuery; System.DateTime arg_2F_0 = this.EndDate.Value; arg_3B_0.EndDate = this.txtEndDate.TextToDate; orderStatisticsQuery.SortOrder = SortAction.Desc; orderStatisticsQuery.SortBy = "RecDate"; Globals.EntityCoding(orderStatisticsQuery, true); System.Data.DataTable dtDist = ShopStatisticHelper.Member_GetInCreateReport(orderStatisticsQuery); this.lastDay = (orderStatisticsQuery.EndDate.Value - orderStatisticsQuery.BeginDate.Value).Days + 1; this.LoadTradeDataList(dtDist, this.BeginDate.Value, this.lastDay); }
private void BindData() { OrderStatisticsQuery entity = new OrderStatisticsQuery { BeginDate = this.BeginDate, EndDate = this.EndDate, Top = new int?(this.Top), PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, SortOrder = SortAction.Desc, SortBy = "SaleAmountFee", wid = this.wid }; Globals.EntityCoding(entity, true); DbQueryResult orderStatisticReport = ShopStatisticHelper.GetOrderStatisticReport(entity); DateTime beginDate = DateTime.Today.AddDays(-7.0); if (this.txtBeginDate.TextToDate.HasValue) { beginDate = this.txtBeginDate.TextToDate.Value; } DateTime now = DateTime.Now; if (this.txtEndDate.TextToDate.HasValue) { now = this.txtEndDate.TextToDate.Value; } DataRow drOne = ShopStatisticHelper.GetOrder_Member_CountInfo(beginDate, now, this.wid); this.OrderNumber = base.GetFieldIntValue(drOne, "OrderNumber"); this.SaleAmountFee = base.GetFieldDecimalValue(drOne, "SaleAmountFee").ToString("N2"); this.FXOrderNumber = base.GetFieldIntValue(drOne, "FXOrderNumber"); this.FXSaleAmountFee = base.GetFieldDecimalValue(drOne, "FXSaleAmountFee").ToString("N2"); this.FXResultPercent = "0"; if (base.GetFieldDecimalValue(drOne, "SaleAmountFee") > 0M) { this.FXResultPercent = Math.Round((decimal)((base.GetFieldDecimalValue(drOne, "FXSaleAmountFee") / base.GetFieldDecimalValue(drOne, "SaleAmountFee")) * 100M), 2).ToString("N2"); } this.FXCommissionFee = base.GetFieldDecimalValue(drOne, "FXCommissionFee").ToString("N2"); this.rptList.DataSource = orderStatisticReport.Data; this.rptList.DataBind(); this.pager.TotalRecords = orderStatisticReport.TotalRecords; }
public DataTable Member_GetInCreateReport(OrderStatisticsQuery query) { new StringBuilder().Append(" 1=1 "); if (!query.BeginDate.HasValue) { query.BeginDate = new DateTime?(DateTime.Today.AddDays(-7.0)); } if (!query.EndDate.HasValue) { query.EndDate = new DateTime?(DateTime.Today); } string str = string.Format("\r\n select * from vshop_Statistics_Globals\r\n where CONVERT(varchar(10), RecDate, 120) >= CONVERT(varchar(10), '{0}', 120) \r\n and CONVERT(varchar(10), RecDate, 120) <=CONVERT(varchar(10), '{1}', 120) and wid='{2}' \r\n order by RecDate \r\n ", query.BeginDate.Value.ToString("yyyy-MM-dd"), query.EndDate.Value.ToString("yyyy-MM-dd"), query.wid); DataTable table = new DataTable(); DbCommand sqlStringCommand = this.database.GetSqlStringCommand(str); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { return(DataHelper.ConverDataReaderToDataTable(reader)); } }
private void BindData() { OrderStatisticsQuery orderStatisticsQuery = new OrderStatisticsQuery(); orderStatisticsQuery.BeginDate = this.BeginDate; orderStatisticsQuery.EndDate = this.EndDate; orderStatisticsQuery.Top = new int?(this.Top); orderStatisticsQuery.PageIndex = this.pager.PageIndex; orderStatisticsQuery.PageSize = this.pager.PageSize; orderStatisticsQuery.SortOrder = SortAction.Desc; orderStatisticsQuery.SortBy = "SaleAmountFee"; Globals.EntityCoding(orderStatisticsQuery, true); DbQueryResult orderStatisticReport = ShopStatisticHelper.GetOrderStatisticReport(orderStatisticsQuery); System.DateTime beginDate = System.DateTime.Today.AddDays(-6.0); if (this.txtBeginDate.TextToDate.HasValue) { beginDate = this.txtBeginDate.TextToDate.Value; } System.DateTime endDate = System.DateTime.Now; if (this.txtEndDate.TextToDate.HasValue) { endDate = this.txtEndDate.TextToDate.Value; } System.Data.DataRow order_Member_CountInfo = ShopStatisticHelper.GetOrder_Member_CountInfo(beginDate, endDate); this.OrderNumber = base.GetFieldIntValue(order_Member_CountInfo, "OrderNumber"); this.SaleAmountFee = base.GetFieldDecimalValue(order_Member_CountInfo, "SaleAmountFee").ToString("N2"); this.FXOrderNumber = base.GetFieldIntValue(order_Member_CountInfo, "FXOrderNumber"); this.FXSaleAmountFee = base.GetFieldDecimalValue(order_Member_CountInfo, "FXSaleAmountFee").ToString("N2"); this.FXResultPercent = "0"; if (base.GetFieldDecimalValue(order_Member_CountInfo, "SaleAmountFee") > 0m) { this.FXResultPercent = System.Math.Round(base.GetFieldDecimalValue(order_Member_CountInfo, "FXSaleAmountFee") / base.GetFieldDecimalValue(order_Member_CountInfo, "SaleAmountFee") * 100m, 2).ToString("N2"); } this.FXCommissionFee = base.GetFieldDecimalValue(order_Member_CountInfo, "FXCommissionFee").ToString("N2"); this.rptList.DataSource = orderStatisticReport.Data; this.rptList.DataBind(); this.pager.TotalRecords = orderStatisticReport.TotalRecords; }
private void btnExport_Click(object sender, EventArgs e) { if (this.exportFieldsCheckBoxList.SelectedItem == null) { this.ShowMsg("请选择需要导出的记录", false); } else { IList <string> fields = new List <string>(); IList <string> list2 = new List <string>(); foreach (ListItem item in this.exportFieldsCheckBoxList.Items) { if (item.Selected) { fields.Add(item.Value); list2.Add(item.Text); } } OrderStatisticsQuery query = new OrderStatisticsQuery { BeginDate = this.BeginDate, EndDate = this.EndDate }; DataTable table = ShopStatisticHelper.Member_GetStatisticReport_NoPage(query, fields); StringBuilder builder = new StringBuilder(); foreach (string str in list2) { builder.Append(str + ","); if (str == list2[list2.Count - 1]) { builder = builder.Remove(builder.Length - 1, 1); builder.Append("\r\n"); } } foreach (DataRow row in table.Rows) { foreach (string str2 in fields) { builder.Append(row[str2]).Append(","); if (str2 == fields[list2.Count - 1]) { builder = builder.Remove(builder.Length - 1, 1); builder.Append("\r\n"); } } } this.Page.Response.Clear(); this.Page.Response.Buffer = false; this.Page.Response.Charset = "GB2312"; if (this.exportFormatRadioButtonList.SelectedValue == "csv") { this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename=DataExport.csv"); this.Page.Response.ContentType = "application/octet-stream"; } else { this.Page.Response.AppendHeader("Content-Disposition", "attachment;filename=DataExport.txt"); this.Page.Response.ContentType = "application/vnd.ms-word"; } this.Page.Response.ContentEncoding = Encoding.GetEncoding("GB2312"); this.Page.EnableViewState = false; this.Page.Response.Write(builder.ToString()); this.Page.Response.End(); } }
public static DbQueryResult Product_GetStatisticReport(OrderStatisticsQuery Query) { return((new ShopStatisticDao()).Product_GetStatisticReport(Query)); }
public static DataTable Member_GetStatisticReport_NoPage(OrderStatisticsQuery Query, IList <string> fields) { return((new ShopStatisticDao()).Member_GetStatisticReport_NoPage(Query, fields)); }
public static DbQueryResult Member_GetStatisticReport(OrderStatisticsQuery Query) { return((new ShopStatisticDao()).Member_GetStatisticReport(Query)); }
public static DbQueryResult Member_GetRegionReport(OrderStatisticsQuery query) { return((new ShopStatisticDao()).Member_GetRegionReport(query)); }
public static DataTable Member_GetInCreateReport(OrderStatisticsQuery query) { return((new ShopStatisticDao()).Member_GetInCreateReport(query)); }
public static DataTable Product_GetStatisticReport_NoPage(OrderStatisticsQuery query, IList <string> fields) { return((new ShopStatisticDao()).Product_GetStatisticReport_NoPage(query, fields)); }
public static DbQueryResult GetOrderStatisticReport(OrderStatisticsQuery Query) { return(new ShopStatisticDao().GetOrderStatisticReport(Query)); }