for (int i = 0; i
< ds.Tables[0].Rows.Count; i++)
{
Coolite.Ext.Web.NumberField nf = new NumberField();
nf.ID = ds.Tables[0].Rows[i]["id"].ToString();
nf.AllowBlank = false;
CReadWriteXML cw = new
CReadWriteXML(int.Parse(ds.Tables[0].Rows[i]["人员编号"].ToString()),
int.Parse(nf.ID));
float total =
float.Parse(cw.ReadIDTotal());
Coolite.Ext.Web.PropertyGridParameter cp = new
PropertyGridParameter();
// cp.Params.Add(new
Coolite.Ext.Web.Parameter());
cp.Name =
string.Format("{0}({1}{2}{3})", ds.Tables[0].Rows[i]["分解指标"].ToString(),
ChangeLogtic(ds.Tables[0].Rows[i]["目标值逻辑"].ToString()),
ds.Tables[0].Rows[i]["目标值"].ToString(),
ds.Tables[0].Rows[i]["目标值单位"].ToString());
cp.Encode =
true;
cp.Value = total.ToString();
cp.Mode = ParameterMode.Raw;
target tr = new
target();
tr.name = cp.Name;
tr.id = nf.ID;
Coolite.Ext.Web.ToolTip tp = new ToolTip();
tp.Html = "已完成:" +
total.ToString();
string
sf=ds.Tables[0].Rows[i]["目标值逻辑"].ToString();
switch
(sf)
{
case "equal":
{
if (total ==
float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;
}
case "morethan":
{
if (total > float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;
}
case "morethanequel":
{
if (total >=
float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;
}
case "lessthan":
{
if (total <
float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;
}
case "lessthanequel":
{
if (total <= float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;
}
case "notequel":
{
if (total != float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;
}
default: tp.Icon = Icon.Error; break;
}
li.Add(tr);
nf.ToolTips.Add(tp);
cp.Editor.Clear();
cp.Editor.Add(nf);
Mark.Source.Add(cp);
}
Mark.SetSource(Mark.Source);
}