コード例 #1
0
        private async Task ImportAsync()
        {
            string res = string.Empty;

            loadingCircle1.Visible = true;
            loadingCircle1.Size    = new Size(75, 75);
            loadingCircle1.Active  = true;
            btn_login.Enabled      = false;
            await Task.Run(() => {
                res = login();
            });

            loadingCircle1.Active  = false;
            loadingCircle1.Visible = false;
            loadingCircle1.Size    = new Size(1, 1);
            btn_login.Enabled      = true;
            if (res == "1")
            {
                UPDATE_LOGIN();
                KOT_DASHBOARD d = new KOT_DASHBOARD();
                d.Show();
                this.Hide();
            }
            else if (res == "0")
            {
                MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), "username or password invalied!", MessageAlertImage.Error());
                mdg.ShowDialog();
            }
            else
            {
                MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), login(), MessageAlertImage.Alert());
                mdg.ShowDialog();
            }
        }
コード例 #2
0
 private async void shapedButton1_Click(object sender, EventArgs e)
 {
     if (txt_uname.Text.Length == 0)
     {
         pb_u_warning.Visible = true;
         txt_uname.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "Please enter username", MessageAlertImage.Success());
         mdg.ShowDialog();
     }
     else if (txt_pass.Text.Length == 0)
     {
         pb_p_warning.Visible = true;
         txt_pass.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "Please enter password", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else
     {
         pb_u_warning.Visible = false;
         pb_u_warning.Visible = false;
         await ImportAsync();
     }
 }