⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 receivemessagebox.aspx.cs

📁 oa办公系统
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ReceiveMessageBox : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["uname"].ToString() != null)
        {
            this.btndel.Attributes.Add("onClick", "javascript:return   confirm('确定删除吗?');");
            if (!IsPostBack)
            {
                bandreceive();
            }
        }
    }
    private void bandreceive()
    {
        message ReceiveBox = new message();
        DataSet ds = new DataSet();
        ds = ReceiveBox.Sel_ReceiveBox(Convert.ToInt32(Session["uname"]));
        if (ds.Tables[0].Rows.Count > 0)
        {
            this.receiveboxview.DataSource = ds;
            this.receiveboxview.DataBind();
        }
        else
        {
            this.receiveboxview.DataBind();
            Response.Write("<script>alert('收件箱中没有短信息')</script>");
        }
    }
    protected void sendboxview_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.receiveboxview.PageIndex = e.NewPageIndex;
        bandreceive();
    }
    protected void btndel_Click(object sender, EventArgs e)
    {
        for (int i = 0; i <= this.receiveboxview.Rows.Count - 1; i++)
        {
            CheckBox check = (CheckBox)this.receiveboxview.Rows[i].FindControl("checkdel");
            if (check.Checked == true)
            {
                int r_id = Convert.ToInt32(this.receiveboxview.DataKeys[i].Value.ToString());
                message del_receivebox = new message();
                del_receivebox.del_receivebox(r_id);
            }
        }
        bandreceive();
        Response.Write("<script>alert('删除成功!')</script>");    
        
    }
    protected void receiveboxview_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //鼠标经过时,行背景色变 
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#ECF3E1'");
            //鼠标移出时,行背景色变 
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
        }
    }
    protected void btnimagesend_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("SendMessageBox.aspx"); 
    }
    protected void btnimagereceive_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("ReceiveMessageBox.aspx"); 
    }
    protected void btnimagenew_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("SendMessage.aspx"); 
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -