Пример #1
0
        private void Bind()
        {
            string sql1 = "select * from Appurtenance ";

            this.GridView1.DataSource = OperateDB.ExecuteDataSet(sql1);
            this.GridView1.DataBind();
        }
Пример #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string sql = "select * from Employee";

            if (DropDownList1.SelectedItem.Text == "全部" && TextBox1.Text == "")
            {
                return;
            }
            else
            {
                if (DropDownList1.SelectedItem.Text != "全部" && TextBox1.Text == "")
                {
                    sql = "select * from Employee where branch='" + DropDownList1.SelectedItem.Text + "' ";
                }
                if (DropDownList1.SelectedItem.Text == "全部" && TextBox1.Text != "")
                {
                    sql = "select * from Employee where name like('%" + this.TextBox1.Text + "%')";
                }
                if (DropDownList1.SelectedItem.Text != "全部" && TextBox1.Text != "")
                {
                    sql = "select * from Employee where branch='" + DropDownList1.SelectedItem.Text + "' and name like('%" + this.TextBox1.Text + "%') ";
                }
                dt1.DataSource = OperateDB.ExecuteDataSet(sql);

                dt1.DataBind();
            }
        }
Пример #3
0
        public void Bind()
        {
            string sql = "select * from grouping where username='******'";

            dt1.DataSource = OperateDB.ExecuteDataSet(sql);
            dt1.DataBind();
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
                con.Open();
                string sql = "select * from Branch";
                SqlCommand com = new SqlCommand(sql, con);
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    DropDownList1.Items.Add(new ListItem(dr["Branch"].ToString(), dr["Dutyid"].ToString()));
                }
                DropDownList1.Items.Insert(0, "选择部门....");

                con.Close();



                
                string sql1 = "select * from Employee";

                ListBox1.DataSource = OperateDB.ExecuteDataSet(sql1);
                ListBox1.DataTextField = "Name";
                ListBox1.DataValueField = "username";
                ListBox1.DataBind();
            }
        }
Пример #5
0
    public void Bind()
    {
        DataSet ds     = new DataSet();
        string  strsql = "select * from LoginInfo ORDER BY loginid DESC";

        ds = OperateDB.ExecuteDataSet(strsql);
        DataTable dt = new DataTable();

        dt = ds.Tables[0];
        DataColumn dc = dt.Columns.Add("number", System.Type.GetType("System.String"));

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["number"] = (i + 1).ToString();
        }

        DataView        dv  = ds.Tables[0].DefaultView;
        PagedDataSource pds = new PagedDataSource();

        AspNetPager1.RecordCount  = dv.Count;
        pds.DataSource            = dv;
        pds.AllowPaging           = true;
        pds.CurrentPageIndex      = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize              = AspNetPager1.PageSize;
        this.GridView1.DataSource = pds;
        this.GridView1.DataBind();
    }
Пример #6
0
        public void Bind()
        {
            string sql = "select * from FlowType";

            this.GridView1.DataSource = OperateDB.ExecuteDataSet(sql).Tables[0];
            this.GridView1.DataBind();
        }
Пример #7
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     if (Request.Form["ctl00$ContentPlaceHolder1$calendar1"] == "" || Request.Form["ctl00$ContentPlaceHolder1$calendar2"] == "")
     {
         Bind(getsql());
     }
     else
     {
         DateTime FD = Convert.ToDateTime(Request.Form["ctl00$ContentPlaceHolder1$calendar1"]);
         DateTime TD = Convert.ToDateTime(Request.Form["ctl00$ContentPlaceHolder1$calendar2"]);
         if (this.DropDownList1.SelectedIndex == 0 || DropDownList1.SelectedIndex == 1)
         {
             this.DataList2.DataSource = OperateDB.ExecuteDataSet(getsql(FD, TD, true));
             this.DataList2.DataBind();
             DataList2.Visible = true;
             DataList1.Visible = false;
         }
         else if (DropDownList1.SelectedIndex == 2)
         {
             this.DataList1.DataSource = OperateDB.ExecuteDataSet(getsql(FD, TD, false));
             this.DataList1.DataBind();
             DataList2.Visible = false;
             DataList1.Visible = true;
         }
     }
 }
Пример #8
0
        public void Bind()
        {
            string sql = "select * from Employee";

            dt1.DataSource = OperateDB.ExecuteDataSet(sql);
            dt1.DataBind();
        }
Пример #9
0
        private void Bind()
        {
            string sql = "select News.NewsID,News.title,NewsType.Type,News.pubdate,News.content from News,NewsType where News.TypeId=NewsType.NTID ";

            dt1.DataSource = OperateDB.ExecuteDataSet(sql);
            dt1.DataBind();
        }
Пример #10
0
        private void Bind()
        {
            string sql = "select * from [Plan] where username='******'";

            this.dtlst.DataSource = OperateDB.ExecuteDataSet(sql);
            this.dtlst.DataBind();
        }
