private void BindData() { if (asd.Action == "edit") { string sql = string.Format("select * from OM_PXJH_SQ where PX_BH='{0}'", asd.Pxbh); DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); PanelDic.BindPanel(panJBXX, dt); sql = string.Format("select a.*,b.ST_SEQUEN from OM_PXDA as a left join TBDS_STAFFINFO as b on a.DA_CXRID=b.ST_ID where DA_XMBH='{0}'", asd.Pxbh); DataTable dt1 = DBCallCommon.GetDTUsingSqlText(sql); rptNR.DataSource = dt1; rptNR.DataBind(); NoData(); lb_PX_PJR.Text = asd.Username; lb_PX_PJSJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); } else if (asd.Action == "read") { string sql = string.Format("select * from OM_PXJH_SQ where PX_BH='{0}'", asd.Pxbh); DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); PanelDic.BindPanel(panJBXX, dt); sql = string.Format("select a.*,b.ST_SEQUEN from OM_PXDA as a left join TBDS_STAFFINFO as b on a.DA_CXRID=b.ST_ID where DA_XMBH='{0}'", asd.Pxbh); DataTable dt1 = DBCallCommon.GetDTUsingSqlText(sql); rptNR.DataSource = dt1; rptNR.DataBind(); NoData(); lb_PX_PJR.Text = asd.Username; lb_PX_PJSJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); } PowerControl(); }
private void BindData() { if (asd.action == "add") { lb_HT_ZDR.Text = asd.username; lb_HT_ZDSJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); string sql = "select ST_NAME,ST_ID,ST_POSITION from TBDS_STAFFINFO where ST_POSITION='1001'or ST_POSITION= '0401'or ST_POSITION= '0301'or ST_POSITION= '0102'or ST_POSITION= '0101' and ST_PD='0' order by ST_POSITION desc,ST_ID desc"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); txt_HT_SHR1.Text = dt.Rows[0][0].ToString(); txt_HT_SHR2.Text = dt.Rows[1][0].ToString(); txt_HT_SHR3.Text = dt.Rows[2][0].ToString(); txt_HT_SHR4.Text = dt.Rows[3][0].ToString(); hid_HT_SHR1ID.Value = dt.Rows[0][1].ToString(); hid_HT_SHR2ID.Value = dt.Rows[1][1].ToString(); hid_HT_SHR3ID.Value = dt.Rows[2][1].ToString(); hid_HT_SHR4ID.Value = dt.Rows[3][1].ToString(); hid_HT_ZDRID.Value = asd.userid.ToString(); txt_HT_SHR5.Text = dt.Rows[dt.Rows.Count - 1][0].ToString(); hid_HT_SHR5ID.Value = dt.Rows[dt.Rows.Count - 1][1].ToString(); txt_HT_HTBH.Text = GetHTBH(); DataTable dt1 = new DataTable(); rptSHBXX.DataSource = dt1; rptSHBXX.DataBind(); } if (asd.action == "alter") { string sql = "select * from EQU_GXHT where HT_HTBH='" + asd.id + "'"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); PanelDic.BindPanel(panGXHT, dt); PanelDic.BindPanel(panSP, dt); string sql1 = "select EQU_ID,EQU_Type,EQU_Name,EQU_Unit,EQU_UPrice,EQU_Num,EQU_TMoney,EQU_Note from EQU_GX_Detail where EQU_FATHERID='" + asd.id + "' order by EQU_ID"; DataTable dt1 = DBCallCommon.GetDTUsingSqlText(sql1); rptSHBXX.DataSource = dt1; rptSHBXX.DataBind(); } if (asd.action == "read") { string sql = "select * from EQU_GXHT where HT_HTBH='" + asd.id + "'"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); PanelDic.BindPanel(panGXHT, dt); PanelDic.BindPanel(panSP, dt); string sql1 = "select EQU_ID,EQU_Type,EQU_Name,EQU_Unit,EQU_UPrice,EQU_Num,EQU_TMoney,EQU_Note from EQU_GX_Detail where EQU_FATHERID='" + asd.id + "' order by EQU_ID"; DataTable dt1 = DBCallCommon.GetDTUsingSqlText(sql1); rptSHBXX.DataSource = dt1; rptSHBXX.DataBind(); } if (asd.action == "check") { string sql = "select * from EQU_GXHT where HT_HTBH='" + asd.id + "'"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); PanelDic.BindPanel(panGXHT, dt); PanelDic.BindPanel(panSP, dt); if (asd.userid == dt.Rows[0]["HT_SHR1ID"].ToString()) { lb_HT_SHR1_SJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); } if (asd.userid == dt.Rows[0]["HT_SHR2ID"].ToString()) { lb_HT_SHR2_SJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); } if (asd.userid == dt.Rows[0]["HT_SHR3ID"].ToString()) { lb_HT_SHR3_SJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); } if (asd.userid == dt.Rows[0]["HT_SHR4ID"].ToString()) { lb_HT_SHR4_SJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); } if (asd.userid == dt.Rows[0]["HT_SHR5ID"].ToString()) { lb_HT_SHR5_SJ.Text = DateTime.Now.ToString("yyyy-MM-dd"); } string sql1 = "select EQU_ID,EQU_Type,EQU_Name,EQU_Unit,EQU_UPrice,EQU_Num,EQU_TMoney,EQU_Note from EQU_GX_Detail where EQU_FATHERID='" + asd.id + "' order by EQU_ID"; DataTable dt1 = DBCallCommon.GetDTUsingSqlText(sql1); rptSHBXX.DataSource = dt1; rptSHBXX.DataBind(); } }
//申请单数据绑定 private void binddetail() { string sql = ""; DataTable dt; if (unitparam.action == "add") { lb_E_Code.Text = GetCode(); lb_E_ZDR.Text = unitparam.username; lb_E_ZDRID.Text = unitparam.userid; lb_E_SQRDep.Text = unitparam.depname; lb_E_ZDTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string position = unitparam.depid + "01"; if (unitparam.depid == "15") { //对焊事业部于来义 position = "0301"; } if (unitparam.depid == "08" || unitparam.depid == "09") { position = "0401"; } else if (unitparam.depid == "13") { position = "1001"; } else if (unitparam.depid == "14" || unitparam.depid == "02") { //办公室刘晓静 position = "0210"; } else if (unitparam.depid == "12") { position = "1207"; } else if (unitparam.depid == "03") { position = "0302"; } sql = "select ST_NAME,ST_ID,ST_POSITION from TBDS_STAFFINFO where ST_POSITION='0207'or (ST_POSITION = '" + position + "'and ST_PD='0')"; dt = DBCallCommon.GetDTUsingSqlText(sql); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i][2].ToString() != "0207") { txt_E_SHR.Text = dt.Rows[i][0].ToString(); txt_E_SHRID.Text = dt.Rows[i][1].ToString(); } else { lb_E_Surer.Text = dt.Rows[i][0].ToString(); hid_E_SurerID.Value = dt.Rows[i][1].ToString(); } } } else { sql = "select * from OM_Express where E_Code ='" + unitparam.key + "'"; dt = DBCallCommon.GetDTUsingSqlText(sql); PanelDic.BindPanel(PanelDetail, dt); PanelDic.BindPanel(PanelShenhe, dt); if (dt.Rows[0]["E_Type"].ToString() == "1") { td_wenjian0.Visible = false; td_wenjian1.Visible = false; td_wuping0.Visible = true; td_wuping1.Visible = true; td_wuping2.Visible = true; td_wuping3.Visible = true; txt_E_ItemName.Text = dt.Rows[0]["E_ItemName"].ToString(); txt_E_ItemWeight.Text = dt.Rows[0]["E_ItemWeight"].ToString(); } else { txt_E_FileName.Text = dt.Rows[0]["E_FileName"].ToString(); } if (unitparam.action == "sure") { txt_E_ExpressTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); txt_E_ExpressMoney.Text = ""; } } }