Esempio n. 1
0
        //Contrato Crud
        private void BtCrearCont_Click(object sender, RoutedEventArgs e)
        {
            Contratos con = new Contratos()

            {
                id_ejec     = Acceso.numid,
                institucion = TxbInstContra.Text,
                curso       = TxbCursoContra.Text,
                cantidad    = int.Parse(TxbCantContra.Text),
                nombre_rep  = TxbNombRContra.Text,
                rut_rep     = TxbCRutRContra.Text,
                correo_rep  = TxbCorreoRContra.Text,
                seguro      = CbSeguroContra.SelectedIndex.ToString(),
                destino     = CbDestinoContra.SelectedIndex.ToString(),
                costo       = int.Parse(TxbCostoContra.Text)
            };


            if (con.Create())
            {
                MessageBox.Show("Contrato registrado exitosamente", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
                Limpiar();
            }
            else
            {
                MessageBox.Show("Contrato no pudo ser registrado", "Atención", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }