Beispiel #1
0
 private void Page_Load(object sender, EventArgs e)
 {
     MyFunc.isRefUrl();
     if (!MyFunc.CheckUserLogin(1) || !MyTeam.OnlineList.OnlineList.isUserLogin(1))
     {
         MyFunc.goToLoginPage();
         base.Response.End();
     }
     else if (base.Request.QueryString["username"].Trim() == "")
     {
         MyFunc.showmsg("出错了!");
         base.Response.End();
     }
     else
     {
         int curPage;
         int pagesize = 10;
         try
         {
             curPage = int.Parse(base.Request.QueryString["page"].ToString());
         }
         catch
         {
             curPage = 1;
         }
         if (curPage < 1)
         {
             curPage = 1;
         }
         if (!base.IsPostBack)
         {
             int start;
             this.UserEventTable.Rows[0].Cells[0].InnerHtml = "<font color=red>" + base.Request.QueryString["username"].Trim() + "</font>的登陆日志";
             string   sql         = "SELECT * FROM event WHERE username='******' ORDER BY id DESC";
             DataBase base2       = new DataBase(MyFunc.GetConnStr(2));
             int      totalRecord = int.Parse(base2.ExecuteScalar("SELECT COUNT(*) FROM event WHERE username='******'").ToString());
             if (totalRecord == 0)
             {
                 start = 0;
             }
             else
             {
                 start = (curPage - 1) * pagesize;
             }
             DataSet set   = base2.ExecuteDataSet(sql, start, pagesize, "event");
             string  text2 = "<table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor='#999999'><tr class=blueheader><td width='22%'>来源IP</td><td width='28%'>登陆时间</td><td width='30%'>离开时间</td><td width='20%'>停留时间</td></tr>";
             for (int i = 0; i < set.Tables[0].Rows.Count; i++)
             {
                 string text3 = text2;
                 text2 = text3 + "<tr bgcolor='#FFFFFF'><td>" + set.Tables[0].Rows[i]["ip"].ToString().Trim() + "</td><td>" + set.Tables[0].Rows[i]["logintime"].ToString().Trim() + "</td><td>";
                 if (set.Tables[0].Rows[i]["lefttime"].ToString().Trim() == "")
                 {
                     text2 = text2 + "未知</td><td>未知</td></tr>";
                 }
                 else
                 {
                     TimeSpan span  = (TimeSpan)(DateTime.Parse(set.Tables[0].Rows[i]["lefttime"].ToString().Trim()) - DateTime.Parse(set.Tables[0].Rows[i]["logintime"].ToString().Trim()));
                     string   text4 = text2;
                     text2 = text4 + set.Tables[0].Rows[i]["lefttime"].ToString().Trim() + "</td><td>" + span.TotalMinutes.ToString("F") + "&nbsp;分钟</td></tr>";
                 }
             }
             base2.Dispose();
             text2 = text2 + "</table>";
             this.UserEventTable.Rows[1].Cells[0].InnerHtml = text2;
             this.UserEventTable.Rows[2].Cells[0].InnerHtml = MyFunc.MulitPager(totalRecord, pagesize, curPage, "MgrOnlineMsg.aspx?username="******"username"].Trim());
             this.DataBind();
         }
     }
 }
