예제 #1
0
 public void run()
 {
     Console.WriteLine("\nWelcome to the SalesForce utility for InRule BRMS.");
     if (login())
     {
         getRuleApp();
         ApiSample.help();
         commandLine();
     }
 }
예제 #2
0
        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();
        }