Exemple #1
0
        private async Task <int> ConnectionEst()
        {
            await Task.Delay(1000);

            using (MainService.MainServiceClient mn = new MainService.MainServiceClient())
            {
                try
                {
                    string res = mn.TestConnection();
                    if (!res.Equals("FAIL"))
                    {
                        this.Hide();
                        Login lg = new Login();
                        lg.Show();
                    }
                }
                catch (Exception ee)
                {
                    MessageBox.Show("Sorry,Enable to connect service!!!");
                    this.Hide();
                }
            }
            return(await Task.Run <int>(() =>
            {
                return 0;
            }));
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string unm = textBox1.Text, pass = textBox2.Text;

            using (MainService.MainServiceClient client = new MainService.MainServiceClient())
            {
                MainService.DistributorUser msg = client.Login(unm, pass);
                if (msg != null)
                {
                    this.Hide();
                    home h = new home();
                    h.Show();
                }
                else
                {
                    label3.Text = "Invalid Username / Password!!!";
                }
            }
        }