예제 #1
0
 private void salveazaBtt_Click(object sender, EventArgs e)
 {
     tabele.Furnizor req = new tabele.Furnizor();
     try
     {
         req.NumeFurnizor      = NumeFurnizorTxt.Text.ToString();
         req.CodFurnizor       = CodFurnizorTxt.Text.ToString();
         req.AdresaSediuSocial = AdresaSediuSocialTxt.Text.ToString();
         req.AdresaDeLivrare   = AdresaDeLivrareTxt.Text.ToString();
         req.PersoanaDeContact = PersoanaDeContactTxt.Text.ToString();
         req.Email             = EmailTxtFurnizor.Text.ToString();
         if (req.NumeFurnizor.Length * req.CodFurnizor.Length *
             req.AdresaSediuSocial.Length * req.AdresaDeLivrare.Length *
             req.PersoanaDeContact.Length * req.Email.Length == 0)
         {
             throw new ArgumentException("Camp necompletat!");
         }
         else if (!IsValidEmail(req.Email))
         {
             throw new ArgumentException("Email invalid!");
         }
         else
         {
             metodeTabele.metodele add = new metodeTabele.metodele();
             add.adaugaFurnizor(req);
             MessageBox.Show("Operatiune efectuata cu succes.");
         }
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }
예제 #2
0
파일: formProdus.cs 프로젝트: Bucaleu/apps
 private void salveazaBtt_Click(object sender, EventArgs e)
 {
     tabele.Produse model = new tabele.Produse();
     try
     {
         model.NumeProdus           = NumeProdusTxt.Text.ToString();
         model.CodProdus            = CodProdusTxt.Text.ToString();
         model.CodBare              = CodBareTxt.Text.ToString();
         model.Furnizor             = FurnizorProdusTxt.Text.ToString();
         model.UM                   = UMTxt.Text.ToString();
         model.BucatiInBax          = BucatiInBaxTxt.Text.ToString();
         model.NrBaxuriInLayer      = NrBaxuriInLayerTxt.Text.ToString();
         model.NrStraturiPePalet    = NrStraturiPePalet.Text.ToString();
         model.GreutateProdusKg     = GreutateProdusKgTxt.Text.ToString();
         model.GreutateNetaProdusKg = GreutateNetaProdusKgTxt.Text.ToString();
         model.LungimeCm            = LungimeCmTxt.Text.ToString();
         model.LatimeCm             = LatimeCmTxt.Text.ToString();
         model.InaltimeCm           = InaltimeCmTxt.Text.ToString();
         model.TipProdus            = TipProdusTxt.Text.ToString();
         if (model.NumeProdus.Length * model.CodProdus.Length * model.CodBare.Length * model.Furnizor.Length *
             model.UM.Length * model.BucatiInBax.Length * model.NrBaxuriInLayer.Length * model.NrStraturiPePalet.Length *
             model.GreutateProdusKg.Length * model.GreutateNetaProdusKg.Length * model.LungimeCm.Length *
             model.LatimeCm.Length * model.InaltimeCm.Length * model.TipProdus.Length == 0)
         {
             throw new ArgumentException("Camp necompletat!");
         }
         else
         {
             metodeTabele.metodele add = new metodeTabele.metodele();
             add.adaugaProduse(model);
             MessageBox.Show("Operatiune efectuata cu succes.");
         }
     } catch (Exception err) { MessageBox.Show(err.Message); }
 }
예제 #3
0
 public void searcC()
 {
     foreach (Control ctrl in mainContainer.Controls)
     {
         ctrl.Dispose();
     }
     mainContainer.Controls.Add(new formClient());
     tabele.Client         x   = new tabele.Client();
     metodeTabele.metodele str = new metodeTabele.metodele();
     //x = str.readFurnizor(cautaToken.Text.ToString());
 }
예제 #4
0
 public void searcF()
 {
     foreach (Control ctrl in mainContainer.Controls)
     {
         ctrl.Dispose();
     }
     mainContainer.Controls.Add(new formFurnizor());
     tabele.Furnizor       x   = new tabele.Furnizor();
     metodeTabele.metodele str = new metodeTabele.metodele();
     x = str.readFurnizor(cautaToken.Text.ToString());
     MessageBox.Show(x.CodFurnizor.ToString());
 }
예제 #5
0
        private void modificaBtt_Click(object sender, EventArgs e)
        {
            tabele.Furnizor       model  = new tabele.Furnizor();
            metodeTabele.metodele update = new metodeTabele.metodele();
            model.NumeFurnizor      = NumeFurnizorTxt.Text.ToString();
            model.CodFurnizor       = CodFurnizorTxt.Text.ToString();
            model.AdresaSediuSocial = AdresaSediuSocialTxt.Text.ToString();
            model.AdresaDeLivrare   = AdresaDeLivrareTxt.Text.ToString();
            model.PersoanaDeContact = PersoanaDeContactTxt.Text.ToString();
            model.Email             = EmailTxtFurnizor.Text.ToString();

            update.modificaFurnizor(model);
            return;
        }
예제 #6
0
 private void modificaBtt_Click(object sender, EventArgs e)
 {
     tabele.Client         model  = new tabele.Client();
     metodeTabele.metodele update = new metodeTabele.metodele();
     model.NumeClient        = NumeClientTxt.Text.ToString();
     model.Filiala           = FilialaTxt.Text.ToString();
     model.CodClient         = CodClientTxt.Text.ToString();
     model.CodTvaClient      = CodTvaClientTxt.Text.ToString();
     model.PersoanaDeContact = PersoanaDeContactTxt.Text.ToString();
     model.NrReg             = NrRegTxt.Text.ToString();
     model.AdresaSediu       = AdresaSediuTxt.Text.ToString();
     model.AdresaDeLivrare   = AdresaDeLivrareTxt.Text.ToString();
     model.Email             = EmailClientTxt.Text.ToString();
     model.Telefon           = TelefonTxt.Text.ToString();
     model.ZonaClient        = ZonaClientTxt.Text.ToString();
     model.Judet             = JudetTxt.Text.ToString();
     update.modificaClient(model);
     return;
 }
예제 #7
0
 private void salveazaBtt_Click(object sender, EventArgs e)
 {
     tabele.Client model = new tabele.Client();
     try
     {
         model.Filiala           = FilialaTxt.Text.ToString();
         model.NumeClient        = NumeClientTxt.Text.ToString();
         model.CodClient         = CodClientTxt.Text.ToString();
         model.CodTvaClient      = CodTvaClientTxt.Text.ToString();
         model.NrReg             = NrRegTxt.Text.ToString();
         model.AdresaSediu       = AdresaSediuTxt.Text.ToString();
         model.AdresaDeLivrare   = AdresaDeLivrareTxt.Text.ToString();
         model.PersoanaDeContact = PersoanaDeContactTxt.Text.ToString();
         model.Email             = EmailClientTxt.Text.ToString();
         model.Telefon           = TelefonTxt.Text.ToString();
         model.ZonaClient        = ZonaClientTxt.Text.ToString();
         model.Judet             = JudetTxt.Text.ToString();
         if (!IsValidEmail(model.Email))
         {
             throw new ArgumentException("Email invalid.");
         }
         else if (model.Filiala.Length * model.NumeClient.Length * model.CodClient.Length *
                  model.CodTvaClient.Length * model.NrReg.Length * model.AdresaSediu.Length *
                  model.AdresaDeLivrare.Length * model.PersoanaDeContact.Length * model.Email.Length *
                  model.Telefon.Length * model.ZonaClient.Length * model.Judet.Length == 0)
         {
             throw new ArgumentException("Camp necompletat.");
         }
         else
         {
             metodeTabele.metodele add = new metodeTabele.metodele();
             add.adaugaClient(model);
             MessageBox.Show("Operatiune efectuata cu succes.");
         }
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }
예제 #8
0
        private void button2_Click(object sender, EventArgs e)
        {
            tabele.User req = new tabele.User();
            try
            {
                req.Nume = NumeTextEdit.Text.ToString();
                req.Pass = PassTextEdit.Text.ToString();

                if (req.Nume.Length * req.Pass.Length == 0)
                {
                    throw new ArgumentException("Camp necompletat!");
                }
                else
                {
                    metodeTabele.metodele add = new metodeTabele.metodele();
                    add.addOne(req);
                    MessageBox.Show("Operatiune efectuata cu succes.");
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
예제 #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (dbToken.Text.ToString())
            {
            case "Furnizor":

                String                Nume = cautaToken.Text.ToString();
                tabele.Furnizor       fur  = new tabele.Furnizor();
                metodeTabele.metodele met  = new metodeTabele.metodele();
                fur = met.readFurnizor(Nume);
                MessageBox.Show(fur.CodFurnizor.ToString());
                foreach (Control ctrl in mainContainer.Controls)
                {
                    ctrl.Dispose();
                }
                formFurnizor k = new formFurnizor();
                mainContainer.Controls.Add(k);
                k.AutoPopulate(fur);



                break;

            case "Produs":
                searcP();
                break;

            case "Client":
                searcC();
                break;

            case "Utilizator":
                searcU();
                break;
            }
        }