Ejemplo n.º 1
0
        private static void RunSave(string[] args)
        {
            var gstin  = "33GSPTN0192G1ZA";
            var userid = "risersoft.tn.2";
            var fp     = "122018";
            var gsp    = "GSTN";
            IGSTNAuthProvider auth9 = GetAuth(gstin, gsp, userid);

            TestGSTR1Save2(auth9, gstin, userid, fp, "", "");
            auth9.Logout();
        }
Ejemplo n.º 2
0
        private static void RunConsole(string[] args)
        {
            string gstin = "", gsp = "", userid = "", fp = "", filename = "", ctin = "", etin = "";

            if ((args != null) && (args.Count() > 0) && (System.IO.File.Exists(args[0])))
            {
                filename = args[0];
            }
            else
            {
                System.Console.Write("Enter input filename [Press Enter for None]:");
                filename = System.Console.ReadLine();
            }


            if (!String.IsNullOrEmpty(filename) && (System.IO.File.Exists(filename)))
            {
                var      fileContents = File.ReadAllText(filename);
                string[] arr          = Microsoft.VisualBasic.Strings.Split(fileContents, Microsoft.VisualBasic.Constants.vbCrLf);
                gsp    = arr[0];
                userid = arr[1];
                gstin  = arr[2];
                fp     = arr[3];
                ctin   = arr[4];
                etin   = arr[5];
            }
            else
            {
                System.Console.Write("Enter GSP:");
                gsp = System.Console.ReadLine();

                System.Console.Write("Enter UserID:");
                userid = System.Console.ReadLine();

                System.Console.Write("Enter GSTIN:");
                gstin = System.Console.ReadLine();

                System.Console.Write("Enter FP:");
                fp = System.Console.ReadLine();

                System.Console.Write("Enter CTIN:");
                ctin = System.Console.ReadLine();

                System.Console.Write("Enter ETIN:");
                etin = System.Console.ReadLine();
            }



            System.Console.WriteLine("1=GSTR1 Get, 2=GSTR2 Get, 3=GSTR3 Get, 4=Ledger, " +
                                     "5=File with eSign, 6=CSV conversion, 7=PGP, 8=File With DSC, " +
                                     "9=GSTR1 Save, 10=GSTR2 Save, 11=GSTR3 Save, 12=Refresh Token, 13=Register DSC, " +
                                     "14=Search,  15= EWB, 16=TOKEN");
            string selection = System.Console.ReadLine();

            switch (selection)
            {
            case "1":
                IGSTNAuthProvider auth1 = GetAuth(gstin, gsp, userid);
                TestGSTR1Get(auth1, gstin, userid, fp);
                auth1.Logout();
                break;

            case "2":
                IGSTNAuthProvider auth2 = GetAuth(gstin, gsp, userid);
                TestGSTR2Get(auth2, gstin, userid, fp);
                auth2.Logout();
                break;

            case "3":
                TestGSTR3(gstin, gsp, userid, fp);
                break;

            case "4":
                TestLedger(gstin, gsp, userid, fp, "19-08-2016", "20-09-2016");
                break;

            case "5":
                System.Console.Write("Enter path to license file:");
                string path = System.Console.ReadLine();
                System.Console.Write("Enter your Aadhar Num:");
                string aadhaarnum    = System.Console.ReadLine();
                string transactionid = GetUIDAIOtp(path, aadhaarnum);
                System.Console.Write("Enter OTP:");
                string otp = System.Console.ReadLine();
                FileGSTR1WithESign(gstin, gsp, userid, fp, aadhaarnum, transactionid, otp);
                break;

            case "6":
                TestCSV(gstin, gsp, userid, fp);
                break;

            case "7":
                TestPGP("the quick brown fox jumped over the lazy dog");
                break;

            case "8":
                System.Console.Write("Enter your PAN:");
                string pan = System.Console.ReadLine();
                FileGSTR1WithDSC(gstin, gsp, userid, fp, pan);
                break;

            case "9":
                IGSTNAuthProvider auth9 = GetAuth(gstin, gsp, userid);
                TestGSTR1Save(auth9, gstin, userid, fp, ctin, etin);
                auth9.Logout();
                break;

            case "10":
                TestGSTR2Save(gstin, gsp, userid, fp, ctin);
                break;

            case "12":
                IGSTNAuthProvider auth12 = GetAuth(gstin, gsp, userid);
                auth12.RefreshToken();
                break;

            case "13":
                System.Console.Write("Enter your PAN:");
                string pan2 = System.Console.ReadLine();
                RegisterDSC(gstin, gsp, userid, pan2);
                break;

            case "14":

                SearchGSTIN(gstin, gsp, "PROD");
                break;

            case "15":
                TestEWBAspOne(gstin, userid);
                break;

            case "16":
                TestEWBTokenKpmg(gstin, userid);
                break;
            }

            System.Console.WriteLine("Press any key to end this program");
            System.Console.ReadKey(false);
        }