Пример #11
0
        public void Bind()
        {
            string sql = "select * from FlowStep where FlowID=" + Request.QueryString["id"].ToString() + " order by Num";

            GridView1.DataSource = OperateDB.ExecuteDataSet(sql);

            GridView1.DataBind();
        }
Пример #12
0
        public void Bind()
        {
            string Name = SelectName();
            string sql  = "select  * from Meeting where Personnel='" + Name + "'  order by AddTime desc";

            dtlst.DataSource = OperateDB.ExecuteDataSet(sql);
            dtlst.DataBind();
        }
Пример #13
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            DateTime starttime = Convert.ToDateTime(this.calendar1.Text);
            DateTime endtime   = Convert.ToDateTime(this.calendar2.Text);
            string   sql       = "select * from [Plan] where addtime between '" + starttime + "' and'" + endtime + "' and username='******'";

            this.dtlst.DataSource = OperateDB.ExecuteDataSet(sql);
            this.dtlst.DataBind();
        }
Пример #14
0
        private void Bind()
        {
            string sql = "select * from OutRegister where username='******'";

            this.dt1.DataSource = OperateDB.ExecuteDataSet(sql);
            dt1.DataBind();
            string strsql = "select OutRegisterid from OutRegister where ReturnTime='未归' and username='******'";

            id = Convert.ToInt32(OperateDB.getExecuteScalar(strsql));
        }
Пример #15
0
        private void BindAction()
        {
            string  strSql = "select * from FlowAction";
            DataSet ds     = OperateDB.ExecuteDataSet(strSql);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                this.drpAction.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
            }
        }
Пример #16
0
        private void Bind()
        {
            string sql = "select * from Leave where username='******'";

            this.dt1.DataSource = OperateDB.ExecuteDataSet(sql);
            dt1.DataBind();
            string strsql = "select LeaveID from Leave where retrue='未回'";

            id = Convert.ToInt32(OperateDB.getExecuteScalar(strsql));
        }
Пример #17
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            DateTime FD   = Convert.ToDateTime(this.calendar1.Text);
            DateTime TD   = Convert.ToDateTime(this.calendar2.Text);
            string   Name = SelectName();
            string   sql  = "select * from Meeting where addtime between '" + FD + "' and '" + TD + "' and Personnel='" + Name + "' order by AddTime desc ";

            dtlst.DataSource = OperateDB.ExecuteDataSet(sql);
            dtlst.DataBind();
        }
Пример #18
0
        private void Bind()
        {
            string UserName = Session["UserName"].ToString();
            string sql      = "select id from UserInfo where UserName='******'";
            int    id       = Convert.ToInt32(OperateDB.getExecuteScalar(sql));
            string sql1     = "select * from Calendar where id=" + id + " order by CalendarID desc";

            this.dt1.DataSource = OperateDB.ExecuteDataSet(sql1);
            this.dt1.DataBind();
        }
Пример #19
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string Dutyid = DropDownList1.SelectedItem.Value.ToString();

            string sql = "select Name,username from Employee  where dutyid=" + Dutyid + "";

            ListBox1.DataSource = OperateDB.ExecuteDataSet(sql);
            ListBox1.DataTextField = "Name";
            ListBox1.DataValueField = "username";
            ListBox1.DataBind();
        }
Пример #20
0
 protected void drpFltype_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (drpFltype.SelectedIndex != 0)
     {
         string type = this.drpFltype.SelectedItem.Value;
         string sql  = "select * from Flow where TypeID=" + Convert.ToInt32(type);
         this.drpFlow.DataSource     = OperateDB.ExecuteDataSet(sql).Tables[0];
         this.drpFlow.DataTextField  = "Name";
         this.drpFlow.DataValueField = "ID";
         this.drpFlow.DataBind();
     }
 }
Пример #21
0
        public string getPerson(string id)
        {
            string  person = null;
            string  strSql = "select Name from Employee where Employeeid in (select UserID from FlowStepPerson where StepID=" + Convert.ToInt32(id) + ")";
            DataSet ds     = OperateDB.ExecuteDataSet(strSql);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                person += dr["Name"].ToString();
                person += ";";
            }
            return(person);
        }
Пример #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string  strSql = "select * from Branch";
         DataSet ds     = OperateDB.ExecuteDataSet(strSql);
         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();
     }
 }
Пример #23
0
 protected void btnFind_Click(object sender, EventArgs e)
 {
     if (this.drpType.SelectedItem.Text == "请选择")
     {
         Bind();
     }
     else
     {
         string type = this.drpType.SelectedItem.Value.ToString();
         string sql  = "select * from Flow where IsFix=1 and TypeID=" + type;
         this.GridView1.DataSource = OperateDB.ExecuteDataSet(sql).Tables[0];
         this.GridView1.DataBind();
     }
 }
