Exemplo n.º 1
0
    private string GenerateVariableDeclarationList(DataTable dtColumns)
    {
        string         strVariablesList = string.Empty;
        CodeGeneration objCodeGen       = new CodeGeneration();

        foreach (DataRow dr in dtColumns.Rows)
        {
            strVariablesList += "Dim " + objCodeGen.GetVariableName(dr["DATA_TYPE"].ToString(), dr["COLUMN_NAME"].ToString()) + " As " + GetVBDataType(dr["DATA_TYPE"].ToString()) + "\n";
        }

        return(strVariablesList);
    }
Exemplo n.º 2
0
    private string GenerateFunctionParametersList(DataTable dtColumns)
    {
        string         strList    = string.Empty;
        CodeGeneration objCodeGen = new CodeGeneration();

        foreach (DataRow dr in dtColumns.Rows)
        {
            strList += "ByVal " + objCodeGen.GetVariableName(dr["DATA_TYPE"].ToString(), dr["COLUMN_NAME"].ToString()) + " As " + GetVBDataType(dr["DATA_TYPE"].ToString()) + ", ";
        }

        strList = strList.Remove(strList.LastIndexOf(","));
        return(strList);
    }
Exemplo n.º 3
0
    private string GenerateVBPropertyList(DataTable dtColumns)
    {
        string         strPropertyList = string.Empty;
        CodeGeneration objCodeGen      = new CodeGeneration();

        foreach (DataRow dr in dtColumns.Rows)
        {
            string strVariableName     = objCodeGen.GetVariableName(dr["DATA_TYPE"].ToString(), dr["COLUMN_NAME"].ToString());
            string strPropertyTemplate = objCodeGen.ReadTemplate(PublicEnums.TemplateName.VBProperty);
            string strVBDataType       = GetVBDataType(dr["DATA_TYPE"].ToString());
            strPropertyTemplate = strPropertyTemplate.Replace("__PropertyName", dr["COLUMN_NAME"].ToString());
            strPropertyTemplate = strPropertyTemplate.Replace("__VariableName", strVariableName);
            strPropertyTemplate = strPropertyTemplate.Replace("__DataType", strVBDataType);
            strPropertyList    += strPropertyTemplate;
        }
        return(strPropertyList);
    }//end function
Exemplo n.º 4
0
    }     //end function

    private string GenerateSPParametersList(DataTable dtColumns)
    {
        string         strParametersList = string.Empty;
        CodeGeneration objCodeGen        = new CodeGeneration();

        foreach (DataRow dr in dtColumns.Rows)
        {
            strParametersList += @"objCommand.Parameters.AddWithValue(""@" + dr["COLUMN_NAME"].ToString() + @""", " + objCodeGen.GetVariableName(dr["DATA_TYPE"].ToString(), dr["COLUMN_NAME"].ToString()) + ")\n";
        }

        return(strParametersList);
    }