Exemplo n.º 1
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                JpActivityusers.id = int.Parse(id);
                JpActivityusers.Delete();
            }
        }
        string pageUrl = JpCommon.CombUrlTxt("list_activityusers.aspx", "page={0}&rnd={1}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "删除", "批量删除广告记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Exemplo n.º 2
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        this.txtKeywords.Text = this.keywords;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers();

        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string ls_key = JpCommon.Filter(this.txtKeywords.Text.Trim());

        DataTable dt = new DataTable();
        string sql = "";
        sql = "  Select top 10 a.hy_bt,b.hy_name,b.hy_tel,b.hy_addtime,b.hy_ifsh,b.hy_id,b.id  from hy_activity a,hy_activityusers b   ";
        sql += "  where 1=1 and  b.hy_id=a.id  and a.hy_bt like '%" + ls_key + "%'  and a.id  not in(select top 0 a.id   ";
        sql += "   from hy_activity a,hy_activityusers b  where 1=1 and hy_bt like '%" + ls_key + "%'  order by a.hy_sort desc,b.hy_sort desc )  ";
        sql += "   order by a.hy_sort desc,b.hy_sort desc";
        TPortalClass.DAO db = new TPortalClass.DAO();
        dt = db.GetDataTable(sql);

        string sql_count = "Select count(*) as num  from hy_activity a,hy_activityusers b";
        sql_count += "  where 1=1 and  b.hy_id=a.id  and a.hy_bt like '%" + ls_key + "%' ";
        DataTable dt_count = db.GetDataTable(sql_count);
        if (dt_count.Rows.Count > 0)
        {
            this.totalCount = Convert.ToInt32(dt_count.Rows[0]["num"].ToString());
        }
        else
        {
            this.totalCount = 0;
        }

        rptList.DataSource = dt;
        rptList.DataBind();

        string pageUrl = JpCommon.CombUrlTxt("list_activityusers.aspx", "page={0}&rnd={1}&keywords={2}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Exemplo n.º 3
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }

        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();     //文档ID
        }
        TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers();
        TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity();
        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpActivityusers.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                ddlhy_id.SelectedValue = dt.Rows[0]["hy_id"].ToString();
                this.txthy_name.Text = dt.Rows[0]["hy_name"].ToString();
                this.txthy_tel.Text = dt.Rows[0]["hy_tel"].ToString();
                this.txthy_addtime.Text = Convert.ToDateTime(dt.Rows[0]["hy_addtime"].ToString()).ToString("yyyy-MM-dd");
            }
            btnSubmit.Visible = true;
            ddlhy_id.Enabled = false;
            txthy_name.Enabled = false;
            txthy_tel.Enabled = false;
            txthy_addtime.Enabled = false;
        }
        else
        {
            // this.txthy_sort.Text = JpActivityusers.GetMaxSort();
        }
    }
Exemplo n.º 4
0
    //保存
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
        {
            this.Response.Redirect("../login.aspx");
        }

        string ls_tip = "保存成功!";

        TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();

        JpActivityusers.hy_name = txthy_name.Text.Trim();
        JpActivityusers.hy_tel = txthy_tel.Text.Trim();
        JpActivityusers.hy_addtime = txthy_addtime.Text.Trim();
        JpActivityusers.hy_id = Convert.ToInt32(ddlhy_id.SelectedValue);
        JpActivityusers.hy_pwd = "";
        JpActivityusers.hy_nc = "";
        JpActivityusers.hy_mail = "";
        JpActivityusers.hy_sex = "";
        JpActivityusers.hy_addr = "";
        JpActivityusers.hy_txzp = "";
        JpActivityusers.hy_islock = "";
        JpActivityusers.hy_ismailyz = "";
        JpActivityusers.hy_issmrz = "";
        JpActivityusers.hy_sfzpic = "";
        JpActivityusers.hy_sfzcard = "";
        JpActivityusers.hy_company = "";
        JpActivityusers.hy_position = "";
        JpActivityusers.hy_post = "";
        JpActivityusers.hy_key = "";
        JpActivityusers.hy_type = "";
        JpActivityusers.hy_logo = "";
        JpActivityusers.hy_sfxs = "";
        JpActivityusers.hy_lev = "";
        JpActivityusers.hy_pic = "";
        JpActivityusers.hy_ifsh = 0;
        JpActivityusers.hy_sort = 1;

        if (this.txtop.Value == "add")
        {
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "新增", "新增广告链接记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());

            JpActivityusers.Insert();
        }
        else
        {
            JpActivityusers.id = System.Int32.Parse(this.txtid.Value);
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "修改", "修改广告链接记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());

            JpActivityusers.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
Exemplo n.º 5
0
 public string SignUpValidate(string pis_yzm, string pis_tel, string pis_name, string pis_activityid, string pis_code)
 {
     string pos_json = "";
     string ls_yzm = ConfigurationManager.AppSettings["Yanzm"].ToString();
     if (pis_tel != "" && pis_name != "" && pis_activityid != "" && pis_code != "" && pis_yzm == ls_yzm)
     {
         try
         {
             TPortalClass.JpVerifyCode JpVerifyCode = new TPortalClass.JpVerifyCode();
             DataTable dt = JpVerifyCode.GetCodesByTel(pis_tel);
             if (dt.Rows.Count > 0)
             {
                 if (pis_code == dt.Rows[0]["hy_code"].ToString())
                 {
                     JpActivityusers JpActivityusers = new JpActivityusers();
                     DataTable dt_user = JpActivityusers.GetDocbyhyidAndactivityid(Convert.ToInt32(pis_activityid), pis_tel);
                     if (dt_user.Rows.Count > 0)
                     {
                         //该用户已注册
                         pos_json = "{\"code\":\"2\"}";
                     }
                     else
                     {
                         JpActivityusers.hy_addtime = System.DateTime.Now.ToString();
                         JpActivityusers.hy_id = Convert.ToInt32(pis_activityid);
                         JpActivityusers.hy_name = pis_name;
                         JpActivityusers.hy_tel = pis_tel;
                         JpActivityusers.InsertSignUp();
                         //报名成功
                         pos_json = "{\"code\":\"0\"}";
                     }
                 }
                 else
                 {
                     //验证码错误
                     pos_json = "{\"code\":\"1\"}";
                 }
             }
         }
         catch
         {
             //系统错误
             pos_json = "{\"code\":\"3\"}";
         }
         finally
         {
         }
     }
     else
     {
         //非法调用
         pos_json = "{\"code\":\"4\"}";
     }
     return pos_json;
 }