protected void Showdata()
        {
            string    st_id   = Request.QueryString["ST_ID"].ToString();//得到修改人员编码
            string    sqlText = "select distinct a.*,b.DEP_NAME,d.DEP_NAME as DEP_POSITION,e.ST_NAME as MANCLERK from TBDS_STAFFINFO as a left join TBDS_DEPINFO as b on a.ST_DEPID=b.DEP_CODE left join TBDS_DEPINFO as d on a.ST_POSITION = d.DEP_CODE left join TBDS_STAFFINFO as e on a.ST_MANCLERK=e.ST_ID where a.ST_ID='" + st_id + "'";
            DataTable dt      = DBCallCommon.GetDTUsingSqlText(sqlText);
            DataRow   dr      = dt.Rows[0];

            foreach (Control lable in Panel1.Controls)
            {
                if (lable is Label)
                {
                    ((Label)lable).Text = dr[((Label)lable).ID.ToString()].ToString();
                }
            }
            sqlText = "select * from TBDS_WORKHIS where ST_ID='" + st_id + "'";
            Det_Repeater.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater.DataBind();
            sqlText = "select * from TBDS_EDUCA where ST_ID='" + st_id + "'";
            Det_Repeater1.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater1.DataBind();
            sqlText = "select * from TBDS_RELATION where ST_ID='" + st_id + "'";
            Det_Repeater2.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater2.DataBind();
            InitVar();
            InitVar1();
            InitVar2();
        }
Exemple #2
0
        private void Showdata()                                                //将数据绑定到textbox
        {
            string    st_id   = Request.QueryString["ST_ID"].ToString();       //得到修改人员编码
            string    data    = Request.QueryString["ST_DATATIME"].ToString(); //得到修改人员编码
            string    sqlText = "select * from View_TBDS_STAFFINFO_record where ST_ID='" + st_id + "' and ST_DATATIME='" + data + "'";
            DataTable dt      = DBCallCommon.GetDTUsingSqlText(sqlText);
            DataRow   dr      = dt.Rows[0];

            foreach (Control control in Panel1.Controls)
            {
                if (control is TextBox)
                {
                    ((TextBox)control).Text = dr[((TextBox)control).ID.ToString()].ToString();
                }
                else if (control is DropDownList)
                {
                    DEP_NAME.ID = "ST_DEPID";
                    ((DropDownList)control).SelectedValue = dr[((DropDownList)control).ID.ToString()].ToString();
                    DEP_NAME.ID = "DEP_NAME";
                }
            }
            string role = dr["R_NAME"].ToString();

            if (!string.IsNullOrEmpty(role))
            {
                string[] roles = role.Split(',');
                string   uRole = "";
                for (int i = 0; i < roles.Length; i++)
                {
                    uRole = roles[i].Substring(1, roles[i].Length - 2);
                    for (int j = 0; j < chk_Role.Items.Count; j++)
                    {
                        if (uRole == chk_Role.Items[j].Text)
                        {
                            chk_Role.Items[j].Selected = true;
                        }
                    }
                }
            }


            Ddl_Post();
            DEP_POSITION.SelectedValue = dr["ST_POSITION"].ToString();
            showImage.ImageUrl         = "~/staff_images/" + dr["JPGURL"].ToString();
            sqlText = "select * from TBDS_WORKHIS where ST_ID='" + st_id + "'";
            Det_Repeater.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater.DataBind();
            sqlText = "select * from TBDS_EDUCA where ST_ID='" + st_id + "'";
            Det_Repeater1.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater1.DataBind();
            sqlText = "select * from TBDS_RELATION where ST_ID='" + st_id + "'";
            Det_Repeater2.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater2.DataBind();
            InitVar();
            InitVar1();
            InitVar2();
        }
Exemple #3
0
        private void Showdata()                                          //将数据绑定到textbox
        {
            string    st_id   = Request.QueryString["ST_ID"].ToString(); //得到修改人员编码
            string    sqlText = "select distinct a.*,b.DEP_NAME,d.DEP_NAME as DEP_POSITION from TBDS_STAFFINFO as a left join TBDS_DEPINFO as b on a.ST_DEPID=b.DEP_CODE left join TBDS_DEPINFO as d on a.ST_POSITION = d.DEP_CODE where ST_ID='" + st_id + "'";
            DataTable dt      = DBCallCommon.GetDTUsingSqlText(sqlText);
            DataRow   dr      = dt.Rows[0];

            //绑定文件

            if (dt.Rows[0]["ST_WENJIAN"].ToString() != "")
            {
                Hidden.Value = dt.Rows[0]["ST_WENJIAN"].ToString();
            }
            foreach (Control control in Panel1.Controls)
            {
                if (control is TextBox)
                {
                    ((TextBox)control).Text = dr[((TextBox)control).ID.ToString()].ToString();
                }
                else if (control is DropDownList)
                {
                    DEP_NAME.ID = "ST_DEPID";
                    ((DropDownList)control).SelectedValue = dr[((DropDownList)control).ID.ToString()].ToString();
                    DEP_NAME.ID = "DEP_NAME";
                }
            }
            string role = dr["R_NAME"].ToString();

            if (!string.IsNullOrEmpty(role))
            {
                string[] roles = role.Split(',');
                string   uRole = "";
                for (int i = 0; i < roles.Length; i++)
                {
                    uRole = roles[i].Substring(1, roles[i].Length - 2);
                    for (int j = 0; j < chk_Role.Items.Count; j++)
                    {
                        if (uRole == chk_Role.Items[j].Text)
                        {
                            chk_Role.Items[j].Selected = true;
                        }
                    }
                }
            }


            Ddl_Post();
            DEP_POSITION.SelectedValue = dr["ST_POSITION"].ToString();
            showImage.ImageUrl         = "~/staff_images/" + dr["JPGURL"].ToString();
            sqlText = "select * from TBDS_WORKHIS where ST_ID='" + st_id + "'";
            Det_Repeater.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater.DataBind();
            sqlText = "select * from TBDS_EDUCA where ST_ID='" + st_id + "'";
            Det_Repeater1.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater1.DataBind();
            sqlText = "select * from TBDS_RELATION where ST_ID='" + st_id + "'";
            Det_Repeater2.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater2.DataBind();
            sqlText = "select * from OM_RenYuanDiaoDong where MOVE_PERNAME='" + ST_NAME.Text + "' and MOVE_STATE=MOVE_AUTH_RATING";
            Det_Repeater3.DataSource = DBCallCommon.GetDTUsingSqlText(sqlText);
            Det_Repeater3.DataBind();
            InitVar();
            InitVar1();
            InitVar2();
            InitVar3();
        }