Ejemplo n.º 1
0
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         imobile casa = (imobile)listView1.SelectedItems[0].Tag;
         if (MessageBox.Show("Siguri doriti sa stergeti?", "Confirmare", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             case1.Remove(casa);
             Afisare();
         }
     }
 }
Ejemplo n.º 2
0
 public Form2(imobile cas = null)
 {
     InitializeComponent();
     if (cas != null)
     {
         this.cas      = cas;
         textBox1.Text = cas.Nume;
         textBox2.Text = cas.Pret.ToString();
         textBox3.Text = cas.Camere.ToString();
         textBox4.Text = cas.Suprafata.ToString();
         textBox5.Text = cas.Etaj.ToString();
         textBox6.Text = cas.Adresa;
     }
 }
Ejemplo n.º 3
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         imobile casa = (imobile)listView1.SelectedItems[0].Tag;
         using (Form2 f = new Form2(casa))
         {
             if (f.ShowDialog(this) == DialogResult.OK)
             {
                 Afisare();
             }
         }
     }
 }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cas == null)
            {
                cas = new imobile(textBox1.Text, int.Parse(textBox2.Text), int.Parse(textBox3.Text), int.Parse(textBox4.Text), int.Parse(textBox5.Text), textBox6.Text);
            }
            else
            {
                cas.Nume      = textBox1.Text;
                cas.Pret      = int.Parse(textBox2.Text);
                cas.Camere    = int.Parse(textBox3.Text);
                cas.Suprafata = int.Parse(textBox4.Text);
                cas.Etaj      = int.Parse(textBox5.Text);
                cas.Adresa    = textBox6.Text;
            }

            this.DialogResult = DialogResult.OK;
            Close();
        }