private void BindDropdownList() { string sql = "select DEP_CODE,DEP_NAME from TBDS_DEPINFO where DEP_FATHERID=0"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); ddlBM.Items.Add(new ListItem("-全部-", "0")); for (int i = 0, length = dt.Rows.Count; i < length; i++) { ddlBM.Items.Add(new ListItem(dt.Rows[i]["DEP_NAME"].ToString(), dt.Rows[i]["DEP_CODE"].ToString())); } //年 sql = "select distinct(substring(PZ_RQ,1,4)) as NIAN from OM_RYPZ_JL "; DBCallCommon.BindDDLData(ddlYear, sql, "NIAN", "NIAN"); //月 sql = "select distinct(substring(PZ_RQ,6,7)) as YUE from OM_RYPZ_JL"; DBCallCommon.BindDDLData(ddlMonth, sql, "YUE", "YUE"); }
private void BindRbl() { string sql; DataTable dt; if (Session["POSITION"].ToString() == "0701") { sql = "select count(CLD_ID) from CM_SHCLD where (CLD_CLFA_TXR='' or CLD_CLFA_TXR is null) and CLD_SPZT='1y' and (CLD_CLYJ !='' and CLD_CLYJ is not null) "; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[2].Text = string.Format("处理方案待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); } else if (Session["POSITION"].ToString() == "0301" || Session["UserID"].ToString() == "67" || Session["POSITION"].ToString() == "1207" || Session["UserID"].ToString() == "69") { sql = "select count(CLD_ID) from CM_SHCLD where (CLD_CLYJ_TXR='' or CLD_CLYJ_TXR is null) and CLD_SPZT='1y' and (CLD_YYFX !='' and CLD_YYFX is not null)"; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[1].Text = string.Format("处理意见待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); sql = "select count(CLD_ID) from CM_SHCLD where (CLD_CLJG_TXR='' or CLD_CLJG_TXR is null) and CLD_SPZT='y' and (CLD_FZBM like '%技术部%' ) "; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[3].Text = string.Format("处理结果待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); } else if (Session["POSITION"].ToString() == "0301" || Session["POSITION"].ToString() == "1205" || Session["POSITION"].ToString() == "1207") { sql = "select count(CLD_ID) from CM_SHCLD where (CLD_YYFX_TXR='' or CLD_YYFX_TXR is null) and CLD_SPZT='1y'"; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[0].Text = string.Format("原因分析待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); sql = "select count(CLD_ID) from CM_SHCLD where (CLD_CLJG_TXR='' or CLD_CLJG_TXR is null) and CLD_SPZT='y' and ( CLD_FZBM like '%质量部%') "; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[3].Text = string.Format("处理结果待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); } else if (Session["POSITION"].ToString() == "0401") { sql = "select count(CLD_ID) from CM_SHCLD where (CLD_CLJG_TXR='' or CLD_CLJG_TXR is null) and CLD_SPZT='y' and (CLD_FZBM like '%生产部%') "; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[3].Text = string.Format("处理结果待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); } else if (Session["POSITION"].ToString() == "0501") { sql = "select count(CLD_ID) from CM_SHCLD where (CLD_CLJG_TXR='' or CLD_CLJG_TXR is null) and CLD_SPZT='y' and (CLD_FZBM like '%采购部%') "; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[3].Text = string.Format("处理结果待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); } else if (Session["POSITION"].ToString() == "0601") { sql = "select count(CLD_ID) from CM_SHCLD where (CLD_FWFY_TJR='' or CLD_FWFY_TJR is null) and (CLD_SPZT='cljg_y')"; dt = DBCallCommon.GetDTUsingSqlText(sql); rblRW.Items[4].Text = string.Format("服务费用待分工(<font color='red'>{0}</font>)", dt.Rows[0][0].ToString()); } if (username == "曹卫亮" || username == "李小婷") { sql = string.Format("select ST_NAME,ST_ID from TBDS_STAFFINFO where ST_DEPID in ('03') and ST_PD='0'"); } if (username == "曹卫亮" || username == "陈永秀") { sql = string.Format("select ST_NAME,ST_ID from TBDS_STAFFINFO where (ST_DEPID in ('12') and ST_PD='0') or ( r_name like '%质量通用角色%' and ST_PD='0')"); } else { sql = string.Format("select ST_NAME,ST_ID from TBDS_STAFFINFO where ST_PD='0' and ST_DEPID='{0}'", depid); } DBCallCommon.BindDDLData(ddlName, sql, "ST_NAME", "ST_NAME"); }