Exemplo n.º 1
0
        public SqlCommand deleteBuilder(databaseTable dbt, T map, params string[] paramList)
        {
            genericFunctions <string[][]> gfunc = new genericFunctions <string[][]>();

            string[][] tableFormat = gfunc.processTableFunction(dbt, tableFunction.tableFormatChoose);

            string baseString = string.Format("DELETE FROM {0}", tableFormat[0][0]);

            for (int i = 1; paramList.Length > i; i++)
            {
                if (i == 1)
                {
                    baseString += " WHERE ";
                }

                baseString += paramList[i];

                if (paramList.Length > (i + 1))
                {
                    baseString += " AND ";
                }
            }
            baseString += ";";

            SqlCommand command = new SqlCommand(baseString);

            return(command);
        }