Example #1
0
        public void UpdateList()
        {
            listView1.Items.Clear();
            OleDbConnection conexiune = new OleDbConnection(Provider);
            string          sql       = "SELECT * FROM departamente;";
            OleDbCommand    comanda   = new OleDbCommand(sql, conexiune);

            try
            {
                conexiune.Open();
                OleDbDataReader reader = comanda.ExecuteReader();

                while (reader.Read())
                {
                    ListViewItem item = new ListViewItem(reader["id_departament"].ToString());
                    item.SubItems.Add(reader["denumire"].ToString());
                    item.SubItems.Add(reader["id_supervizor"].ToString());

                    Departamente dep = new Departamente();
                    dep.Id_departament = Convert.ToInt32(reader["id_departament"].ToString());
                    dep.Denumire       = reader["denumire"].ToString();
                    dep.Id_supervizor  = Convert.ToInt32(reader["id_supervizor"].ToString());

                    item.Tag = dep;
                    listView1.Items.Add(item);
                }
            }catch (OleDbException ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                conexiune.Close();
            }
        }
Example #2
0
 public Form_Departamente(Departamente d)
 {
     dep = d;
     InitializeComponent();
 }
 public Medici(int id_medic, string nume, int varsta, double ore_lucrate, double salariul, int nr_p, List <Pacienti> pacienti, Departamente dep)
 {
     this.id_medic = id_medic;
     this.nume     = nume;
     this.varsta   = varsta;
     this.ore_lucrate_pe_saptamana = ore_lucrate;
     this.salariul       = salariul;
     this.numar_pacienti = nr_p;
     // this.pacienti = new List<Pacienti>[nr_p];
     this.pacienti    = pacienti;
     this.departament = dep.Denumire;
 }