public static int UpdateTbl_Log(Tbl_Log tbl_log) { WebCommon.Public.WriteLog("修改日志:" + tbl_log.LogInfo); tbl_log.DealUser = WebCommon.Public.GetUserName(); tbl_log.DealTime = DateTime.Now; return(new Tbl_LogService().UpdateTbl_LogById(tbl_log)); }
public int AddTbl_Log(Tbl_Log tbl_log) { string sql = "insert into [Tbl_Log] ([LogInfo],[DealUser]) values (@LogInfo,@DealUser)"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@LogInfo", tbl_log.LogInfo), new SqlParameter("@DealUser", tbl_log.DealUser) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp)); }
public int UpdateTbl_LogById(Tbl_Log tbl_log) { string sql = "update [Tbl_Log] set [LogInfo]=@LogInfo,[DealUser]=@DealUser,[DealTime]=@DealTime where DealFlag=0 and [ID]=@ID"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@LogInfo", tbl_log.LogInfo), new SqlParameter("@DealUser", tbl_log.DealUser), new SqlParameter("@DealTime", tbl_log.DealTime.ToString()), new SqlParameter("@tbl_log", tbl_log.ID) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp)); }
public static void WriteLog(string str) { try { Tbl_Log tbl_Log = new Tbl_Log(); tbl_Log.LogInfo = str; tbl_Log.DealUser = Public.GetUserName(); new Tbl_LogService().AddTbl_Log(tbl_Log); } catch { } }
/// <summary> ///根据SQL语句获取实体 /// </summary> private Tbl_Log getTbl_LogBySql(string sql) { Tbl_Log tbl_log = null; DataSet ds = DBHelper.ExecuteDataset(this.connection, CommandType.Text, sql); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; tbl_log = new Tbl_Log(); foreach (DataRow dr in dt.Rows) { tbl_log.ID = Convert.ToInt32(dr["ID"]); tbl_log.LogInfo = Convert.ToString(dr["LogInfo"]); tbl_log.DealFlag = Convert.ToInt32(dr["DealFlag"]); tbl_log.DealUser = Convert.ToString(dr["DealUser"]); tbl_log.DealTime = Convert.ToDateTime(dr["DealTime"]); tbl_log.AddDate = Convert.ToDateTime(dr["AddDate"]); } } return(tbl_log); }
public static int AddTbl_Log(Tbl_Log tbl_log) { WebCommon.Public.WriteLog("添加日志:" + tbl_log.LogInfo); return(new Tbl_LogService().AddTbl_Log(tbl_log)); }