private void getadd( ) {
YJ.Model.UserInfo user = new YJ.BLL.User().GetUserByCId(1);
Type type = user.GetType();
PropertyInfo[] propertyInfo = type.GetProperties();
string[] fields = "c_name,c_typeid,pa_id,pt_id,c_phone,c_tel,c_bustel,c_email,c_fax,c_link,c_qq,c_address,c_web,c_info,c_auspice,c_demand,c_pic".Split(',');
int v = 0;
int len = fields.Length;
foreach (var p in propertyInfo)
{
object value = p.GetValue(user, null);
foreach (string field in fields)
{
if (p.Name == field && value != null && value.ToString() != "")
{
v++;
break;
}
}
}
string rate = Math.Round(v * 100.0 / len, 0).ToString();
}
YJ.Model.UserInfo user = new YJ.BLL.User().GetUserByCId(1);
Type type = user.GetType();
PropertyInfo[] propertyInfo = type.GetProperties();
string[] fields = "c_name,c_typeid,pa_id,pt_id,c_phone,c_tel,c_bustel,c_email,c_fax,c_link,c_qq,c_address,c_web,c_info,c_auspice,c_demand,c_pic".Split(',');
int v = 0;
int len = fields.Length;
foreach (var p in propertyInfo)
{
object value = p.GetValue(user, null);
foreach (string field in fields)
{
if (p.Name == field && value != null && value.ToString() != "")
{
v++;
break;
}
}
}
string rate = Math.Round(v * 100.0 / len, 0).ToString();
}