private void FrmBT_Data_Load(object sender, EventArgs e) { List <DeviceInfoModel> modelList = new DeviceInfoBLL().GetModelList(string.Format("IDCardNo = '{0}' order by UpdateData desc", this.IDCardNo)); List <DevRecord> list2 = new List <DevRecord>(); foreach (DeviceInfoModel deviceinfo in modelList) { DevRecord rcd = this.GetRcd(deviceinfo); list2.Add(rcd); } this.dataGridView1.DataSource = list2; }
private DevRecord GetRcd(DeviceInfoModel dev) { string str; DevRecord record = new DevRecord { RcdName = dev.DeviceName, RcdDate = dev.UpdateData }; switch (dev.DeviceType) { case "20": str = string.Format("收缩压{0}mmHg/舒张压{1}mmHg 心率{2}次/分钟", dev.Value1, dev.Value2, dev.Value3); break; case "22": str = string.Format("{0}Kg", dev.Value1); break; case "24": str = dev.Value1 + "mmol/L"; break; case "32": str = string.Format("血氧{0} 脉率{1}", dev.Value1, dev.Value2); break; case "33": str = string.Format("尿胆原{0}潜血{1}胆红素{2}酮体{3}葡萄糖{4}蛋白质{5}PH{6}亚硝酸盐{7}白细胞{8}比重{9}维生素{10}", new object[] { dev.Value1, dev.Value2, dev.Value3, dev.Value4, dev.Value5, dev.Value6, dev.Value7, dev.Value8, dev.Value9, dev.Value10, dev.Value11 }); break; case "35": str = dev.Value1; break; case "40": str = dev.Value1 + "℃"; break; case "98": str = "呼吸频率:" + dev.Value1; break; default: str = dev.Value1; break; } record.RcdResult = str; return(record); }