利用反射来确定变量名
public double GetValueByJp(Model.ta_ReportedData ta, int itemid) { Type type = ta.GetType(); string name = Sun.Extend.PublicQuery.GetItemList().Where(c => c.ID == itemid).FirstOrDefault().jp; PropertyInfo pi = type.GetProperties().FirstOrDefault(x => x.Name == name); return (double)pi.GetValue(ta, null); }