Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //验证是否登录状态
            try
            {
                if (!(Session["UserId"] != null && Session["UserName"] != null && Session["roule"] != null))
                {
                    Response.Redirect("Default.aspx");
                }
            }
            catch (Exception ex)
            {
            }

            SystemMgr.BLL.Common data = new SystemMgr.BLL.Common();
            string        id          = Session["UserId"].ToString();
            SqlDataReader dr          = SystemMgr.BLL.Common.GetDataReader("select * from Users where id=" + id);
            dr.Read();
            txtname.Text    = dr["UserName"].ToString();
            XingMing.Text   = dr["XingMing"].ToString();
            Age.Text        = dr["Age"].ToString();
            txtds.Text      = dr["Ds"].ToString();
            txtemal.Text    = dr["emal"].ToString();
            XueXiao.Text    = dr["XueXiao"].ToString();
            pic.Text        = dr["Photo"].ToString();
            Image1.ImageUrl = "files/" + dr["Photo"].ToString();
            Tel.Text        = dr["Tel"].ToString();
        }
    }
Пример #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SystemMgr.BLL.Common data = new SystemMgr.BLL.Common();
        bool  b  = SystemMgr.BLL.Common.RunSqlBool("insert into Topic(Topic,AddUser,Content)values('" + tb_title.Text + "','" + Session["UserName"].ToString() + "','" + ArticleContent.Value + "')");
        Alert js = new Alert();

        js.Alertjs("发布成功");
        Response.Redirect("BBS.aspx");
    }
Пример #3
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        string sql = "select  " + strTop + "  * from [FileInfo]";

        return(SystemMgr.BLL.Common.GetDs(sql, "fileinfo"));
    }
Пример #4
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        string sql = "select  " + strTop + "  a.*,c.Xingming as stuName,d.Xingming as TeaName from [DoWorkList] a left join WorkInfo b on a.WorkID=b.ID left join Users c on a.UserID=c.ID left join Users d on b.UserID=d.ID where b.userid=" + hf_uid.Value + " order by a.addtime desc";

        return(SystemMgr.BLL.Common.GetDs(sql, "workinfo"));
    }
Пример #5
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        string sql = "select  " + strTop + "  * from [WorkInfo] where userid=" + hf_uid.Value + " order by addtime desc";

        return(SystemMgr.BLL.Common.GetDs(sql, "workinfo"));
    }
Пример #6
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        string sql = "select  " + strTop + "  * from [News] where typeid='" + DropDownList1.SelectedValue + "'  ";

        DataSet ds = SystemMgr.BLL.Common.GetDs(sql, "news");

        return(ds);
    }
Пример #7
0
    //删除信息记录
    protected void gvInfo_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        SystemMgr.BLL.Common mydata = new SystemMgr.BLL.Common();

        string ID = gvInfo.DataKeys[e.RowIndex].Values[0].ToString();

        try
        {
            bool b = SystemMgr.BLL.Common.RunSqlBool("delete  from News  where  id='" + ID + "'");

            Label4.Text      = "删除成功!";
            gvInfo.EditIndex = -1;
            Get_Info();
        }
        catch
        {
            Label4.Text = "删除失败!";
        }
    }
Пример #8
0
    }/// <summary>

    /// 修改密码
    /// </summary>
    private void UPpwd()
    {
        SystemMgr.BLL.Common mydata = new SystemMgr.BLL.Common();
        string Username             = Session["UserId"].ToString();

        try
        {
            string sql = "update [Users]  set [pwd] ='" + txtpwd2.Text.ToString() + "' where [id]='" + Username + "' ";
            bool   b   = SystemMgr.BLL.Common.RunSqlBool(sql);



            LabelWarningMessage.Text = "修改成功!";
        }
        catch
        {
            LabelWarningMessage.Text = "修改失败!";
        }
    }
