Beispiel #1
0
 public ReportFormular(Imprumut ii)
 {
     InitializeComponent();
     this.i               = ii;
     tbAdresa.Text        = ii.cititor.adresa;
     tbCartereport.Text   = ii.carte.titlu;
     tbcititorreport.Text = ii.cititor.nume;
 }
 private void utilizator1_Click(object sender, EventArgs e)
 {
     if (listaCarti.Visible == true)
     {
         if (listaCarti.SelectedItems.Count > 0)
         {
             Carte c = (Carte)listaCarti.SelectedItems[0].Tag;
             using (var report = new ReportCarte(c))
             {
                 report.ShowDialog();
             }
         }
         else
         {
             using (var reporti = new ReportCarte())
             {
                 reporti.ShowDialog();
             }
         }
     }
     else
     {
         if (listaImprumut.Visible == true)
         {
             if (listaImprumut.SelectedItems.Count > 0)
             {
                 Imprumut i = (Imprumut)listaImprumut.SelectedItems[0].Tag;
                 using (var formi = new ReportFormular(i))
                 {
                     formi.ShowDialog();
                 }
             }
             else
             {
                 using (var formis = new ReportFormular())
                 {
                     formis.ShowDialog();
                 }
             }
         }
     }
 }
Beispiel #3
0
        public FormContract(Imprumut imprumut = null)
        {
            InitializeComponent();

            this.imprumut = imprumut;
            if (imprumut == null)
            {
                this.Text = "Adaugare Contract";
            }
            else
            {
                this.Text = "Modifica Contract";
                tbNumarContract.ReadOnly = true;
                tbZi.ReadOnly            = true;
                tbAn.ReadOnly            = true;
                tbLuna.ReadOnly          = true;
                tbNumarContract.Text     = imprumut.numar.ToString();
                tbZi.Text   = imprumut.data_imprumut.Day.ToString();
                tbLuna.Text = imprumut.data_imprumut.Month.ToString();
                tbAn.Text   = imprumut.data_imprumut.Year.ToString();
            }
        }
        private void adaugareToolStripMenuItem_Click(object sender, EventArgs e)
        {
            listaImprumut.BringToFront();
            listaImprumut.Enabled = true;
            if (listaImprumut.Visible == false)
            {
                listaImprumut.Visible = true;
            }
            if (listaCarti.Visible == true)
            {
                listaCarti.Visible = true;
            }
            using (var formular = new FormContract(null))
            {
                if (formular.ShowDialog() == DialogResult.OK)
                {
                    using (var formCarte = new FormCarte())
                    {
                        if (formCarte.ShowDialog() == DialogResult.OK)
                        {
                            using (var formCititor = new formCititor())

                            {
                                if (formCititor.ShowDialog() == DialogResult.OK)
                                {
                                    var nouImprumut = new Imprumut(int.Parse(formular.tbNumarContract.Text)
                                                                   , new DateTime(int.Parse(formular.tbAn.Text), int.Parse(formular.tbLuna.Text), int.Parse(formular.tbZi.Text)),
                                                                   new Carte(formCarte.tbTitlu.Text,
                                                                             formCarte.tbAutor.Text,
                                                                             formCarte.tbDomeniu.Text,
                                                                             int.Parse(formCarte.tbCota.Text),
                                                                             int.Parse(formCarte.tbRaft.Text)),
                                                                   new Cititor(formCititor.tbNume.Text, formCititor.tbAdresa.Text, formCititor.tbCnp.Text, int.Parse(formCititor.tbVarsta.Text)));
                                    imprumuturi.Add(nouImprumut);
                                    if (nouImprumut.data_imprumut.Year == 2015)
                                    {
                                        an2015++;
                                    }
                                    if (nouImprumut.data_imprumut.Year == 2016)
                                    {
                                        an2016++;
                                    }
                                    if (nouImprumut.data_imprumut.Year == 2017)
                                    {
                                        an2017++;
                                    }
                                    if (nouImprumut.data_imprumut.Year == 2018)
                                    {
                                        an2018++;
                                    }
                                    if (nouImprumut.data_imprumut.Year == 2019)
                                    {
                                        an2019++;
                                    }
                                    ;
                                    incarcareVector(vector);
                                    afisareImprumuturi();
                                }
                            }
                        }
                    }
                }
            }
        }