public void run() { Console.WriteLine("\nWelcome to the SalesForce utility for InRule BRMS."); if (login()) { getRuleApp(); ApiSample.help(); commandLine(); } }
private void commandLine() { string line = ""; cmd: Console.WriteLine("cmd>"); Console.SetCursorPosition(Console.CursorLeft + 5, Console.CursorTop - 1); line = Console.ReadLine(); //Simple Router string route = line; if (line.Length > 3) { route = line.Substring(0, 4).Trim().ToLower(); } switch (route) { case "help": { ApiSample.help(); goto cmd; } case "info": { printUserInfo(lr, lr.serverUrl); goto cmd; } case "enti": { entity(line); goto cmd; } case "fiel": { field(line); goto cmd; } case "add": { add(line); goto cmd; } case "save": { save(); break; } case "quit": { break; } default: { if (line.Trim() != "") { Console.WriteLine("oops..."); } goto cmd; } } logout(); }
static void Main(string[] args) { ApiSample sample = new ApiSample(); sample.run(); }