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

📄 dd_edit.aspx.cs

📁 OA系统,数据库为SQLSever 。net c#
💻 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 DepartmentDecision_DD_Edit : System.Web.UI.Page
{
    WebService webService = new WebService();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null || Session["UserLevel"] == null)
        {
            Response.Redirect("~/Error.aspx");
        }
        if (Session["UserLevel"].ToString() != "部门经理"&&Session["UserLevel"].ToString()!="职员")
        {
            Response.Redirect("~/Error.aspx");
        }
        if (!Page.IsPostBack)
        {
            this.tbContent.Style.Add("OverFlow", "hidden");
            string strID = Request.QueryString["ddid"];
            string strSql = "SELECT z_Department.Dept_Name,z_DepartmentDecision.DD_AddPersonID, z_DepartmentDecision.DD_AddDate, z_DepartmentDecision.DD_Content, z_DepartmentDecision.DD_Title, z_Person.Person_RealName, z_DepartmentDecision.DD_ID FROM z_Department INNER JOIN z_DepartmentDecision ON z_Department.Dept_ID = z_DepartmentDecision.Dept_ID INNER JOIN z_Person ON z_DepartmentDecision.DD_AddPersonID = z_Person.Person_ID WHERE z_DepartmentDecision.DD_ID = '" + strID + "';";
            DataTable table = webService.ExcuteSelect(strSql);
            if (table.Rows[0]["DD_AddPersonID"].ToString() != Session["UserID"].ToString())
            {
                Response.Redirect("~/Error.aspx");
            }
            this.tbTitle.Text = table.Rows[0]["DD_Title"].ToString();
            this.tbContent.Text = table.Rows[0]["DD_Content"].ToString();
            this.lblDept.Text = table.Rows[0]["Dept_Name"].ToString();
            this.lblMsg.Text = "未审核的新决策草案不能立即实行!";
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string strSql;
        if (this.tbTitle.Text == "" || this.tbContent.Text == "")
        {
            this.lblMsg.Text = "请填写完整的信息!";
        }
        else
        {
            string strTitle = this.tbTitle.Text;
            string strContent = this.tbContent.Text;
            if (this.CheckBox1.Checked)
            {
                strSql = "Update z_DepartmentDecision set DD_Title='" + strTitle + "',DD_Content='" + strContent + "',DD_IsConfirm='1',DD_ConfirmDate='" + DateTime.Now + "',DD_AddDate='" + DateTime.Now + "' where DD_ID='" + Request.QueryString["ddid"] + "';";
            }
            else
                strSql = "Update z_DepartmentDecision set DD_Title='" + strTitle + "',DD_Content='" + strContent + "',DD_AddDate='" + DateTime.Now + "' where DD_ID='" + Request.QueryString["ddid"] + "';";
            webService.ExcuteSql(strSql);
            Response.Redirect("DD_List3.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string strSql = "Delete from z_DepartmentDecision where DD_ID='" + Request.QueryString["ddid"] + "';";
        webService.ExcuteSql(strSql);
        Response.Redirect("DD_List3.aspx");
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        Response.Redirect("DD_List3.aspx");
    }
}

⌨️ 快捷键说明

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