private string makeintro(view_INSTRUMENT instrument) { string instruIntroduce = ""; instruIntroduce = "仪器编号:" + instrument.InstruCode + " / 单位编号:" + instrument.Instrument; if (!string.IsNullOrEmpty(instrument.SPECTYPE)) { instruIntroduce += " / 型号" + instrument.SPECTYPE; } UnitInfo iunit = UnitInfo.GetUnitInfo(instrument.WorkingforUnitId); if (iunit != null) { instruIntroduce += " / 所属单位:" + iunit.UnitName; } Lab ilab = Lab.Load(instrument.LaboratoryId); if (ilab != null) { instruIntroduce += " / 所属实验室:" + ilab.Name; } try { int ClassCodeid = int.Parse(instrument.CLASSCODE); CLASSCODE classcode = CLASSCODE.Load(ClassCodeid); if (classcode != null) { instruIntroduce += " / 仪器类型:" + classcode.Name; } } catch { } instruIntroduce += " / 购置日期:" + instrument.PURCHASEDATE.ToString("yy-MM-dd"); instruIntroduce += " / 仪器价值:" + instrument.VALUERMB + "万"; instruIntroduce += (!string.IsNullOrEmpty(instrument.MANUFACTURE) ? " / 生产商:" + instrument.MANUFACTURE : ""); switch (instrument.WorkState) { case 1: instruIntroduce += " / 运行状态:正常"; break; case 2: instruIntroduce += " / 运行状态:偶然有故障"; break; case 3: instruIntroduce += " / 运行状态:故障频繁"; break; case 4: instruIntroduce += " / 运行状态:待修"; break; case 5: instruIntroduce += " / 运行状态:修理中"; break; case 6: instruIntroduce += " / 运行状态:待报废"; break; } switch (instrument.UseState) { case 1: instruIntroduce += " / 使用状态:在用"; break; case 2: instruIntroduce += " / 使用状态:出租"; break; case 3: instruIntroduce += " / 使用状态:闲置"; break; } return instruIntroduce; }
private string makeintro(view_INSTRUMENT instrument) { string instruIntroduce = ""; UnitInfo iunit = UnitInfo.GetUnitInfo(instrument.WorkingforUnitId); if (iunit != null) { string strLink = "/Subcenter/SubCenterFP.aspx?SUBID=" + iunit.Id.ToString(); if (iunit.IsCooperantUnit == 2) { strLink = "/Subcenter/SubCenter.aspx?SUBID=" + iunit.Id.ToString(); } instruIntroduce += "所属单位: <span style='font-weight:bold'><a style='color:black' href='" + strLink + "' target='_blank' >" + iunit.UnitName + "</a></span>"; } instruIntroduce += " /仪器编号:" + instrument.InstruCode; if (!string.IsNullOrEmpty(instrument.SPECTYPE)) { instruIntroduce += " / 型号" + instrument.SPECTYPE; } Lab ilab = Lab.Load(instrument.LaboratoryId); if (ilab != null) { instruIntroduce += " / 所属实验室:" + ilab.Name; } try { int ClassCodeid = int.Parse(instrument.CLASSCODE); CLASSCODE classcode = CLASSCODE.Load(ClassCodeid); if (classcode != null) { instruIntroduce += " / 仪器分类:" + classcode.Name; } } catch { } instruIntroduce += " / 购置日期:" + instrument.PURCHASEDATE.ToString("yy-MM-dd"); instruIntroduce += " / 仪器价值:" + instrument.VALUERMB + "万"; instruIntroduce += (!string.IsNullOrEmpty(instrument.MANUFACTURE) ? " / 生产商:" + instrument.MANUFACTURE : ""); switch (instrument.WorkState) { case 1: instruIntroduce += " / 运行状态:正常"; break; case 2: instruIntroduce += " / 运行状态:偶然有故障"; break; case 3: instruIntroduce += " / 运行状态:故障频繁"; break; case 4: instruIntroduce += " / 运行状态:待修"; break; case 5: instruIntroduce += " / 运行状态:修理中"; break; case 6: instruIntroduce += " / 运行状态:待报废"; break; } switch (instrument.UseState) { case 1: instruIntroduce += " / 使用状态:在用"; break; case 2: instruIntroduce += " / 使用状态:出租"; break; case 3: instruIntroduce += " / 使用状态:闲置"; break; } return instruIntroduce; }
private List<iTag> HandTag(view_INSTRUMENT iInstrument) { List<iTag> needTag = new List<iTag>(); try { List<string> tagstr = iInstrument.GetRelativeTags().ToList(); for (int i = 0; i < tagstr.Count; i++) { iTag itag = new iTag(); itag.Tag = tagstr[i]; needTag.Add(itag); } } catch { } return needTag; }