コード例 #1
0
        public static void javaCodeFactory(string path, string package, DataGridViewSelectedRowCollection selectedRows)
        {
            string        basePath = path;
            DataSourceDLL dll      = new DataSourceDLL();

            path += "\\src";
            foreach (string item in package.Split('.'))
            {
                path += "\\" + item;
            }
            //StringBuilder sb = new StringBuilder();
            foreach (DataGridViewRow row in selectedRows)
            {
                //StringBuilder sbBegin = new StringBuilder();
                //StringBuilder sbEnd = new StringBuilder();
                DataTable dt = dll.getTableFeildInfo(row.Cells["tableName"].Value.ToString(), row.Cells["dbName"].Value.ToString());
                createJavaCode(path, package, row, dt);
                //sbBegin.Append("INSERT INTO ").Append(row.Cells["tableName"].Value.ToString()).Append("(");
                //sbEnd.Append(" SELECT ");
                //foreach(DataRow tempRow in dt.Rows){
                //   string columnName = tempRow["columnName"].ToString();
                //    if(!columnName.ToLower().Equals("id")){
                //        sbBegin.Append(columnName).Append(",");
                //        sbEnd.Append("o.").Append(columnName).Append(",");
                //    }
                //}
                //sbBegin = sbBegin.Remove(sbBegin.Length-1,1);
                //sbBegin.Append(")");
                //sbEnd = sbEnd.Remove(sbEnd.Length - 1, 1);
                //sbEnd.Append(" FROM data_center_origin.").Append(row.Cells["tableName"].Value.ToString()).Append(" o WHERE o.p_client_id NOT IN (SELECT p_client_id FROM data_center_origin.t_error_info)");
                //sb.Append(sbBegin.ToString()).Append(sbEnd.ToString()).Append("\r\n\r\n");
            }
            //write("F:\\test\\newSQL.sql","F:\\test",sb.ToString());
            createSqlmapConfig(basePath, path, package, selectedRows, null);
        }