Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _RecordCount = Convert.ToInt32(lblRecordCount.Text);
        _PageCount = _RecordCount / _PageSize;
        if (_RecordCount % _PageSize > 0) _PageCount++;
        _PageIndex = Convert.ToInt32(lblPageIndex.Text);
        int selectedCount = 0;

        string sParent = "'0'";
        DB = new dbMsgAll(rdlCategory.SelectedItem.Value);

        if (!IsPostBack)
        {
            dbConfig configDB = new dbConfig();
            string gUserName = configDB.getUserName(User.Identity.Name);
            string gIP = Request.ServerVariables["Remote_Addr"];
            string gContent = "聊天查询";
            common.setLog(User.Identity.Name, gUserName, gIP, gContent);
            formInit();
        }
        else
        {
            switch (qrytypelist.SelectedItem.Value)
            {
                case "0"://自选时间段
                    Condition += "vTime > '" + Convert.ToDateTime(sdate.Value.ToString()).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + Convert.ToDateTime(edate.Value.ToString()).AddDays(1).ToString("yyyy-MM-dd") + "'";
                    break;
                case "1"://前三天
                    Condition += "vTime > '" + DateTime.Today.AddDays(-3).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
                case "2"://前一周
                    Condition += "vTime > '" + DateTime.Today.AddDays(-7).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
                case "3"://前一月
                    Condition += "vTime > '" + DateTime.Today.AddMonths(-1).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
                case "5"://昨天
                    Condition += "vTime > '" + DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
            }
            //获取选中的服务器
            foreach (ListItem li in cblHost.Items)
            {
                if (li.Selected)
                {
                    sParent += "," + li.Value + "";
                    selectedCount++;
                }
            }
            if (selectedCount < cblHost.Items.Count)
                Condition += " and nParent in (" + sParent + ")";
            if (txtSrcAddr.Text.ToString() != "")
                Condition += " and vSrcAddr = dmc_config.dbo.[f_IP2int]('" + txtSrcAddr.Text.ToString() + "')";
            if (txtSrcMac.Text.ToString() != "")
                Condition += " and vSrcMac = '" + txtSrcMac.Text.ToString() + "'";
            if (txtDstAddr.Text.ToString() != "")
                Condition += " and vDstAddr = dmc_config.dbo.[f_IP2int]('" + txtDstAddr.Text.ToString() + "')";

            string msntype = chkTalkMode.SelectedItem.Value;
            if (txtMailFrom.Text.ToString() != "")
            {
                if (msntype == "0")//发送方
                {
                    if (fromeq.Checked)
                    {

                        Condition += " and vMailFrom = '" + txtMailFrom.Text.ToString() + "'";
                    }
                    else
                    {

                        Condition += " and vMailFrom like '%" + txtMailFrom.Text.ToString().Trim() + "%'";
                    }

                }
                else if (msntype == "1")//接收方
                {
                    if (fromeq.Checked)
                    {

                        Condition += " and vMailTo = '" + txtMailFrom.Text.ToString() + "'";
                    }
                    else
                    {

                        Condition += " and vMailTo like '%" + txtMailFrom.Text.ToString().Trim() + "%'";
                    }

                }
                else//对话模式
                {
                    if (fromeq.Checked)
                    {

                        Condition += " and (vMailFrom = '" + txtMailFrom.Text.ToString() + "' or vMailTo = '" + txtMailFrom.Text.ToString() + "')";
                    }
                    else
                    {

                        Condition += " and (vMailFrom like '%" + txtMailFrom.Text.ToString().Trim() + "%' or vMailTo like '%" + txtMailFrom.Text.ToString() + "%')";
                    }
                }
            }

            if (txtMessage.Text.ToString() != "")
                Condition += " and vMessage like '%" + txtMessage.Text.ToString() + "%'";
            if (rdlMode.SelectedValue == "1")//敏感模式
                Condition += " and nKey > 0";

            int senstive = common.GetSenstiveCheck(this.CheckBoxList2);

            if (senstive > 0)
                Condition += " and ( (nKey & " + senstive + ")>0 ) ";

            // 条件传给存储过程的时候,最前面不需要跟上and
            if (!string.IsNullOrEmpty(Condition) && Condition.Length > 4 && Condition.Substring(0, 5) == " and ")
                Condition = Condition.Substring(5);
        }
    }
Exemplo n.º 2
0
 //导出Yahoo数据
 protected void btnYahooExport_Click(object sender, EventArgs e)
 {
     DateTime dteFromDate, dteToDate;
     dteFromDate = Convert.ToDateTime(YahooStartDate.Value.ToString()).Date;
     dteToDate = Convert.ToDateTime(YahooEndDate.Value.ToString()).Date;
     dbMsgAll DB = new dbMsgAll("Yahoo");
     string FileName = Server.MapPath(".") + "\\temp\\" + common.GetFileName() + ".xls";
     DB.ExportToExcel(dteFromDate, dteToDate, FileName);
     SendToClient(FileName);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 根据选择的模块生成不同的类型
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 private database CreateDataBase(string type)
 {
     database d = null;
     switch (type)
     {
         case "1":
             d = new dbHttpAll();
             break;
         case "2":
             d = new dbMsgAll("Msn");
             break;
         case "3":
             d = new dbMsgAll("Yahoo");
             break;
         case "4":
             d = new dbMailBox("Pop");
             break;
         case "5":
             d = new dbMailBox("Smtp");
             break;
         case "6":
             d = new dbMailSite("Get");
             break;
         case "7":
             d = new dbMailSite("Send");
             break;
         case "8":
             d = new dbInfoAll("Web");
             break;
         case "9":
             d = new dbDns();
             break;
         case "10":
             d = new dbHorse();
             break;
         case "11":
             d = new dbInfoAll("Ftp");
             break;
     }
     return d;
 }
Exemplo n.º 4
0
 //删除Yahoo数据
 protected void btnYahooDelete_Click(object sender, EventArgs e)
 {
     DateTime dteFromDate, dteToDate;
     dteFromDate = Convert.ToDateTime(YahooStartDate.Value.ToString()).Date;
     dteToDate = Convert.ToDateTime(YahooEndDate.Value.ToString()).Date;
     dbMsgAll DB = new dbMsgAll("Yahoo");
     DB.DelTables(dteFromDate, dteToDate);
 }