Пример #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SystemMgr.BLL.Common data = new SystemMgr.BLL.Common();
         string        id          = Request.QueryString["id"].ToString();
         SqlDataReader dr          = SystemMgr.BLL.Common.GetDataReader("select * from Users where id=" + id);
         dr.Read();
         txtname.Text    = dr["UserName"].ToString();
         XingMing.Text   = dr["XingMing"].ToString();
         Age.Text        = dr["Age"].ToString();
         txtds.Text      = dr["Ds"].ToString();
         txtemal.Text    = dr["emal"].ToString();
         XueXiao.Text    = dr["XueXiao"].ToString();
         pic.Text        = dr["Photo"].ToString();
         Image1.ImageUrl = "../files/" + dr["Photo"].ToString();
         Tel.Text        = dr["Tel"].ToString();
     }
 }
Пример #10
0
    //加载数据方法
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        lab_allcount.Text = "0";

        string        sql = "select  " + strTop + "  * from [News] where typeid='" + DropDownList1.SelectedValue + "' and [name] like '%" + keyword.Text.Trim() + "%' order by addtime desc";
        SqlConnection con = SystemMgr.BLL.Common.getConnection();
        SqlCommand    cmd = new SqlCommand(sql, con);

        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet        ds = null;

        try
        {
            con.Open();
            ds = new DataSet();
            da.Fill(ds);

            lab_allcount.Text = ds.Tables[0].Rows.Count.ToString();
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.Close();
        }
        return(ds);
    }
Пример #11
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        string sql = "select  " + strTop + "  * from [Admin] ";

        SqlConnection con = SystemMgr.BLL.Common.getConnection();
        SqlCommand    cmd = new SqlCommand(sql, con);

        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet        ds = null;

        try
        {
            con.Open();
            ds = new DataSet();
            da.Fill(ds);
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.Close();
        }
        return(ds);
    }
Пример #12
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        //string sql = "select * from [FileInfo] where TitleName like '%" + keyword.Text.Trim() + "%'  order  by addtime desc";
        string        sql = "select  " + strTop + " a.id,a.filetype,a.fileid,a.userid,a.sendMessage,a.sendtime,u.username,b.TitleName from SendMessage a left join FileInfo b on a.fileid=b.id left join users u on a.userid=u.id where a.filetype=" + hf_filetype.Value + " and (u.username like '%" + keyword.Text.Trim() + "%' or b.TitleName like '%" + keyword.Text.Trim() + "%') order by a.sendtime desc";
        SqlConnection con = SystemMgr.BLL.Common.getConnection();
        SqlCommand    cmd = new SqlCommand(sql, con);

        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet        ds = null;

        try
        {
            con.Open();
            ds = new DataSet();
            da.Fill(ds);
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.Close();
        }
        return(ds);
    }
Пример #13
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        string        sql = "select  " + strTop + "  * from [Video] where VideoName like '%" + keyword.Text.Trim() + "%' order  by addtime desc";
        SqlConnection con = SystemMgr.BLL.Common.getConnection();
        SqlCommand    cmd = new SqlCommand(sql, con);

        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet        ds = null;

        try
        {
            con.Open();
            ds = new DataSet();
            da.Fill(ds);
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.Close();
        }
        return(ds);
    }
Пример #14
0
    public DataSet GetCodeBy(int iCount)
    {
        SystemMgr.BLL.Common date = new SystemMgr.BLL.Common();
        string strTop             = "";

        if (iCount > 1)
        {
            strTop = "top " + iCount.ToString();
        }

        string        sql = "select  " + strTop + "  a.*,c.Xingming as stuName,d.Xingming as TeaName from [DoWorkList] a left join WorkInfo b on a.WorkID=b.ID left join Users c on a.UserID=c.ID left join Users d on b.UserID=d.ID where b.userid=" + hf_uid.Value + " order by a.addtime desc";
        SqlConnection con = SystemMgr.BLL.Common.getConnection();
        SqlCommand    cmd = new SqlCommand(sql, con);

        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet        ds = null;

        try
        {
            con.Open();
            ds = new DataSet();
            da.Fill(ds);
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.Close();
        }
        return(ds);
    }