Example #1
0
 private void btnRentar_Click(object sender, EventArgs e)
 {
     using (FormInspeccion form = new FormInspeccion())
     {
         if (form.ShowDialog() == DialogResult.OK)
         {
             using (FormRentaAddEdit form1 = new FormRentaAddEdit(null))
             {
                 if (form1.ShowDialog() == DialogResult.OK)
                 {
                     FormRenta_Load(sender, e);
                 }
             }
         }
     }
 }
Example #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            //buscar objeto seleccionado en la db
            int o   = (int)dataGridView1.Rows[dataGridView1.SelectedCells[0].RowIndex].Cells[0].Value;
            var obj = db.Rentas.Select(q => q).Where(q => q.ID == o).FirstOrDefault();

            if (obj == null)
            {
                return;
            }
            //mandar el objeto encontrado al form de edicion
            using (FormRentaAddEdit form = new FormRentaAddEdit(obj as Renta))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    FormRenta_Load(sender, e);
                }
            }
        }