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(); } }
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(); } }