Exemple #1
0
        public Loading(string wtd, string username = "", string password = "")
        {
            WTD = wtd;
            int i = 0;

            dispatcherTimer.Tick    += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();
            Console.WriteLine("========================MyWindow_Loaded===========================");
            Console.WriteLine($"{ii} = " + KJG);
            Console.WriteLine("========================MyWindow_Loaded===========================");

            if (WTD == "Login")
            {
                Console.WriteLine("========================MyWindow_Loaded===========================");
                Console.WriteLine($"{ii} = " + KJG);
                Console.WriteLine("========================MyWindow_Loaded===========================");
                WebClient wc   = new WebClient();
                string    urls = $"{ProjectProp.MasterUrl}/CustomerSideUserApp/userAuth?_u={username}&_p={password}";
                KJG = wc.DownloadString(urls);
                EncDec   endc = new EncDec();
                Requests re   = JsonConvert.DeserializeObject <Requests>(KJG);
                if (re.RequestEnc == "-1")
                {
                    MessageBox.Show("User Not Found!");
                    Hide      = 1;
                    HasAccess = 3;
                }
                else if (re.RequestEnc == "-2")
                {
                    MessageBox.Show("Cannot Connect To The Server");
                    Hide      = 1;
                    HasAccess = 2;
                }
                else if (re.Requestname == "OK")
                {
                    UserStruct us = JsonConvert.DeserializeObject <UserStruct>(endc.DecryptText(re.RequestEnc));
                    File.WriteAllText("User.McdM", JsonConvert.SerializeObject(us));
                    HasAccess = 1;
                    Hide      = 1;
                }
                ii++;
                Console.WriteLine("========================MyWindow_Loaded===========================");
                Console.WriteLine($"{ii} = " + KJG);
                Console.WriteLine("========================MyWindow_Loaded===========================");
            }
            InitializeComponent();
        }
Exemple #2
0
        public static FactorPopUpModel GetCustomerShopFactorCookie(string CoockieJson)
        {
            EncDec en = new EncDec();

            return(JsonConvert.DeserializeObject <FactorPopUpModel>(en.DecryptText(CoockieJson)));
        }
Exemple #3
0
        public static tbl_Customer_Main SayWhoIsHE(string CoockieJson)
        {
            EncDec en = new EncDec();

            return(JsonConvert.DeserializeObject <tbl_Customer_Main>(en.DecryptText(CoockieJson)));
        }
Exemple #4
0
        public static Administrator SayMyName(string CoockieJson)
        {
            EncDec en = new EncDec();

            return(JsonConvert.DeserializeObject <Administrator>(en.DecryptText(CoockieJson)));
        }