public void Fill() { string safeNoCham = tb_noCham.Text; if (State == States.CONSULT) { TA_CHAMBRE.FillByCHAMBRE(this.dS_Master.CHAMBRE); TA_AYANT.FillBy(this.dS_Master.AYANT); } TA_COMMODITE.Fill(this.dS_Master.COMMODITE); TA_TYPECHAM.Fill(this.dS_Master.TYPECHAM); TA_LOCALISATION.Fill(this.dS_Master.LOCALISATION); if (tb_noCham.ReadOnly && BS_CHAMBRE.DataSource != null) { BS_CHAMBRE.Position = BS_CHAMBRE.Find("NoCham", safeNoCham); } }
private void AjustNbDispoInTypeCham() { foreach (DataRow DTR_TypeCham in dS_Master.Tables["TYPECHAM"].Rows) { int totalDispo = 0; foreach (DataRow DTR_Cham in DTR_TypeCham.GetChildRows("CHAMBRE_FK_CodTypCham")) { if (DTR_Cham["Etat"].ToString() == "1") { totalDispo++; } } dS_Master.Tables["TYPECHAM"].Rows.Find(DTR_TypeCham["CodTypCham"])["NbDispo"] = totalDispo; } try { TA_TYPECHAM.Update(dS_Master.TYPECHAM); } catch (Exception ex) { MessageBox.Show(ex.Message); } }