OATest/Flow/StepBind.aspx.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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

public partial class Flow_StepBind : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataSet ds = new DBoperate().ExecuteQuery("select * from Branch", 0, 0, "branch");

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                DropDownList1.Items.Add(new ListItem(dr["Branch"].ToString(), dr["Dutyid"].ToString()));
            }
            this.DropDownList1.Items.Insert(0, "选择部门....");
            Bind();
            
        }
    }
    public void Bind()
    {
        DataSet dse = new DBoperate().ExecuteQuery("select * from Employee", 0, 0, "employee");
        ListBox1.DataSource = dse.Tables[0];
        ListBox1.DataTextField = "Name";
        ListBox1.DataValueField = "Employeeid";
        ListBox1.DataBind();
        if (Request.QueryString["stepid"] != null)
        {
            string strSql = "select * from Employee where Employeeid in (select UserID from FlowStepPerson where StepID=" + Request.QueryString["stepid"] + ")";
            DataSet dsp = new DBoperate().ExecuteQuery(strSql, 0, 0, "table");
            this.ListBox2.DataSource = dsp.Tables[0];
            this.ListBox2.DataTextField = "Name";
            this.ListBox2.DataValueField = "Employeeid";
            this.ListBox2.DataBind();
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedItem.Text == "选择部门....")
        {
            Bind();
        }
        else
        {
            string Dutyid = DropDownList1.SelectedItem.Value.ToString();
            string sql = "select Name,username from Employee  where dutyid=" + Dutyid + "";

            DataSet ds = new DBoperate().ExecuteQuery(sql, 0, 0, "employee");
            ListBox1.DataSource = ds.Tables[0];
后面还有 78 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。