Example #1
0
        public void login_callback(string res)
        {
            JsonValue json = JsonValue.Parse(res); //Creates JsonValue from response string
            Console.WriteLine("My Json String = " + json.ToString()); //log that a response was recieved

            if (DataManager.cleanJSON(json["HttpStatus"].ToString()) == "200")
            {
                // Code to execute on success goes here
                Console.WriteLine("Success");
                logErrorLB.Text = "";
                DataManager.addUser("Default", DataManager.cleanJSON(json["token"].ToString()), DataManager.cleanJSON(json["user_id"].ToString()));
                this.Hide();
                Form3 f = new Form3();
                f.Show();
            }
            else
            {
                // Code to execute on error goes here
                Console.WriteLine("error");
                logErrorLB.Text = "Email or password is invalid";
            }
        }
Example #2
0
        public void getBackups_callback(string res1)
        {
            JsonValue json = JsonValue.Parse(res1); //Creates JsonValue from response string
            Console.WriteLine("My Json String = " + json.ToString()); //log that a response was recieved
           
            if (DataManager.cleanJSON(json["HttpStatus"].ToString()) == "200")
            {
                // Code to execute on success goes here
                Console.WriteLine("Success");
                DataManager.addBackupsList(json);
            }
            else
            {
                // Code to execute on error goes here
                Console.WriteLine("error");

            }
            this.Hide();
            Form3 f = new Form3();
            f.Show();
        }
Example #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     this.Hide();
     Form3 f = new Form3();
     f.Show();
 }