// method to display the error in console static void DisplayError(LuxSciResponse resp, string method) { Console.WriteLine("\n"); Console.WriteLine("\n"); Console.WriteLine("------------------------------------------------------------------------------"); Console.WriteLine("----------------------" + method + " Request failed -------------------------"); Console.WriteLine("{0}\n{1}\n{2}", resp, resp.success, resp.error_message); Console.WriteLine("--------------------" + method + " Request completed with Failure--------------"); }
// method to display the output of Authentication static void DisplayAuthOutput(LuxSciResponse resp) { Console.WriteLine("\n"); Console.WriteLine("\n"); Console.WriteLine("-----------------------------------------------------------------------------"); Console.WriteLine("----------------------Auth request was successfull---------------------------"); Console.WriteLine("Response:{0}\n Success {1}\n AUth:{2}", resp, resp.success, resp.auth); Console.WriteLine("----------------------Auth completed Successfully----------------------------"); }
// displays the output in console static void DisplayOutput(LuxSciResponse resp, string method) { Console.WriteLine("\n"); Console.WriteLine("\n"); Console.WriteLine("----------------------------------------------------------------------------"); Console.WriteLine("------------------" + method + " Request was successfull--------------------"); Console.WriteLine("Response:{0}\n Success {1}\n Data:{2}", resp, resp.success, resp.data == null ? "" : resp.data.ToString()); Console.WriteLine("------------------ " + method + " completed Successfully--------------------"); }
// method to process the output and display in the console static void ProcessOutput(LuxSciResponse resp, string method) { if (resp.success == SUCCESS_RESPONSE) { DisplayOutput(resp, method); } else { // handle failure DisplayError(resp, method); } }