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

📄 upload_flow.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 Upload_Flow : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["uname"].ToString() != null)
        {
            if (!IsPostBack)
            {
                staff sf = new staff();
                droppeople.DataSource = sf.sel_staff();
                droppeople.DataTextField = "s_name";
                droppeople.DataValueField = "s_id";
                droppeople.DataBind();
            }
        }
        else
        {
            Response.Redirect("login.aspx");
        }
    }
    protected void droppeople_SelectedIndexChanged1(object sender, EventArgs e)
    {
        this.TRePeople.Text = this.droppeople.SelectedItem.Text.ToString();
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        if (TRePeople.Text.Trim().ToString() != null)
        {
            staff f = new staff();
            SqlDataReader dr = f.sel_staffInfo(Convert.ToInt32(Session["uname"]));
            if (dr.Read())
            {
                if (flow.PostedFile.FileName.ToString() != "")
                {
                    string fullname = flow.PostedFile.FileName.ToString();
                    string filename = fullname.Substring(fullname.LastIndexOf("\\") + 1);
                    ArrayList arr_flow = new ArrayList();
                    arr_flow.Add(Convert.ToInt32(Session["uname"]));
                    arr_flow.Add(dr["s_name"].ToString());
                    arr_flow.Add(droppeople.SelectedValue.ToString());
                    arr_flow.Add(tname.Text.Trim().ToString());
                    arr_flow.Add(filename);
                    arr_flow.Add(tmessage.Text.Trim().ToString());
                    file flows = new file();
                    flows.Insert_Flow(arr_flow);
                    flow.SaveAs(Server.MapPath("Flow") + "\\" + filename);
                    Response.Write("<script>alert('公文已送成功!')</script>");
                }
                else
                {
                    Response.Write("<script>alert('请选择公文文件!')</script>");
                }
            }

        }
        else
        {
            Response.Write("<script>alert('公文接收人不能为空!')</script>");
        }
    }
}

⌨️ 快捷键说明

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