public bool UpdateCaseInfo(Dictionary<string, object> Str, long caseId) { using (DbManager db = DbFactory.DB) { string updateStr = ""; List<IDbDataParameter> paraS = new List<IDbDataParameter>(); foreach (var item in Str) { updateStr += item.Key + "[email protected]" + item.Key+ ","; paraS.Add(db.Parameter("@" + item.Key, item.Value)); } updateStr = updateStr.Remove(updateStr.Length - 1); updateStr = "update dbo.T_table set " + updateStr + " where CaseID=‘" + caseId.ToString() + "‘"; return db.SetCommand(updateStr, paraS.ToArray() ).ExecuteScalar<bool>(); } }
时间: 2024-10-27 17:48:19