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"); }
//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); }
private void btnEditer_Click_1(object sender, EventArgs e) { if (dgvPrestation.SelectedRows.Count > 0) { Activer(false); tbId.Text = dgvPrestation.SelectedRows[0].Cells["IdPresta"].Value.ToString(); var travail = new G_t_travail(SChonn).Lire_ID(int.Parse(tbId.Text)); tbNomPresta.Text = travail.nom_travail; tbSalPresta.Text = Convert.ToString(travail.prix_travail, CultureInfo.InvariantCulture); dtpStart.Text = Convert.ToString(travail.date_debut, CultureInfo.CurrentCulture); dtpEnd.Text = Convert.ToString(travail.date_fin, CultureInfo.CurrentCulture); C_t_categorie categorie = Categories.Find(x => x.id_categ == travail.id_categ); C_t_facture facture = Factures.Find(x => x.id_fact == travail.id_fact); cbCategorie.Text = categorie.nom_categ; cbFacture.Text = facture.date_fact.ToString("dd/MM/yyyy"); } else { MessageBox.Show(@"There is no row selected!"); } }