private void InitialiseListClasses() { // this function is going to initialise all of my list classes every time i call it Categories = new G_t_categorie(SChonn).Lire("IdCateg"); Entreprises = new G_t_entreprise(SChonn).Lire("IdEntre"); Interimeurs = new G_t_interimeur(SChonn).Lire("IdInte"); Factures = new G_t_facture(SChonn).Lire("IdFact"); Prestations = new G_t_travail(SChonn).Lire("IdTravail"); }
private void RemplireComboBox() //remplir le combo box { Entreprises = new G_t_entreprise(SChonn).Lire("IdEntre"); //lire et stockee les donnee dans la liste entreprises Categories = new G_t_categorie(SChonn).Lire("IdCateg"); //lire les donnees et les metre dans une list foreach (C_t_categorie categorie in Categories) { cbMetier.Items.Add(categorie.nom_categ); } //foreach (var entreprise in Entreprises) // cbEntreprise.Items.Add(entreprise.nom_entre); }
private void btnEditer_Click(object sender, EventArgs e) { if (dgvCategorie.SelectedRows.Count > 0) { Activer(false); tbId.Text = dgvCategorie.SelectedRows[0].Cells["id_cat"].Value.ToString(); var categorie = new G_t_categorie(SChonn).Lire_ID(int.Parse(tbId.Text)); tbCateg.Text = categorie.nom_categ; tbSal.Text = categorie.sal_categ.ToString(CultureInfo.CurrentCulture); } else { MessageBox.Show(@"There is no row selected!"); } }
private void RemplirDgv() { DtCategorie = new DataTable(); DtCategorie.Columns.Add(new DataColumn("id_cat", Type.GetType("System.Int32") ?? throw new InvalidOperationException())); DtCategorie.Columns.Add("nom_cat"); DtCategorie.Columns.Add("sal_cat"); List <C_t_categorie> categories = new G_t_categorie(SChonn).Lire("Nom"); foreach (var categorie in categories) { DtCategorie.Rows.Add(categorie.id_categ, categorie.nom_categ, string.Format(_info, "{0:C}", categorie.sal_categ)); } BsCategorie = new BindingSource { DataSource = DtCategorie }; dgvCategorie.DataSource = BsCategorie; }
//constructor #endregion public MainForm() { InitializeComponent(); var skinManager = MaterialSkin.MaterialSkinManager.Instance; //Material theme initialization skinManager.ColorScheme = new MaterialSkin.ColorScheme(MaterialSkin.Primary.BlueGrey600, MaterialSkin.Primary.Amber700, MaterialSkin.Primary.Amber500, MaterialSkin.Accent.Green400, MaterialSkin.TextShade.WHITE); // changing the color theme to bleu and amber Travails = new G_t_categorie(SChonn).Lire("IdTravail"); //initialization of category list Interimaires = new G_t_interimeur(SChonn).Lire("IdInte"); //initialization of Interimaire list Entreprises = new G_t_entreprise(SChonn).Lire("IdEntre"); //initialization of Entreprise list Prestations = new G_t_travail(SChonn).Lire("IdPresta"); //initialization of Prestation list Factures = new G_t_facture(SChonn).Lire("IdFact"); //initialization of Facture list RemplirDgvInterimeur(); RemplirDgvEntreprise(); RemplirDgvTravail(); RemplirDgvFacture(); RemplirDgvPrestations(); SelectFirstRow(dgvInterimeur, dgvEntreprise, dgvTravails, dgvFacture, dgvTravails); }