发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
/// <summary>
/// 返回指标的显示效果
/// </summary>
/// <param name="oKPIEDetailID">指标编号</param>
/// <param name="osShowType">指标类型</param>
/// <param name="osValue">指标的默认数据</param>
/// <returns>HTML显示效果</returns>
protected string SwayShowDetail(object oKPIEDetailID, object osShowType, object osValue)
{
string KPIEDetailID, sShowType, sValue;
KPIEDetailID = oKPIEDetailID.ToString();
sShowType = osShowType.ToString();
sValue = osValue.ToString();
string sReturn = string.Empty;
string[] sZ; //分组数据
string sTmp, sID, sID1; //临时变量 控件Name,ID
if (sShowType.ToUpper() == "R")
{
sValue = sValue.Trim(sDefaultSplit.ToCharArray());
sZ = sValue.Split(sDefaultSplit.ToCharArray());
for (int i = 0; i < sZ.Length; i++)
{
sID = sKpiInputName + sKpiInputSplit + KPIEDetailID;
sID1 = sID + sKpiInputSplit + i.ToString();
if (i == 0)
{
//第一个需要选择上
sTmp = "<input id=\"" + sID1 + "\" type=\"radio\" name=\"" + sID + "\" value=\"" + sZ[i] + "\" checked=\"checked\">";
}
else
{
sTmp = "<input id=\"" + sID1 + "\" type=\"radio\" name=\"" + sID + "\" value=\"" + sZ[i] + "\" >";
}
sTmp += "<label for=\"" + sID1 + "\">" + sZ[i] + "</label> " + KPI_FILEENTER;
sReturn += sTmp;
}
}
else if (sShowType.ToUpper() == "S")
{
sValue = sValue.Trim(sDefaultSplit.ToCharArray());
sZ = sValue.Split(sDefaultSplit.ToCharArray());
for (int i = 0; i < sZ.Length; i++)
{
sTmp = "<option value=\"" + sZ[i] + "\">" + sZ[i] + "</option>" + KPI_FILEENTER;
sReturn += sTmp;
}
sID= sKpiInputName + sKpiInputSplit + KPIEDetailID;
sReturn = "<select name=\"" + sID + "\" id=\"" + sID + "\" style=\"width:128px;\">" + sReturn + "</select>" + KPI_FILEENTER;
}
else
{
sID = sKpiInputName + sKpiInputSplit + KPIEDetailID;
sReturn = "<input name=\"txtName\"" + sID + "' type=\"text\" value=\"" + sValue.ToString() + "\">";
}
return sReturn;
}
/// <summary>
/// 取得指标的状态
/// </summary>
/// <param name="sState"></param>
/// <returns></returns>
protected string SwayGetDGState(object sState)
{
//分组指标的状态0禁止状态 1 第一步骤 2 第二步骤 3 完成状态,可以投入使用
string state="";
state = sState.ToString();
switch (state)
{
case "0":
state = "<font color=\"#EEEEEE\">禁止状态</font>";
break;
case "1":
state = "<font color=\"#0000FF\">第一步骤</font>";
break;
case "2":
state = "<font color=\"#00FF00\">第二步骤</font>";
break;
case "3":
state = "<font color=\"#000000\">正常状态</font>";
break;
default:
state = "<font color=\"#FF0000\">错误状态</font>";
break;
}
return state;
}
/// <summary>
/// 循环的把信息增加到指定的DropDownList上
/// </summary>
/// <param name="drp"></param>
/// <param name="ds"></param>
/// <param name="sID"></param>
/// <param name="iDepth"></param>
public void SwayInitDrpFor(ref DropDownList drp, DataSet ds, string sID, int iDepth)
{
string sTmp, sNPID, sAD;
DataRow[] dr;
ListItem lst;
dr = ds.Tables[0].Select("DepT_AdScript=" + sID);
for (int i = 0; i < dr.Length; i++)
{
sTmp = IsDBNull(dr[i]["DeptName"]);
sNPID = IsDBNull(dr[i]["DepTcode"]);
lst = new ListItem();
sAD = "";
for (int j = 0; j < iDepth; j++)
{
if (j == 0)
{
sAD += "┖";
}
else
{
sAD += "─";
}
}
lst.Text = sAD + sTmp;
lst.Value = sNPID;
drp.Items.Add(lst);
SwayInitDrpFor(ref drp, ds, sNPID, iDepth + 1);
}
}
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。