Exemple #1
0
 public void Completez_Combo_Date(int idacvariu)
 {
     dataT = Istoric_Sterge.Selectez_Data(idacvariu);
     comboBoxData.DataSource    = dataT;
     comboBoxData.ValueMember   = "iddozare";
     comboBoxData.DisplayMember = "data";
 }
Exemple #2
0
 public void Completez_CheckedListBox_Dozari(int idacvariu, DateTime d)
 {
     dozariT = Istoric_Sterge.Selectez_Dozari(idacvariu, d);
     checkedListBoxDozare.Items.Clear();
     checkedListBoxDozare.DataSource    = dozariT;
     checkedListBoxDozare.ValueMember   = "iddozare";
     checkedListBoxDozare.DisplayMember = "date";
 }
Exemple #3
0
 public void Completez_Combo_Acvariu()
 {
     comboBoxAcvariu.Items.Clear();
     acvariuT           = Istoric_Sterge.Selectez_Acvariul();
     acvariuR           = acvariuT.NewRow();
     acvariuR["ida"]    = "0";
     acvariuR["numeac"] = "--Toate acvariile-";
     acvariuT.Rows.InsertAt(acvariuR, 0);
     comboBoxAcvariu.DataSource    = acvariuT;
     comboBoxAcvariu.ValueMember   = "ida";
     comboBoxAcvariu.DisplayMember = "numeac";
 }
Exemple #4
0
 private void buttonSterge_Click(object sender, EventArgs e)
 {
     if (checkedListBoxDozare.CheckedIndices.Count > 0)
     {
         Confirmare   c             = new Confirmare("Confirmati stergerea datelor?");
         DialogResult dr            = c.ShowDialog();
         ArrayList    DozariInutile = new ArrayList();
         if (dr == DialogResult.Yes)
         {
             int id_doza;
             try
             {
                 foreach (int i in checkedListBoxDozare.CheckedIndices)
                 {
                     checkedListBoxDozare.SelectedIndex = i;
                     id_doza = Convert.ToInt32(checkedListBoxDozare.SelectedValue);
                     DozariInutile.Add(id_doza);
                 }
                 Istoric_Sterge.Sterge_Inregistrari(DozariInutile, d, idacvariu);
                 MessageBox.Show("Stergere s-a efectuat cu succes");
                 dozariT.Clear();
                 checkedListBoxDozare.DataSource = null;
                 Completez_CheckedListBox_Dozari(idacvariu, d);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
         if (dr == DialogResult.No)
         {
             MessageBox.Show("Restituirea NU a fost inregistrata");
             Goleste_checkedListBoxDozare();
         }
     }
     else
     {
         MessageBox.Show("NU ati selectat nici o inregistrare");
     }
 }