Exemplo n.º 1
0
        public static void 供应商_日志操作(string 用户名, string 内容)
        {
            string tablename = CreatlogTable_供应商();
            string log_sql   = "insert `" + tablename + "`(username,time,text)values(?username,?time,?text)";

            MySqlParameter[] log_param = new MySqlParameter[]
            {
                new MySqlParameter("?username", 用户名),
                new MySqlParameter("?time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                new MySqlParameter("?text", 内容)
            };
            MysqlHelper.ExecuteNonQuery(log_sql, ref Program.myPool_supplier, log_param);
        }
Exemplo n.º 2
0
        public static string CreatlogTable_供应商()
        {
            string sdt       = DateTime.Now.ToString("yyyy");
            string tablename = "log_" + sdt;

            string s_sql = "SELECT table_name FROM information_schema.TABLES WHERE table_name ='" + tablename + "' and `table_schema`='supplier' ";
            object ob    = MysqlHelper.ExecuteScalar(s_sql, ref Program.myPool_supplier);

            if (ob == null)
            {
                string sql = "CREATE TABLE  IF NOT EXISTS `" + tablename + "`  LIKE  `log_mb`";
                MysqlHelper.ExecuteNonQuery(sql, ref Program.myPool_supplier);
            }

            return(tablename);
        }