Exemple #1
0
        private void Btnsignin_Click(object sender, EventArgs e)
        {
            if ((UserIdTextBox.Text != "User Name") && (UserIdTextBox.Text != "") && (PasswordTextBox.Text != "Password") && (PasswordTextBox.Text != ""))
            {
                // save user namen and password in client info
             //   ConnectedUser = new ClientInfo(this.UserIdTextBox.Text, this.PasswordTextBox.Text);

                // send clientId and Password for authentication.

                // Get response and connect to File Server.

                // Launch User Window
                this.Hide();
                CloudStorage.FunctionScreen UserScreen = new CloudStorage.FunctionScreen(this.UserIdTextBox.Text, this.PasswordTextBox.Text);
                UserScreen.Show();
            }
            else
            {
                if((UserIdTextBox.Text == "User Name") && (UserIdTextBox.Text == ""))
                    MessageBox.Show("Please enter UserName");

                else if ((PasswordTextBox.Text == "Password") && (PasswordTextBox.Text == ""))
                    MessageBox.Show("Please enter Password");

                else
                    MessageBox.Show("Please enter UserName and Password");
            }
            /* to test
               this.Hide();
               CloudStorage.FunctionScreen UserScreen = new CloudStorage.FunctionScreen("karthik", "abc");
               UserScreen.Show();
             */
        }
Exemple #2
0
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            if ((NewUserIdTextBox.Text != "User Name") && (NewUserIdTextBox.Text != "") && (NewPassTextBox.Text != "Password") && (NewPassTextBox.Text != ""))
            {
                // Add clientId and Password for authentication.
                ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);
                JsonServiceClient Newclient  = new JsonServiceClient(CLOUD_SERVICE_ENDPOINT);
                string            NewUserUrl = string.Format("/adduser/{0}/{1}", this.NewUserIdTextBox.Text, this.NewPassTextBox.Text);
                try
                {
                    Newclient.Post <object>(NewUserUrl, new AddUser());
                    // Get response and connect to File Server.

                    // Launch User Window
                    this.Hide();
                    CloudStorage.FunctionScreen UserScreen = new CloudStorage.FunctionScreen(this.NewUserIdTextBox.Text, this.NewPassTextBox.Text);
                    UserScreen.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                if ((NewUserIdTextBox.Text == "User Name") && (NewUserIdTextBox.Text == ""))
                {
                    MessageBox.Show("Please enter UserName");
                }

                else if ((NewPassTextBox.Text == "Password") && (NewPassTextBox.Text == ""))
                {
                    MessageBox.Show("Please enter Password");
                }

                else
                {
                    MessageBox.Show("Please enter UserName and Password");
                }
            }
            // to test
            this.Hide();
        }
Exemple #3
0
        private void Btnsignin_Click(object sender, EventArgs e)
        {
            if ((UserIdTextBox.Text != "User Name") && (UserIdTextBox.Text != "") && (PasswordTextBox.Text != "Password") && (PasswordTextBox.Text != ""))
            {
                // save user namen and password in client info
                //   ConnectedUser = new ClientInfo(this.UserIdTextBox.Text, this.PasswordTextBox.Text);

                // send clientId and Password for authentication.

                // Get response and connect to File Server.

                // Launch User Window
                this.Hide();
                CloudStorage.FunctionScreen UserScreen = new CloudStorage.FunctionScreen(this.UserIdTextBox.Text, this.PasswordTextBox.Text);
                UserScreen.Show();
            }
            else
            {
                if ((UserIdTextBox.Text == "User Name") && (UserIdTextBox.Text == ""))
                {
                    MessageBox.Show("Please enter UserName");
                }

                else if ((PasswordTextBox.Text == "Password") && (PasswordTextBox.Text == ""))
                {
                    MessageBox.Show("Please enter Password");
                }

                else
                {
                    MessageBox.Show("Please enter UserName and Password");
                }
            }

            /* to test
             * this.Hide();
             * CloudStorage.FunctionScreen UserScreen = new CloudStorage.FunctionScreen("karthik", "abc");
             * UserScreen.Show();
             */
        }
Exemple #4
0
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            if ((NewUserIdTextBox.Text != "User Name") && (NewUserIdTextBox.Text != "") && (NewPassTextBox.Text != "Password") && (NewPassTextBox.Text != ""))
            {
                // Add clientId and Password for authentication.
                ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);
                JsonServiceClient Newclient = new JsonServiceClient(CLOUD_SERVICE_ENDPOINT);
                string NewUserUrl = string.Format("/adduser/{0}/{1}", this.NewUserIdTextBox.Text, this.NewPassTextBox.Text);
                try
                {
                    Newclient.Post<object>(NewUserUrl, new AddUser());
                    // Get response and connect to File Server.

                    // Launch User Window
                    this.Hide();
                    CloudStorage.FunctionScreen UserScreen = new CloudStorage.FunctionScreen(this.NewUserIdTextBox.Text, this.NewPassTextBox.Text);
                    UserScreen.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

            }
            else
            {
                if((NewUserIdTextBox.Text == "User Name") && (NewUserIdTextBox.Text == ""))
                    MessageBox.Show("Please enter UserName");

                else if ((NewPassTextBox.Text == "Password") && (NewPassTextBox.Text == ""))
                    MessageBox.Show("Please enter Password");

                else
                    MessageBox.Show("Please enter UserName and Password");
            }
               // to test
               this.Hide();
        }