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

📄 admin_examine.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;
using System.Data.SqlClient;


public partial class admin_Examine : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["uname"] != null && Session["role"].ToString() == "1")
        {
            this.btndel.Attributes.Add("onClick", "javascript:return   confirm('确定删除吗?');");
            if (!IsPostBack)
            {

                band();
            }
        }
    }
    private void band()
    {
        message Examine = new message();
        holidayview.DataSource = Examine.sel_holidayMessage();
        holidayview.DataBind();
    }
    protected void sendboxview_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.holidayview.PageIndex = e.NewPageIndex;
        band();
    }
    protected void holidayview_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //if (e.Row.RowType == DataControlRowType.DataRow)
        //{

        //    string aa = e.Row.Cells[9].Text.ToString();
        //    if (aa == "未签收")
        //    {
        //        e.Row.Cells[9].ForeColor = System.Drawing.Color.Red;
        //    }
        //}
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //鼠标经过时,行背景色变 
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#ECF3E1'");
            //鼠标移出时,行背景色变 
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
            DataRowView dv = (DataRowView)e.Row.DataItem;
            if (Convert.ToString(dv["v_status"]) == "不批准")
            {
                ((Label)e.Row.FindControl("lab")).BackColor = System.Drawing.Color.Red;
                ((Label)e.Row.FindControl("lab")).ForeColor = System.Drawing.Color.White;
            }
            if (Convert.ToString(dv["v_status"]) == "批准")
            {
                ((Label)e.Row.FindControl("lab")).BackColor = System.Drawing.Color.Green;
                ((Label)e.Row.FindControl("lab")).ForeColor = System.Drawing.Color.White;
            }
        }
    }
    protected void btndel_Click(object sender, EventArgs e)
    {
        for (int i = 0; i <= this.holidayview.Rows.Count - 1; i++)
        {
            CheckBox check = (CheckBox)this.holidayview.Rows[i].FindControl("checkdel");
            if (check.Checked == true)
            {
                int v_id = Convert.ToInt32(holidayview.DataKeys[i].Value.ToString());
                message del_vacation = new message();
                del_vacation.del_vacation(v_id);
            }
        }
        band();
        Response.Write("<script>alert('删除成功!')</script>");

    }
}

⌨️ 快捷键说明

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