1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
private void bt_ajout_serv_Click(object sender, EventArgs e)
{
this.BindingContext[dbDs, dbDs.tp1_service.TableName].AddNew();
fillData();
}
private void fillData()
{
string total = (this.BindingContext[dbDs, "tp1_service.serviceemploye"].Count).ToString();
string num = ((this.BindingContext[dbDs, "tp1_service.serviceemploye"].Position) + 1).ToString();
tb_posCpt_emp.Text = num + "/" + total;
total = (this.BindingContext[dbDs, dbDs.tp1_service.TableName].Count).ToString();
num = ((this.BindingContext[dbDs, dbDs.tp1_service.TableName].Position) + 1).ToString();
tb_posCpt_serv.Text = num + "/" + total;
try
{
activeService = this.BindingContext[dbDs, dbDs.tp1_employe.TableName].Current as DataRowView;
rowView = this.BindingContext[dbDs, "tp1_service.serviceemploye"].Current as DataRowView;
}
catch {}
if (rowView != null)
{
if ((bool)rowView.Row["sexe"] == true)
this.rb_masculin.Checked = true;
else
this.rb_feminin.Checked = true;
}
else
{
this.cb_service.SelectedValue = false;
}
} |
Partager