Пример #1
0
 private string GetAllMoneyByType(string type)
 {
     string str = string.Empty;
     ShowShop.BLL.Member.UserInfoNote noteBll = new ShowShop.BLL.Member.UserInfoNote();
     ChangeHope.DataBase.DataByPage dataPage = null;
     decimal money = 0;
     StringBuilder shtml = new StringBuilder();
     switch (type)
     {
         case "in":
             shtml.Append("当前页面总收入:");
             dataPage = noteBll.GetListByWhere(" noteType=1 and buckleOrAdd=0 ");
             if(dataPage.DataReader!=null)
             {
                 while(dataPage.DataReader.Read())
                 {
                     money += Convert.ToDecimal(dataPage.DataReader["ticketCount"]);
                 }
             }
             break;
         case "out":
             shtml.Append("当前页面总支出:");
             dataPage = noteBll.GetListByWhere(" noteType=1 and buckleOrAdd=1 ");
             if (dataPage.DataReader != null)
             {
                 while (dataPage.DataReader.Read())
                 {
                     money += Convert.ToDecimal(dataPage.DataReader["ticketCount"]);
                 }
             }
             break;
         default:
             break;
     }
     shtml.Append("<span style='color:Red'>"+money.ToString() + "</span>元");
     return shtml.ToString();
 }
 /// <summary>
 /// 列表
 /// </summary>
 /// <returns></returns>
 protected string GetList(string strWhere)
 {
     // noteType =0
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Member.UserInfoNote bll = new ShowShop.BLL.Member.UserInfoNote();
     ChangeHope.DataBase.DataByPage dataPage = bll.GetListByWhere(strWhere);
     //第一步先添加表头
     table.AddHeadCol("", "序号");
     table.AddHeadCol("", "用户账号");
     table.AddHeadCol("", "录入时间");
     table.AddHeadCol("", "增加点卷");
     table.AddHeadCol("", "减少点卷");
     table.AddHeadCol("", "操作员");
     table.AddHeadCol("", "备注/说明");
     table.AddHeadCol("", "操作");
     table.AddRow();
     //添加表的内容
     if (dataPage.DataReader != null)
     {
         int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
         if (curpage < 0)
         {
             curpage = 1;
         }
         int count = 0;
         while (dataPage.DataReader.Read())
         {
             count++;
             string No = (15 * (curpage - 1) + count).ToString();
             table.AddCol(No);
             table.AddCol(GetUserID(Convert.ToInt32(dataPage.DataReader["userId"].ToString())));
             table.AddCol(dataPage.DataReader["noteDate"].ToString());
             table.AddCol(dataPage.DataReader["buckleOrAdd"].ToString() == "0" ? dataPage.DataReader["ticketCount"].ToString() : string.Empty);
             table.AddCol(dataPage.DataReader["buckleOrAdd"].ToString() == "1" ? dataPage.DataReader["ticketCount"].ToString() : string.Empty);
             table.AddCol(dataPage.DataReader["noteName"].ToString());
             table.AddCol(dataPage.DataReader["causation"].ToString());
             table.AddCol(string.Format("<a href=coupons_record_view.aspx?id={0}>查看</a>", dataPage.DataReader["id"].ToString()));
             table.AddRow();
         }
     }
     string view = table.GetTable() + dataPage.PageToolBar;
     dataPage.Dispose();
     dataPage = null;
     return view;
 }
Пример #3
0
        private string GetList(string where)
        {
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.Member.UserInfoNote noteBll = new ShowShop.BLL.Member.UserInfoNote();
            ChangeHope.DataBase.DataByPage dataPage = noteBll.GetListByWhere(where);
            table.AddHeadCol("", "序号");
            table.AddHeadCol("","交易日期");
            table.AddHeadCol("","会员帐号");
            table.AddHeadCol("","收入金额");
            table.AddHeadCol("","支出金额");
            table.AddHeadCol("","操作人员");
            table.AddHeadCol("","备注/原因");
            table.AddHeadCol("","操作");
            table.AddRow();
            if(dataPage.DataReader!=null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol(No);
                    table.AddCol(dataPage.DataReader["noteDate"].ToString());
                    table.AddCol(dataPage.DataReader["userName"].ToString());
                    table.AddCol(dataPage.DataReader["buckleOrAdd"].ToString()=="0" ? dataPage.DataReader["ticketCount"].ToString() : "");
                    table.AddCol(dataPage.DataReader["buckleOrAdd"].ToString()=="1" ? dataPage.DataReader["ticketCount"].ToString() : "");
                    table.AddCol(dataPage.DataReader["noteName"].ToString());
                    table.AddCol(dataPage.DataReader["causation"].ToString());
                    table.AddCol("<a href='coupons_record_view.aspx?id=" + dataPage.DataReader["id"].ToString() + "'>查看</a>");
                    table.AddRow();
                }

            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            return view;
        }
 /// <summary>
 /// 绑定TABLE 
 /// </summary>
 /// <param name="where"></param>
 /// <returns></returns>
 public string GetListByWhere(string  where)
 {
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Member.UserInfoNote noteBll = new ShowShop.BLL.Member.UserInfoNote();
     ChangeHope.DataBase.DataByPage dataPage = noteBll.GetListByWhere(where);
     table.AddHeadCol("","用户名");
     table.AddHeadCol("","时间");
     table.AddHeadCol("","添加日期");
     table.AddHeadCol("","减少日期");
     table.AddHeadCol("","操作人员");
     table.AddHeadCol("","备注/原因");
     table.AddHeadCol("","操作");
     table.AddRow();
     if (dataPage.DataReader != null)
     {
         while (dataPage.DataReader.Read())
         {
             table.AddCol(dataPage.DataReader["userName"].ToString());
             table.AddCol(dataPage.DataReader["noteDate"].ToString());
             table.AddCol(dataPage.DataReader["buckleOrAdd"].ToString() == "0" ? dataPage.DataReader["ticketCount"].ToString() : "");
             table.AddCol(dataPage.DataReader["buckleOrAdd"].ToString() == "1" ? dataPage.DataReader["ticketCount"].ToString() : "");
             table.AddCol(dataPage.DataReader["noteName"].ToString());
             table.AddCol(dataPage.DataReader["causation"].ToString());
             table.AddCol("<a href='coupons_record_view.aspx?id=" + dataPage.DataReader["id"].ToString() + "'>查看</a>");
             table.AddRow();
         }
         string view = table.GetTable() + dataPage.PageToolBar;
         dataPage.Dispose();
         dataPage = null;
         return view;
     }
     else
     {
         return "抱歉没有符合您要求的信息!";
     }
 }