private bool saveObjects(int _custodyID) { CustodyObject c = null; string sql = string.Format(SQL.DEL_INTERVENE_OBJ, _custodyID); foreach (Object item in lvObjects.Items) { c = (CustodyObject)item; sql += string.Format(SQL.ADD_INTERVENE_OBJ, _custodyID, c.TypeCode, c.ObjectCode, c.ObjectName, c.ObjectValue, BLPublic.DBOperate.fmtDT(c.ValueTime)); } if (!AppConst.db.ExecSQL(sql)) { BLPublic.Dialogs.Error("保存干预失败:" + AppConst.db.Error); return(false); } return(true); }
/// <summary> /// 获取干预对象描述 /// </summary> /// <returns></returns> public string getObjectStr(string _sptChr = ",") { string rt = ""; CustodyObject c = null; foreach (Object item in lvObjects.Items) { c = (CustodyObject)item; if (!string.IsNullOrWhiteSpace(rt)) { rt += _sptChr; } rt += c.ValueTime.ToString("[yy.MM.dd] ") + c.ObjectName; if (!string.IsNullOrWhiteSpace(c.ObjectValue)) { rt += " " + c.ObjectValue; } } return(rt); }