Exemplo n.º 1
0
    public void CheckUserView(string strTiaojian)
    {
        baseClassSql bcs = new baseClassSql();

        StringBuilder sb = new StringBuilder();

        try
        {
            if (HttpContext.Current.Session["groupIsLock"] != null && HttpContext.Current.Session["groupIsLock"].ToString() == "true")
            {
                sb.Append("alert('您所在的组被关闭,无法浏览!');");
                sb.Append("location='index.aspx';");
                bcs.MakeJs(sb.ToString());
                //Response.Redirect("index.aspx");
            }
            else if (HttpContext.Current.Session["userIsLock"] != null && HttpContext.Current.Session["userIsLock"].ToString() == "true")
            {
                sb.Append("alert('您被锁定,无法浏览!');");
                sb.Append("location='index.aspx';");
                bcs.MakeJs(sb.ToString());
                //Response.Redirect("index.aspx");
            }
            else if (HttpContext.Current.Session["groupView"] != null && !HttpContext.Current.Session["groupView"].ToString().Contains(strTiaojian))
            {
                sb.Append("alert('您的权限不够,无法浏览!');");
                sb.Append("location='index.aspx';");
                bcs.MakeJs(sb.ToString());
                //Response.Redirect("index.aspx");
            }
        }
        catch { sb.Append("location='index.aspx';"); bcs.MakeJs(sb.ToString()); }
    }
Exemplo n.º 2
0
    public SqlDataReader get_one( )
    {
        //string sql = "select * from " + table + " where id =" + id;
        string sql = "select top 1 * from [w_jieshao] where [id]=5 or [title]='企业招聘' order by [inputdate] desc";

        baseClassSql GET = new baseClassSql();

        return(GET.Get(sql));
    }
Exemplo n.º 3
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        string _txtCode = txtCode.Value.Replace("'", "");

        if (Request.Cookies["pageCode"] == null || string.IsNullOrEmpty(Request.Cookies["pageCode"].Value) || Request.Cookies["pageCode"].Value.ToString() != _txtCode)
        {
            Literal1.Text = "验证码错误";
            return;
        }

        string _txtPassword  = txtPassword.Value.Replace("'", "");
        string _txtPassword2 = txtPassword2.Value.Replace("'", "");

        if (_txtPassword == "" || _txtPassword != _txtPassword2)
        {
            Literal1.Text = "两次密码不一致";
            return;
        }

        string _txtFirstName = txtFirstName.Value.Replace("'", "");
        string _txtEmail     = txtEmail.Value.Replace("'", "");

        string _lstIndustries  = lstIndustries.Value.Replace("'", "");
        string _txtOrg         = txtOrg.Value.Replace("'", "");
        string _ddlFunctional  = ddlFunctional.Value.Replace("'", "");
        string _txtJobTitle    = txtJobTitle.Value.Replace("'", "");
        string _txtCountryCity = txtCountryCity.Value.Replace("'", "");


        baseClassSql bc     = new baseClassSql();
        bool         affect = bc.ExecuteSql("insert into [userVip] ([u_email],[u_pass],[u_xingming],[u_hangye],[u_companyname],[u_department],[u_position],[u_address]) values (" +
                                            "'" + _txtEmail + "'," +
                                            "'" + _txtPassword2 + "'," +
                                            "'" + _txtFirstName + "'," +
                                            "'" + _lstIndustries + "'," +
                                            "'" + _txtOrg + "'," +
                                            "'" + _ddlFunctional + "'," +
                                            "'" + _txtJobTitle + "'," +
                                            "'" + _txtCountryCity + "'" +
                                            ")");

        if (affect)
        {
            Page.RegisterStartupScript("success", "<script>alert('注册成功');location.href='/page/login.aspx';</script>");
        }
        else
        {
            Page.RegisterStartupScript("success", "<script>alert('注册失败');</script>");
        }
        Literal1.Text = "";
    }
Exemplo n.º 4
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        baseClassSql bc     = new baseClassSql();
        string       semail = txtEmail.Value.Replace("'", "");

        string affect = bc.getOneMsg("select [id] from [userVip] where [u_email]='" + semail + "' and [u_pass]='" + txtPass.Value.Replace("'", "") + "'");

        if (affect != "")
        {
            Session.Add("uid", affect);
            Session.Add("umail", semail);

            Page.RegisterStartupScript("success", "<script>alert('登录成功');location.href='/index.aspx';</script>");
        }
        else
        {
            Page.RegisterStartupScript("success", "<script>alert('登录失败');</script>");
        }
    }