예제 #1
0
        private void btn_aceptar_Click(object sender, EventArgs e)
        {
            if (CheckIntegrity())
            {
                DialogResult _decision = MessageBox.Show("¿Todos los datos son correctos?", "", MessageBoxButtons.YesNo);
                if (_decision == DialogResult.Yes)
                {
                    Proyecto _proyecto = new Proyecto()
                    {
                        Id                  = _obra.idobra,
                        Nombre              = _obra.nombre,
                        Cod                 = _obra.codigo,
                        Localizacion        = _obra.localizacion,
                        Superficie_Parcela  = double.Parse(txt_superficieParcela.Text),
                        Categoria           = Convert.ToInt32(numeric_categoria.Value),
                        Cant_Habitaciones   = Convert.ToInt32(numeric_cantHabitaciones.Value),
                        Tipo_Hotel          = cmb_TipoHotel.Text,
                        Subtipo_Alojamiento = cmb_SubtipoAlojamiento.Text,
                        Tipo_Alojamiento    = cmb_TipoAlojamiento.Text,
                        Maxima_Altura       = Convert.ToInt32(numeric_MaximaAltura.Value)
                    };

                    new DB_BIM().AddElemento <Proyecto>(typeof(Proyecto), _proyecto);

                    Form _managementForm = new ProjectManagementForm(_proyecto);
                    _managementForm.ShowDialog();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Existen datos incompletos");
            }
        }
예제 #2
0
 void MostrarDetalles(object sender, EventArgs e)
 {
     if (ProyectoController.IsNewProject(obra.idobra))
     {
         Form _addProject = new AddProjectForm(obra);
         _addProject.ShowDialog();
     }
     else
     {
         var  _proyecto          = ProyectoController.UpdateProyecto(obra);
         Form _projectManagement = new ProjectManagementForm(_proyecto);
         _projectManagement.ShowDialog();
     }
 }