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

📄 addtz.aspx.cs

📁 OA自动化办公系统,就是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 COM.OA.BLL;
using COM.OA.Entity;

public partial class tzManager_addtz : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //从Session中取得信息
        users user = Session["loginuser"] as users;
        //判断信息 如果为空跳回登陆页面
        if (user == null)
        {
            this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
            return;
        }
        if (!IsPostBack)
        {
            this.txtTitle.Focus();
        }
    }

    protected void btnfabu_Click(object sender, EventArgs e)
    {
        users user = Session["loginuser"] as users;                
        //用户id
        int u_id = Int32.Parse(user.u_id.ToString());
        //部门ID
        int dept_id = user.u_dept_id;
        //标题
        string title = this.txtTitle.Text;
        //内容
        string content = this.ftbContent.Text;
        //状态
        int state = 0;
        //阅读次数
        int reads = 0;
        //time
        DateTime time =  DateTime.Parse(DateTime.Now.ToString());
        
        if (title !="")
        {
            if ( content != "")
            {
                sendword sw = new sendword();
                sw.sw_u_id = u_id;
                sw.sw_dept_id = dept_id;
                sw.sw_title = title;
                sw.sw_content = content;
                sw.sw_state = state;
                sw.sw_reads = reads;
                sw.sw_releasetime = time;

                int i = sendwordBLL.Insert(sw);
                if (i < 0)
                {
                    this.Response.Redirect("sendwordindex.aspx");
                }

            }
            else
            {
                this.Response.Write("<script>window.alert ('请您输入内容')</script>");
                this.ftbContent.Focus = true;
            }
        } 
        else
        {
            this.Response.Write("<script>window.alert ('请您输入标题')</script>");
            this.txtTitle.Focus();
        }

    }

    protected void btnselect_Click(object sender, EventArgs e)
    {
        //从页面取值
        string tiaojian = this.txtwhere.Text;
        //放入session
        Session.Add("tiaojian", tiaojian);
        //跳转到查询页面
        this.Response.Write(string.Format(GetRedirect.REDIRECT, "mohuchaxun.aspx"));
    }

    protected void btnquxiao_Click(object sender, EventArgs e)
    {
        //清空文档框,标题栏获得焦点
        this.txtTitle.Text = "";
        this.ftbContent.Text = "";
        this.txtTitle.Focus();
    }
}

⌨️ 快捷键说明

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