Пример #24
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            int stepid = Convert.ToInt32(Request.QueryString["stepid"]);

            for (int i = 0; i < this.ListBox2.Items.Count; i++)
            {
                string strSql = "select * from FlowStepPerson where UserID=" + ListBox2.Items[i].Value + " and StepID=" + stepid;
                if (OperateDB.ExecuteDataSet(strSql).Tables[0].Rows.Count < 1)
                {
                    string sql = "insert into FlowStepPerson values(" + stepid + "," + ListBox2.Items[i].Value + ",0,0)";
                    if (OperateDB.ExecuteNonQuery(sql) > 0)
                    {
                        Response.Write("<script >window.location.href='FlowStep.aspx?id=" + Request.QueryString["flowid"].ToString() + "'</script>");
                    }
                }
            }
        }
Пример #25
0
        public void Bind()
        {
            Sqlselete ss  = new Sqlselete();
            DataSet   dsa = ss.SelectEmp("");

            ListBox1.DataSource     = dsa.Tables[0];
            ListBox1.DataTextField  = "Name";
            ListBox1.DataValueField = "Employeeid";
            ListBox1.DataBind();

            string strSql1 = "select * from Employee where Employeeid in (select UserID from FlowStepPerson where StepID=" + Request.QueryString["stepid"] + ")";


            this.ListBox2.DataSource     = OperateDB.ExecuteDataSet(strSql1).Tables[0];
            this.ListBox2.DataTextField  = "Name";
            this.ListBox2.DataValueField = "Employeeid";
            this.ListBox2.DataBind();
        }
Пример #26
0
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string  id  = this.GridView1.DataKeys[this.GridView1.SelectedIndex]["ID"].ToString();
            string  sql = "select * from Flow where ID=" + id;
            DataSet ds  = OperateDB.ExecuteDataSet(sql);

            this.panel2.Visible  = true;
            this.Button2.Visible = false;
            this.Button1.Visible = true;
            //DataSet ds = new DBoperate().ExecuteQuery("select * from FlowType", 0, 0, "table1");
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                this.flowname.Text          = dr["Name"].ToString();
                this.flowtype.SelectedValue = dr["TypeID"].ToString();
                //this.flowtype.SelectedItem.Value = dr["TypeID"].ToString();
                this.flowcontent.Text = dr["Des"].ToString();
            }
        }
Пример #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GridView1.SelectedIndexChanged += new EventHandler(GridView1_SelectedIndexChanged);
            if (!Page.IsPostBack)
            {
                string  sql = "select * from FlowType";
                DataSet ds  = OperateDB.ExecuteDataSet(sql);

                //DataSet ds = new DBoperate().ExecuteQuery("select * from FlowType", 0, 0, "table1");
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    this.drpType.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                    this.flowtype.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }
                this.drpType.Items.Insert(0, "请选择");
                Bind();
                this.panel2.Visible = false;
            }
        }
Пример #28
0
        public void Bind(string sql)
        {
            DataSet ds = OperateDB.ExecuteDataSet(sql);

            if (this.DropDownList1.SelectedIndex == 0 || DropDownList1.SelectedIndex == 1)
            {
                this.DataList2.DataSource = ds;
                this.DataList2.DataBind();
                DataList2.Visible = true;
                DataList1.Visible = false;
            }
            else if (DropDownList1.SelectedIndex == 2)
            {
                this.DataList1.DataSource = ds;
                this.DataList1.DataBind();
                DataList2.Visible = false;
                DataList1.Visible = true;
            }
        }
Пример #29
0
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //this.GridView1.DataKeys[this.GridView1.SelectedIndex]["flowid"].ToString()
            this.panel.Visible = true;

            Button3.Visible = true;
            Button1.Visible = false;
            BindAction();
            string  sql = "select * from FlowStep where ID=" + this.GridView1.DataKeys[this.GridView1.SelectedIndex][0].ToString();
            DataSet ds  = OperateDB.ExecuteDataSet(sql);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                this.txtNum.Text             = dr["Num"].ToString();
                this.txtDes.Text             = dr["Des"].ToString();
                this.drpAction.SelectedValue = dr["ActionID"].ToString();
                this.drpEnd.SelectedValue    = dr["isEnd"].ToString();
                this.drpJoin.SelectedValue   = dr["isJoin"].ToString();
            }
        }
Пример #30
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string sql;

            if (DropDownList1.SelectedItem.Value.ToString() == "全部")
            {
                sql = "select News.NewsID,News.title,NewsType.Type,News.pubdate,News.content from News,NewsType where News.TypeId=NewsType.NTID ";
            }
            else
            {
                sql = string.Format(@"select News.NewsID,News.title,NewsType.Type,News.pubdate,News.content 
from News,NewsType where News.TypeId=NewsType.NTID and TypeId={0}", DropDownList1.SelectedItem.Value);
            }
            try
            {
                dt1.DataSource = OperateDB.ExecuteDataSet(sql);
                dt1.DataBind();
            }
            catch
            {
                Response.Write("<script>alert('未知的错误')</script>");
            }
        }