Ejemplo n.º 1
0
 public bool Add(ActionLogModel model)
 {
     try
     {
         return(new ActionLogDal().Add(model));
     }
     catch (Exception ex)
     {
         nwbase_utils.TextLog.Error("error", "Add Action Log", ex);
         return(false);
     }
 }
Ejemplo n.º 2
0
        public bool Add(ActionLogModel model)
        {
            string sql = "INSERT INTO actionlog	(UserId, UserIP, `Action`, Content, Level)	VALUES (?UserId, ?UserIP, ?Action, ?Content, ?Level);";
            List <MySql.Data.MySqlClient.MySqlParameter> param = new List <MySql.Data.MySqlClient.MySqlParameter>();

            param.Add(MySqlHelper.MakeInParam("?UserId", MySql.Data.MySqlClient.MySqlDbType.Int32, 0, model.UserId));
            param.Add(MySqlHelper.MakeInParam("?UserIP", MySql.Data.MySqlClient.MySqlDbType.VarChar, 50, model.UserIP));
            param.Add(MySqlHelper.MakeInParam("?Action", MySql.Data.MySqlClient.MySqlDbType.VarChar, 50, model.Action));
            param.Add(MySqlHelper.MakeInParam("?Content", MySql.Data.MySqlClient.MySqlDbType.VarChar, 3000, model.Content));
            param.Add(MySqlHelper.MakeInParam("?Level", MySql.Data.MySqlClient.MySqlDbType.Int32, 0, model.Level));
            var result = _DBHelper.ExecuteNonQuery(CommandType.Text, sql, param.ToArray());

            return(result > 0);
        }