Beispiel #1
0
        public void completezListBox(int idSantier)
        {
            try
            {
                //MessageBox.Show("completezlistboxmateriale" + idSantier);
                afisMatDT = Interogari_DB.selectezResurseMaterial(idSantier);
                listBoxMaterial.DataSource    = afisMatDT;
                listBoxMaterial.DisplayMember = "infoAfisMat";
                listBoxMaterial.ValueMember   = "cod_misc_mat";

                afisManDT = Interogari_DB.selectezResurseManopera(idSantier);
                listBoxManopera.DataSource    = afisManDT;
                listBoxManopera.ValueMember   = "cod_misc_man";
                listBoxManopera.DisplayMember = "infoMan";

                afisUt = Interogari_DB.selectezResurseUtilaj(idSantier);
                listBoxUtilaje.DataSource    = afisUt;
                listBoxUtilaje.ValueMember   = "cod_misc_ut";
                listBoxUtilaje.DisplayMember = "infoUt";

                afisTr = Interogari_DB.selectezResurseTransport(idSantier);
                listBoxTransport.DataSource    = afisTr;
                listBoxTransport.ValueMember   = "cod_misc_tr";
                listBoxTransport.DisplayMember = "infoTr";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void completezComboboxMateriale_Alocare()
 {
     comboBoxMateriale.Items.Clear();
     materialeDT = Interogari_DB.selectezMateriale();
     comboBoxMateriale.DataSource    = materialeDT;
     comboBoxMateriale.ValueMember   = "cod_mat";
     comboBoxMateriale.DisplayMember = "informatiiMat";
 }
 private void completezComboboxManopera_Alocare()
 {
     comboBoxMan.Items.Clear();
     manoperaDT                = Interogari_DB.selectezManopera();
     comboBoxMan.DataSource    = manoperaDT;
     comboBoxMan.ValueMember   = "cod_man";
     comboBoxMan.DisplayMember = "informatiiMan";
 }
 private void completezComboboxUtilaj_Alocare()
 {
     comboBoxUtilaj.Items.Clear();
     utilajDT = Interogari_DB.selectezUtilaj();
     comboBoxUtilaj.DataSource    = utilajDT;
     comboBoxUtilaj.ValueMember   = "cod_ut";
     comboBoxUtilaj.DisplayMember = "denumire_ut";
 }
 private void completezComboboxTransport_Alocare()
 {
     comboBoxTransport.Items.Clear();
     transportDT = Interogari_DB.selectezTransport();
     comboBoxTransport.DataSource    = transportDT;
     comboBoxTransport.ValueMember   = "cod_tr";
     comboBoxTransport.DisplayMember = "denumire_mat_tr";
 }
Beispiel #6
0
 private void completezFurnizori()
 {
     comboBoxFurnizor.Items.Clear();
     furnizoriDT = Interogari_DB.selectezFurnizor();
     comboBoxFurnizor.DataSource    = furnizoriDT;
     comboBoxFurnizor.ValueMember   = "cod_furnizor";
     comboBoxFurnizor.DisplayMember = "denumire";
 }
Beispiel #7
0
 private void completezFunctii()
 {
     comboBoxFunctia.Items.Clear();
     functiiDT = Interogari_DB.selectezFunctii();
     comboBoxFunctia.DataSource    = functiiDT;
     comboBoxFunctia.ValueMember   = "cod_functie";
     comboBoxFunctia.DisplayMember = "denumire_functie";
 }
Beispiel #8
0
 private void completezComboBoxSefSantier()
 {
     comboBoxSefSantier.Items.Clear();
     sefSantDT = Interogari_DB.selectezSefSantier();
     comboBoxSefSantier.DataSource    = sefSantDT;
     comboBoxSefSantier.ValueMember   = "id_u";
     comboBoxSefSantier.DisplayMember = "nume_prenume";
 }
Beispiel #9
0
 private void buttonLogIn_Click(object sender, EventArgs e)
 {
     try
     {
         if (login == 0)
         {
             //Preluam user si parola, stergem eventualele spatii
             //   de la inceputul si sfarsitul numelui utilizator
             userTastat    = textBoxUsername.Text.Trim();
             parolaTastata = textBoxPassword.Text;
             if (userTastat == "")
             {
                 throw new Exception("Completați câmpul Username!");
             }
             if (parolaTastata == "")
             {
                 throw new Exception("Completați câmpul Password!");
             }
             // Cautam in baza de date DBvideoteca combinatia user+parola care au fost tastate
             // Daca gasim o inregistrare ce corespunde: aducem din baza de date
             //   denumirea rolului acelui user, altfel user_role ramane sirul vid =""
             user_role    = Interogari_DB.caut_User(userTastat, parolaTastata);
             numeConectat = Interogari_DB.userConectat(userTastat, parolaTastata, out idConectat);
             //MessageBox.Show(numeConectat + idConectat);
             if (user_role == "admin")
             {
                 // Daca rolul este de administrator ="admin"  are drepturi depline
                 login            = 1;
                 buttonLogIn.Text = "Log Out";
                 Home acasa = new Home(idConectat, numeConectat, login);
                 acasa.ShowDialog();
             }
             if (user_role == "angajat")
             {
                 // Daca rolul este de administrator ="angajat"  are drepturi limitate
                 login            = 2;
                 buttonLogIn.Text = "Log Out";
                 Home acasa = new Home(idConectat, numeConectat, login);
                 acasa.ShowDialog();
             }
             if (login == 0)
             {
                 throw new Exception("Username sau Parola incorecte");
             }
         }
         else
         {
             //  A fost apasat butonul log-out. Resetam controalele, ascundem meniul
             textBoxUsername.Text = "";
             textBoxPassword.Text = "";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void completezComboboxSantiere_Alocare(int idConectat)
 {
     comboBoxSantier.Items.Clear();
     // Apelam metoda care interogheaza tabela santiere si depune rezultatul in: DataTable alocareSantiereDT
     alocareSantiereDT = Interogari_DB.selectezSantiere_Alocare(idConectat);
     // DataTable alocareSantiereDT este folosit ca sursa de date pentru comboBoxSantier
     comboBoxSantier.DataSource = alocareSantiereDT;
     // Valoarea din coloana "cod_santier" se asociaza fiecarui item
     // din comboBoxSantier dar nu se afiseaza in comboBoxSantier
     comboBoxSantier.ValueMember = "cod_santier";
     //denumirea santierului afisat in comboBoxSantier preluata din DataTable
     comboBoxSantier.DisplayMember = "informatiiSantier";
 }
Beispiel #11
0
        public void completezAdminSantiere(ref int idCurentPrimA, ref int idCurentUltimA, int dir)
        {
            try
            {
                santiereDTA        = Interogari_DB.selectezAdminSantiere(idCurentPrimA, idCurentUltimA, dir);
                randuriSantiereDTA = santiereDTA.Rows.Count;
                //MessageBox.Show("" + randuriSantiereDTA +" "+ idCurentUltimA);
                if (randuriSantiereDTA > 0)
                {
                    reseteazaSantiere();
                    santiereDRA         = santiereDTA.Rows[0];
                    idCurentPrimA       = Convert.ToInt32(santiereDRA["cod_santier"]);
                    idCurentUltimA      = Convert.ToInt32(santiereDRA["cod_santier"]);
                    textBox1.Text       = "Șantier: " + santiereDRA["denumire_santier"] + Environment.NewLine + "Beneficiar: " + santiereDRA["beneficiar"] + Environment.NewLine + "Adresa: " + santiereDRA["adresa"] + Environment.NewLine + "Proiectant: " + santiereDRA["proiectant"] + Environment.NewLine + Environment.NewLine + "Șef de șantier: " + santiereDRA["nume_prenume"];
                    pictureBox1.Image   = Image.FromFile("Poze\\" + santiereDRA["imagine"]);
                    pictureBox1.Visible = true;

                    if (randuriSantiereDTA > 1)
                    {
                        santiereDRA         = santiereDTA.Rows[1];
                        idCurentUltimA      = Convert.ToInt32(santiereDRA["cod_santier"]);
                        textBox2.Text       = "Șantier: " + santiereDRA["denumire_santier"] + Environment.NewLine + "Beneficiar: " + santiereDRA["beneficiar"] + Environment.NewLine + "Adresa: " + santiereDRA["adresa"] + Environment.NewLine + "Proiectant: " + santiereDRA["proiectant"] + Environment.NewLine + Environment.NewLine + "Șef de șantier: " + santiereDRA["nume_prenume"];
                        pictureBox2.Image   = Image.FromFile("Poze\\" + santiereDRA["imagine"]);
                        pictureBox2.Visible = true;

                        if (randuriSantiereDTA > 2)
                        {
                            santiereDRA         = santiereDTA.Rows[2];
                            idCurentUltimA      = Convert.ToInt32(santiereDRA["cod_santier"]);
                            textBox3.Text       = "Șantier: " + santiereDRA["denumire_santier"] + Environment.NewLine + "Beneficiar: " + santiereDRA["beneficiar"] + Environment.NewLine + "Adresa: " + santiereDRA["adresa"] + Environment.NewLine + "Proiectant: " + santiereDRA["proiectant"] + Environment.NewLine + Environment.NewLine + "Șef de șantier: " + santiereDRA["nume_prenume"];
                            pictureBox3.Image   = Image.FromFile("Poze\\" + santiereDRA["imagine"]);
                            pictureBox3.Visible = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #12
0
        public void completeazaSantiere(ref int idCurentPrim, ref int idCurentUltim, int dir, int idConectat)
        {
            try
            {
                santiereDT        = Interogari_DB.selectezSantiere(idCurentPrim, idCurentUltim, dir, idConectat);
                randuriSantiereDT = santiereDT.Rows.Count;
                //MessageBox.Show("" + randuriSantiereDT + idCurentUltim);
                if (randuriSantiereDT > 0)
                {
                    reseteazaSantiere();
                    santiereDR          = santiereDT.Rows[0];
                    idCurentPrim        = Convert.ToInt32(santiereDR["cod_santier"]);
                    idCurentUltim       = Convert.ToInt32(santiereDR["cod_santier"]);
                    textBox1.Text       = "Șantier: " + santiereDR["denSantier"] + Environment.NewLine + "Beneficiar: " + santiereDR["benSantier"] + Environment.NewLine + "Adresa: " + santiereDR["adrSantier"] + "Proiectant: " + santiereDR["proiSantier"];
                    pictureBox1.Image   = Image.FromFile("Poze\\" + santiereDR["imagine"]);
                    pictureBox1.Visible = true;

                    if (randuriSantiereDT > 1)
                    {
                        santiereDR          = santiereDT.Rows[1];
                        idCurentUltim       = Convert.ToInt32(santiereDR["cod_santier"]);
                        textBox2.Text       = "Șantier: " + santiereDR["denSantier"] + Environment.NewLine + "Beneficiar: " + santiereDR["benSantier"] + Environment.NewLine + "Adresa: " + santiereDR["adrSantier"] + Environment.NewLine + "Proiectant: " + santiereDR["proiSantier"];
                        pictureBox2.Image   = Image.FromFile("Poze\\" + santiereDR["imagine"]);
                        pictureBox2.Visible = true;

                        if (randuriSantiereDT > 2)
                        {
                            santiereDR          = santiereDT.Rows[2];
                            idCurentUltim       = Convert.ToInt32(santiereDR["cod_santier"]);
                            textBox3.Text       = "Șantier: " + santiereDR["denSantier"] + Environment.NewLine + "Beneficiar: " + santiereDR["benSantier"] + Environment.NewLine + "Adresa: " + santiereDR["adrSantier"] + Environment.NewLine + "Proiectant: " + santiereDR["proiSantier"];
                            pictureBox3.Image   = Image.FromFile("Poze\\" + santiereDR["imagine"]);
                            pictureBox3.Visible = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }