Skip to content

Commit

Permalink
added cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemin914 committed Nov 1, 2012
1 parent b5676ab commit 571508a
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 14 deletions.
Binary file modified SpeedyDelete.suo
Binary file not shown.
Binary file added SpeedyDelete.v11.suo
Binary file not shown.
48 changes: 35 additions & 13 deletions SpeedyDelete/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ namespace SpeedyDelete
class Program
{

static string USERNAME = "[email protected]";
static string PASSWORD = "Zuora001";
String username = "";
String password = "";

static string ENDPOINT = "https://www.zuora.com/apps/services/a/38.0";
String ENDPOINT = "https://apisandbox.zuora.com/apps/services/a/38.0";
private zuora.ZuoraService binding;
string querystring = "SELECT id from Account where createdbyid = '2c92a0fb394cb92c013968fb16fb619c'";
string delObject = "Account";
String querystring = "SELECT id from account";
String delObject = "account";
//
//Vars
//
int numThreads = 20;
int numToDelete = 50;
int numThreads = 64;
int numToDelete = 5;
DateTime dt = new DateTime(2012, 6, 11);
//string querystring;

Expand All @@ -48,7 +48,31 @@ public Program()

binding = new zuora.ZuoraService();
binding.Url = ENDPOINT;
binding.Timeout = 300000;
binding.Timeout = 600000;

Console.WriteLine("Enter user name: ");
username = Console.ReadLine();

Console.WriteLine("Enter password: ");
password = Console.ReadLine();

Console.WriteLine("Enter query string: ");
querystring = Console.ReadLine();

Console.WriteLine("Enter Object thats being deleted");
delObject = Console.ReadLine();

Console.WriteLine("Production or Sandbox? Enter P or S");
String pors = Console.ReadLine();
if (pors == "S")
{
ENDPOINT = "https://apisandbox.zuora.com/apps/services/a/38.0";
}
else if(pors == "P")
{
ENDPOINT = "https://www.zuora.com/apps/services/a/38.0";
}

qResult = new QueryResult();
}
//
Expand All @@ -61,6 +85,7 @@ public void startDelete()
zObject[] queryRes = doQuery();

Console.WriteLine("Size: " + queryRes.Length);
Console.WriteLine("Press Enter to Continue..." + queryRes.Length);
Console.ReadKey();

handleQuery(queryRes);
Expand Down Expand Up @@ -203,7 +228,7 @@ private bool login()
{
//execute the login placing the results
//in a LoginResult object
zuora.LoginResult loginResult = binding.login(USERNAME, PASSWORD);
zuora.LoginResult loginResult = binding.login(username, password);

//set the session id header for subsequent calls
binding.SessionHeaderValue = new zuora.SessionHeader();
Expand Down Expand Up @@ -244,10 +269,7 @@ private string update(zObject acc)
}

private bool delete(String type, string[] ids)
{



{
DeleteResult[] result = binding.delete(type, ids);
for (int i = 0; i < result.Length; i++)
{
Expand Down
Binary file modified SpeedyDelete/bin/Debug/SpeedyDelete.exe
Binary file not shown.
Binary file modified SpeedyDelete/bin/Debug/SpeedyDelete.pdb
Binary file not shown.
Binary file modified SpeedyDelete/bin/Debug/SpeedyDelete.vshost.exe
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ C:\Users\mdemin\documents\visual studio 2010\Projects\SpeedyDelete\SpeedyDelete\
C:\Users\mdemin\documents\visual studio 2010\Projects\SpeedyDelete\SpeedyDelete\obj\x86\Debug\SpeedyDelete.pdb
C:\Users\mdemin\documents\visual studio 2010\Projects\SpeedyDelete\SpeedyDelete\bin\Debug\SpeedyDelete.exe
C:\Users\mdemin\documents\visual studio 2010\Projects\SpeedyDelete\SpeedyDelete\bin\Debug\SpeedyDelete.pdb
C:\Users\mdemin\documents\visual studio 2010\Projects\SpeedyDelete\SpeedyDelete\obj\x86\Debug\ResolveAssemblyReference.cache
C:\Users\mdemin\Documents\Visual Studio 2010\Projects\SpeedyDelete\SpeedyDelete\obj\x86\Debug\SpeedyDelete.csprojResolveAssemblyReference.cache
Binary file not shown.
Binary file modified SpeedyDelete/obj/x86/Debug/SpeedyDelete.exe
Binary file not shown.
Binary file modified SpeedyDelete/obj/x86/Debug/SpeedyDelete.pdb
Binary file not shown.

0 comments on commit 571508a

Please sign in to comment.