Exemplo n.º 1
0
 protected override void OnPreRender(EventArgs e)
 {
     TuiguangQQAct userAct = new TuiguangQQAct();
     Ruserlist.DataSource = userAct.GetByUserQQ(Request.QueryString["idd"]);
     Ruserlist.DataBind();
     base.OnPreRender(e);
 }
Exemplo n.º 2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["idd"] != null)
     {
         string qq = Request.QueryString["idd"];
         TuiguangQQAct act = new TuiguangQQAct();
         if (act.GetByUserQQ(qq).Count >= MyCache.GetCommon.KuiguangQQ)
         {
             MessageBox("您上传的推广QQ数量已经达到上限,无法继续上传!");
             return;
         }
         if (TextBox1.Text.Trim().Length <= 5)
         {
             MessageBox("请输入正确的QQ号");
             return;
         }
         string tuiguang = TextBox1.Text.Trim();
         if (act.GetByTuiguangQQ(tuiguang) != null)
         {
             MessageBox("该QQ号码已经存在数据库中!");
             return;
         }
         try
         {
             act.Add(qq, TextBox1.Text.Trim());
             MessageBox("上传成功!");
         }
         catch (Exception ex)
         {
             MessageBox(ex.Message);
         }
     }
 }
Exemplo n.º 3
0
    protected void BTadd_Click(object sender, EventArgs e)
    {
        TuiguangQQAct act = new TuiguangQQAct();
        //DateTime day1=DateTime .Now  ;
        //DateTime day2=DateTime .Now ;
        //try
        //{
        //    day1 = Convert.ToDateTime(txtDay1.Text.Trim());
        //    day2 = Convert.ToDateTime(txtDay2.Text.Trim());
        //}
        //catch (Exception ex)
        //{
        //    MessageBox("请输入正确的时间!");
        //}
        ICollection<TuiguangQQ> qqs = act.Select();
        Response.Clear();
        Response.Buffer = false;
        Response.ContentType = "application/octet-stream";
        Response.AppendHeader("content-disposition", "attachment;filename=qq.txt;");

        // 读取数据库,循环
        foreach (var item in qqs)
        {
            Response.Write(item.UserQQ + "----"+item .Tuiguang +"\r\n");
        }

        Response.Flush();
        Response.End();
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            TuiguangQQAct userAct = new TuiguangQQAct();
            Ruserlist.DataSource = userAct.GetAll ();
            Ruserlist.DataBind();

          //  txtDay1.Text = DateTime.Now.ToShortDateString();
           // txtDay2.Text = DateTime.Now.ToShortDateString();
        }
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["idd"] != null)
        {
            myqq = Request.QueryString["idd"];
        }
        if (!IsPostBack)
        {

            if (Request.QueryString["id"] != null)
            {
                TuiguangQQAct userAct = new TuiguangQQAct();
                userAct.Del(Request.QueryString["id"]);
                MessageBox("删除成功!");
            }
        }
    }