Beispiel #2
0
        private string GetOrderList(string start_date, string end_date, string t1, string t2, string isjs, string tztype, string ballid, string gdid, string zdlid, string dlsid, string userid, string username, string orderid, string matchname, string tzmoney, string rr, string iscancel, string iswin)
        {
            int curPage;
            int start;
            int pagesize = 100;

            try
            {
                curPage = int.Parse(base.Request.QueryString["page"].ToString());
            }
            catch
            {
                curPage = 1;
            }
            if (curPage < 1)
            {
                curPage = 1;
            }
            string text  = "SELECT  orderid,userid,username,tzmoney,tztype,curpl,win,lose,truewin,hsuser_w,hsuser_l,content,updatetime,iscancel,balltime,isdanger,tzip,ds FROM Ball_order ";
            string text2 = "WHERE updatetime BETWEEN '" + start_date + " " + t1 + "' AND '" + end_date + " " + t2 + "' ";
            string text3 = "";

            if (orderid != "")
            {
                text2 = text2 + " AND orderid=" + orderid;
            }
            if (tztype != "")
            {
                text2 = text2 + " AND tztype=" + tztype;
            }
            if (ballid != "")
            {
                text2 = text2 + " AND ballid in (" + ballid + ")";
            }
            if (gdid != "")
            {
                text2 = text2 + " AND gdid=" + gdid;
            }
            if (zdlid != "")
            {
                text2 = text2 + " AND zdlid=" + zdlid;
            }
            if (dlsid != "")
            {
                text2 = text2 + " AND dlsid=" + dlsid;
            }
            if ((userid != "") && (username == ""))
            {
                text2 = text2 + " AND userid='" + userid + "'";
            }
            if ((userid == "") && (username != ""))
            {
                text2 = text2 + " AND username='******'";
            }
            if ((isjs != "") && (iscancel == ""))
            {
                text2 = text2 + " AND isjs=" + isjs;
            }
            if ((rr != "") && (rr == "0"))
            {
                text2 = text2 + " AND win-lose=0";
            }
            if (tzmoney != "")
            {
                text2 = text2 + " AND tzmoney>=" + tzmoney;
            }
            if ((iscancel != "") && (iscancel != "0"))
            {
                text2 = text2 + " AND iscancel=" + iscancel;
            }
            if (iswin != "")
            {
                if (iswin == "w")
                {
                    text2 = text2 + " AND win>0";
                }
                if (iswin == "s")
                {
                    text2 = text2 + " AND lose > 0";
                }
            }
            DataBase base2       = new DataBase(MyFunc.GetConnStr(2));
            int      totalRecord = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM Ball_order " + text2).ToString());

            if (totalRecord == 0)
            {
                start = 0;
            }
            else
            {
                start = (curPage - 1) * pagesize;
            }
            DataSet set   = base2.ExecuteDataSet(text + text2 + " ORDER BY orderid DESC", start, pagesize, "ball_order");
            double  num5  = 0;
            double  num6  = 0;
            int     num7  = 0;
            string  text4 = "";

            for (int i = 0; i < set.Tables[0].Rows.Count; i++)
            {
                string text9  = text3;
                string text10 = text9 + "<tr bgcolor=#FFFFFF><td align=\"center\">" + set.Tables[0].Rows[i]["orderid"].ToString().Trim() + "</td><td align=\"center\">" + DateTime.Parse(set.Tables[0].Rows[i]["updatetime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss").ToUpper().Replace(" ", "<br>");
                text3 = text10 + "</td><td align=\"center\">" + set.Tables[0].Rows[i]["username"].ToString().Trim() + "</td><td align=\"center\">" + MyFunc.GettzTypeName(set.Tables[0].Rows[i]["tztype"].ToString().Trim()) + "</td><td align=\"right\">" + set.Tables[0].Rows[i]["content"].ToString().Trim() + "</td><td align=\"right\" valign=\"top\"> </td><td align=\"right\" valign=\"top\">" + MyFunc.NumBerFormat(set.Tables[0].Rows[i]["tzmoney"].ToString().Trim()) + "</td>";
                string text5 = "#ffffff";
                string text6 = "&nbsp;";
                double num9  = double.Parse(set.Tables[0].Rows[i]["truewin"].ToString().Trim());
                double num10 = double.Parse(set.Tables[0].Rows[i]["win"].ToString().Trim());
                double num11 = double.Parse(set.Tables[0].Rows[i]["lose"].ToString().Trim());
                string text7 = set.Tables[0].Rows[i]["ds"].ToString().Trim();
                if ((num10 > 0) && (num9 == 1))
                {
                    text5 = "#FF9B9B";
                    text6 = "全赢";
                }
                else if (num9 == 0.5)
                {
                    text5 = "#A6D5EE";
                    text6 = "和局";
                }
                else if ((num11 > 0) && (num9 == 1))
                {
                    text5 = "#FFFF99";
                    text6 = "全输";
                }
                else if ((num10 > 0) && (num9 == 2))
                {
                    text5 = "#FF9B9B";
                    text6 = text7;
                }
                string text11 = text3;
                text3 = (text11 + "<td align=\"center\" valign=\"top\" style='background-color: " + text5 + ";'>" + text6) + "</td>" + "<td align=\"right\" valign=\"top\">";
                if (set.Tables[0].Rows[i]["isdanger"].ToString().Trim().ToUpper() == "2")
                {
                    text3 = text3 + "<font color=red>危险球取消</font>";
                }
                else if (set.Tables[0].Rows[i]["iscancel"].ToString().Trim().ToUpper() == "TRUE")
                {
                    text3 = text3 + "<font color=red>已取消</font>";
                }
                else
                {
                    double num12 = double.Parse(set.Tables[0].Rows[i]["win"].ToString().Trim()) - double.Parse(set.Tables[0].Rows[i]["lose"].ToString().Trim());
                    text3 = text3 + MyFunc.NumBerFormat(num12.ToString());
                }
                text3 = text3 + "</td><td align=center>";
                if ((this.Session.Contents["classid"] != null) && (this.Session.Contents["classid"].ToString().Trim() == "3"))
                {
                    text3 = text3 + "<font color=red>不能操作</font>";
                }
                else if (set.Tables[0].Rows[i]["iscancel"].ToString().Trim().ToUpper() == "TRUE")
                {
                    string text12 = text3;
                    text3 = text12 + "<a href=orderlist.aspx?action=resume&orderid=" + set.Tables[0].Rows[i]["orderid"].ToString().Trim() + "&start=" + start_date + "&end=" + end_date + "&flag=" + isjs + "&bid=" + ballid + "&type=" + tztype + "&gid=" + gdid + "&zid=" + zdlid + "&did=" + dlsid + "&uid=" + userid + "&uname=" + username + "&oid=" + orderid + "&t1=" + t1 + "&t2=" + t2 + "&matchname=" + matchname + "&tzmoney=" + tzmoney + "&rr=" + rr + "&isc=" + iscancel + "&isw=" + iswin + "&page=" + curPage.ToString() + " onclick=\"return confirm('确定要恢复该注单吗?')\"><font color=red>恢复</font></a>";
                }
                else
                {
                    string text13 = text3;
                    text3 = text13 + "<a href=orderlist.aspx?action=cancel&orderid=" + set.Tables[0].Rows[i]["orderid"].ToString().Trim() + "&start=" + start_date + "&end=" + end_date + "&flag=" + isjs + "&bid=" + ballid + "&type=" + tztype + "&gid=" + gdid + "&zid=" + zdlid + "&did=" + dlsid + "&uid=" + userid + "&uname=" + username + "&oid=" + orderid + "&t1=" + t1 + "&t2=" + t2 + "&matchname=" + matchname + "&tzmoney=" + tzmoney + "&rr=" + rr + "&isc=" + iscancel + "&isw=" + iswin + "&page=" + curPage.ToString() + " onclick=\"return confirm('确定要取消该注单吗?')\">取消</a>";
                    num5 += double.Parse(set.Tables[0].Rows[i]["tzmoney"].ToString().Trim());
                    num6 += double.Parse(set.Tables[0].Rows[i]["win"].ToString().Trim()) - double.Parse(set.Tables[0].Rows[i]["lose"].ToString().Trim());
                }
                num7++;
                text4 = text4 + set.Tables[0].Rows[i]["orderid"].ToString().Trim() + ",";
            }
            string text14 = text3;

            text3 = (text14 + "<tr class=\"sum\"><form name='form1' method='post' action='OrderList.aspx'><input name='action' type='hidden' value='kygl'><input name='order_list' type='hidden' value='" + text4 + "'><td colspan=\"4\"><input type=submit value='取消本页注单' onclick=\"return confirm('确定要取消本页所有注单吗?')\" class=text></td></form><td>当前笔数:" + num7.ToString() + "</td><td>&nbsp;</td><td>" + MyFunc.NumBerFormat(num5.ToString()) + "</td><td>&nbsp;</td><td>" + MyFunc.NumBerFormat(num6.ToString()) + "</td><td>&nbsp;</td></tr>") + "<tr><td colspan=10 align=right bgcolor=#ffffff>" + MyFunc.MulitPager(totalRecord, pagesize, curPage, "OrderList.aspx?start=" + start_date + "&end=" + end_date + "&flag=" + isjs + "&bid=" + ballid + "&type=" + tztype + "&gid=" + gdid + "&zid=" + zdlid + "&did=" + dlsid + "&uid=" + userid + "&oid=" + orderid + "&t1=" + t1 + "&t2=" + t2 + "&matchname=" + matchname + "&tzmoney=" + tzmoney + "&rr=" + rr + "&isc=" + iscancel + "&isw=" + iswin) + "</td></tr>";
            SqlDataReader reader = base2.ExecuteReader("SELECT ISNULL(COUNT(1),0) AS ordercount,ISNULL(sum(tzmoney),0) AS tzcount,ISNULL(sum(win-lose),0) AS wincount FROM ball_order " + text2);

            if (reader.Read())
            {
                string text15 = text3;
                text3 = text15 + "<tr class=\"sum\"><td colspan=\"4\">&nbsp;</td><td>总笔数:" + reader["ordercount"].ToString().Trim() + "</td><td>&nbsp;</td><td>" + MyFunc.NumBerFormat(reader["tzcount"].ToString()) + "</td><td>&nbsp;</td><td>" + MyFunc.NumBerFormat(reader["wincount"].ToString()) + "</td><td>&nbsp;</td></tr>";
            }
            reader.Close();
            base2.Dispose();
            return(text3);
        }