cancelreq.aspx.cs

来自「人事管理系统」· CS 代码 · 共 62 行

CS
62
字号
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 web_SubmitOvertime_CancelReq : System.Web.UI.Page
{
    string jbbh = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        pnlMakeSure.Visible =false ;
        string strsql = "select * from 员工加班表 where 员工编号='"+Session["EmployeeID"].ToString ()+"'";
        SqlConnection conn = db.mysqll();
        conn.Open ();
        SqlCommand cmd=new SqlCommand (strsql ,conn);
        SqlDataAdapter da = new SqlDataAdapter(strsql,conn);
        DataSet ds = new DataSet();
        da.Fill(ds,"加班申请编号");
        grdResult .DataSource =ds .Tables ["加班申请编号"];
        grdResult.DataBind();
        conn.Close();

    }
    protected void btnYes_Click(object sender, EventArgs e)
    {
        string strsql1 = "delect 员工加班表 where 加班申请编号 ='"+jbbh +"'";
        SqlConnection conn = db.mysqll();
        conn.Open();
        SqlCommand cmd = new SqlCommand(strsql1, conn);
        cmd.ExecuteNonQuery ();
        conn.Close ();
    
    }
    protected void btnNo_Click(object sender, EventArgs e)
    {
        pnlMakeSure.Visible = false;
    }
    protected void grdResult_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void grdResult_ItemCommand(object source, DataGridCommandEventArgs e)
    {
        if (e.CommandName == "Detail")
        {
            lblApproverName.Text =e.Item .Cells [9].Text .ToString ();
            lblReason.Text =e.Item .Cells [10].Text .ToString ();
            jbbh = e.Item.Cells[0].Text.ToString();

        }
        if (e.CommandName == "Cancel") { pnlMakeSure.Visible = true; }

    }
}

⌨️ 快捷键说明

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