public static void LOAD_CATEGORY(hyflexComboBox CMB_CATEGORY)
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT categry_id,caegory_name FROM category", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 CMB_CATEGORY.DataSource    = DT;
                 CMB_CATEGORY.DisplayMember = "caegory_name";
                 CMB_CATEGORY.ValueMember   = "categry_id";
                 CMB_CATEGORY.SelectedIndex = -1;
             }
             else
             {
                 CMB_CATEGORY.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
 }
Пример #2
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();
            }
        }
Пример #3
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();
     }
 }