public void AddOne(ResultLogs ModelResultLog) { /*strSql.Append("insert into ResultLogs (ID,ModelID,UserID,CalTime,FileFolder)"); strSql.Append(" values(@ID,@ModelID,@UserID,@CalTime,@FileFolder);"); SqlParameter[] parameters ={ new SqlParameter("@ID", SqlDbType.NVarChar,50), new SqlParameter("@ModelID",SqlDbType.NVarChar,50), new SqlParameter("@UserID",SqlDbType.NVarChar,50), new SqlParameter("@CalTime",SqlDbType.DateTime), new SqlParameter("@FileFolder",SqlDbType.NVarChar,200), }; parameters[0].Value = ModelResultLog.ID; parameters[1].Value = ModelResultLog.ModelID; parameters[2].Value = ModelResultLog.UserID; parameters[3].Value = ModelResultLog.CalTime; parameters[4].Value = ModelResultLog.FileFolder; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);*/ using (OOCEntities db = new OOCEntities()) { db.ResultLogs.AddObject(ModelResultLog); db.SaveChanges(); } }
/// <summary> /// Create a new ResultLogs object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="modelId">Initial value of the modelId property.</param> /// <param name="userId">Initial value of the userId property.</param> /// <param name="calTime">Initial value of the calTime property.</param> public static ResultLogs CreateResultLogs(global::System.String id, global::System.String modelId, global::System.String userId, global::System.DateTime calTime) { ResultLogs resultLogs = new ResultLogs(); resultLogs.id = id; resultLogs.modelId = modelId; resultLogs.userId = userId; resultLogs.calTime = calTime; return resultLogs; }
/// <summary> /// Deprecated Method for adding a new object to the ResultLogs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToResultLogs(ResultLogs resultLogs) { base.AddObject("ResultLogs", resultLogs); }