コード例 #1
0
        // - - - - - MODIFICA una entidad el la tabla
        public static string ModificaEntidad(CCAA entidad)
        {
            CCAA e = DBAccess.ORM.dbe.CCAA.Find(entidad.id);

            e = entidad;
            return(DBAccess.ORM.SaveChanges());
        }
コード例 #2
0
        public IHttpActionResult GetCCAA(byte id)
        {
            CCAA cCAA = db.CCAA.Find(id);

            if (cCAA == null)
            {
                return(NotFound());
            }

            return(Ok(cCAA));
        }
コード例 #3
0
        private void saveData()
        {
            CCAA ccaa = new CCAA();

            evento             = new EVENTOS();
            evento.titulo      = textBoxTitulo.Text;
            evento.descripcion = richTextBoxDescripcion.Text;
            if (checkBoxGlobal.Checked)
            {
                evento.ctrlglobal = 1;
            }
            else
            {
                evento.ctrlglobal = 0;
            }
            if (checkBoxActivado.Checked)
            {
                evento.estado = 1;
            }
            else
            {
                evento.estado = 0;
            }
            evento.intro           = richTextBoxIntroduccion.Text;
            evento.notastransporte = richTextBoxTransporte.Text;
            evento.fechainicio     = dateTimePickerInicio.Value.Date;
            evento.horainicio      = TimeSpan.Parse(textBoxHoraInicio.Text);
            evento.fechafin        = dateTimePickerFechaFin.Value.Date;
            evento.horafin         = TimeSpan.Parse(textBoxHoraFin.Text);
            evento.ciudad          = textBoxCiudad.Text;
            evento.codigopostal    = textBoxCodigoPostal.Text;
            evento.email           = textBoxEmail.Text;
            evento.idprovincia     = (byte)comboBoxProvincia.SelectedValue;
            evento.idccaa          = (byte)comboBoxComunidad.SelectedValue;
            if (pictureBoxImagenEvento.Image != null)
            {
                try
                {
                    System.Drawing.Image image = System.Drawing.Image.FromFile(destino);
                    evento.imagen = ImageToByteArraybyImageConverter(image);
                }
                catch (FileNotFoundException excep)
                {
                    Console.WriteLine(excep.Message);
                }
            }
            evento.iddelegacion = (int)comboBoxDelegacion.SelectedValue;
            evento.telefono     = textBoxTelefono.Text;
            evento.responsable  = textBoxContacto.Text;
            if (Publica.idusuario != 0)
            {
                evento.iddsktuser = Publica.idusuario;
            }
        }
コード例 #4
0
 // - - - - - ELIMINA una entidad de la tabla
 public static string DeleteEntidad(CCAA entidad)
 {
     ORM.dbe.CCAA.Remove(entidad);
     return(DBAccess.ORM.SaveChanges());
 }
コード例 #5
0
 // - - - - - INSERTA una entidad el la tabla
 public static string InsertaEntidad(CCAA entidad)
 {
     ORM.dbe.CCAA.Add(entidad);
     return(DBAccess.ORM.SaveChanges());
 }