// 按天统计 private void doStatTypeDay(List <Dictionary <string, object> > dataList, string seller, string time) { if (dataList == null) { return; } if (dataList.Count == 0) { m_result.addItemBySeller(seller, 0, 0, 0); return; } for (int i = 0; i < dataList.Count; i++) { int cnt = Convert.ToInt32(dataList[i]["cnt"]); long sum = Convert.ToInt64(dataList[i]["sum"]); int opType = Convert.ToInt32(dataList[i]["opType"]); StatResultSellerItem pTime = m_result.addItemBySeller(seller, cnt, sum, opType); if (pTime != null) { pTime.m_time = time; } } }
// 按日期 public void addItemByTimePlayer(string t, int cnt, long enterMoney, int exitMoney) { StatResultSellerItem item = null; for (int i = 0; i < m_items.Count; i++) { if (t == m_items[i].m_time) { item = m_items[i]; break; } } if (item == null) { item = new StatResultSellerItem(); item.m_time = t; m_items.Add(item); } if (item != null) { item.m_addScore = enterMoney; item.m_desScore = exitMoney; } }
// 按售货亭 public StatResultSellerItem addItemBySeller(string seller, int cnt, long sumScore, int opType) { StatResultSellerItem item = null; for (int i = 0; i < m_items.Count; i++) { if (seller == m_items[i].m_seller) { item = m_items[i]; break; } } if (item == null) { item = new StatResultSellerItem(); item.m_seller = seller; m_items.Add(item); } if (item != null) { if (opType == 0) // 上分 { item.m_addScore += sumScore; item.m_addScoreCount += cnt; } else // 下分 { item.m_desScore += sumScore; item.m_desScoreCount += cnt; } } return(item); }
// 按日期 public void addItemByTime(string t, int cnt, long sumScore, int opType) { StatResultSellerItem item = null; if (m_indexs.ContainsKey(t)) { item = m_indexs[t]; } if (item == null) { item = new StatResultSellerItem(); item.m_time = t; m_items.Add(item); m_indexs.Add(t, item); } if (item != null) { if (opType == 0) // 上分 { item.m_addScore += sumScore; item.m_addScoreCount += cnt; } else // 下分 { item.m_desScore += sumScore; item.m_desScoreCount += cnt; } } }
private void genTableByDay(Table table, OpRes res, GMUser user) { TableRow tr = new TableRow(); table.Rows.Add(tr); TableCell td = null; if (res != OpRes.opres_success) { td = new TableCell(); tr.Cells.Add(td); td.Text = OpResMgr.getInstance().getResultString(res); return; } StatResultSeller qresult = (StatResultSeller)user.getStatResult(StatType.statTypeSellerAdmin); int i = 0, j = 0; // 表头 for (i = 0; i < s_head.Length; i++) { td = new TableCell(); tr.Cells.Add(td); td.Text = s_head[i]; } for (i = 0; i < qresult.m_items.Count; i++) { StatResultSellerItem item = qresult.m_items[i]; tr = new TableRow(); if ((i & 1) == 0) { tr.CssClass = "alt"; } table.Rows.Add(tr); m_content[0] = item.m_time; m_content[1] = item.m_addScore.ToString(); m_content[2] = item.m_addScoreCount.ToString(); m_content[3] = item.m_desScore.ToString(); m_content[4] = item.m_desScoreCount.ToString(); m_content[5] = (item.m_addScore - item.m_desScore).ToString(); for (j = 0; j < s_head.Length; j++) { td = new TableCell(); tr.Cells.Add(td); td.Text = m_content[j]; } } }
protected void genFoot(Table table, StatResultSellerItem sum) { m_content[0] = "总计"; m_content[1] = sum.m_addScore.ToString(); m_content[2] = sum.m_addScoreCount.ToString(); m_content[3] = sum.m_desScore.ToString(); m_content[4] = sum.m_desScoreCount.ToString(); m_content[5] = (sum.m_addScore - sum.m_desScore).ToString(); m_content[6] = ""; TableCell td = null; TableRow tr = new TableRow(); table.Rows.Add(tr); for (int j = 0; j < s_head.Length; j++) { td = new TableCell(); tr.Cells.Add(td); td.Text = m_content[j]; } }
public void genTable(Table table, OpRes res, GMUser user) { TableRow tr = new TableRow(); table.Rows.Add(tr); TableCell td = null; if (res != OpRes.opres_success) { td = new TableCell(); tr.Cells.Add(td); td.Text = OpResMgr.getInstance().getResultString(res); return; } StatResultSeller qresult = (StatResultSeller)user.getStatResult(StatType.statTypeSellerStep); int i = 0, j = 0; // 表头 for (i = 0; i < s_head.Length; i++) { td = new TableCell(); tr.Cells.Add(td); td.Text = s_head[i]; } URLParam uParam = new URLParam(); uParam.m_key = "acc"; uParam.m_className = "cLevelLink"; uParam.m_url = "/appaspx/account/AccountStatSellerStep.aspx"; uParam.m_text = "查看下级"; StatResultSellerItem sum = new StatResultSellerItem(); for (i = 0; i < qresult.m_items.Count; i++) { StatResultSellerItem item = qresult.m_items[i]; tr = new TableRow(); if ((i & 1) == 0) { tr.CssClass = "alt"; } table.Rows.Add(tr); uParam.m_value = item.m_seller; uParam.clearExParam(); m_content[0] = item.m_seller; m_content[1] = item.m_addScore.ToString(); m_content[2] = item.m_addScoreCount.ToString(); m_content[3] = item.m_desScore.ToString(); m_content[4] = item.m_desScoreCount.ToString(); m_content[5] = (item.m_addScore - item.m_desScore).ToString(); sum.m_addScore += item.m_addScore; sum.m_desScore += item.m_desScore; sum.m_addScoreCount += item.m_addScoreCount; sum.m_desScoreCount += item.m_desScoreCount; if (item.m_addScore == 0 && item.m_desScore == 0) { m_content[6] = ""; } else { uParam.addExParam("time", item.m_time.TrimStart(' ').TrimEnd(' ')); m_content[6] = Tool.genHyperlink(uParam); } for (j = 0; j < s_head.Length; j++) { td = new TableCell(); tr.Cells.Add(td); td.Text = m_content[j]; } } genFoot(table, sum); }