private void radGridView_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e) { CATALOGO_CUARTOS editedEspecialidades = e.Cell.DataContext as CATALOGO_CUARTOS; string propertyName = e.Cell.Column.UniqueName; //MessageBox.Show(string.Format("La propiedad: {0} está editada y el nuevo valor es: {1}", propertyName, e.NewData)); BaseDatos.GetBaseDatos().SaveChanges(); }
//MEtodo Guardar un nuevo Cuarto public void Guardar() { if (txtNombre.Text == "") { System.Windows.MessageBox.Show("Inserta el nombre del Cuarto"); } else { if (txtDescripcion.Text == "") { System.Windows.MessageBox.Show("Inserta la Descripcion"); } else { if (txtCosto.Text == "") { System.Windows.MessageBox.Show("Inserta el Costo"); } else { if (txtmaxpersonas.Text == "") { MessageBox.Show("Inserta el numero de personas"); } else { DateTime fec = DateTime.Now; CATALOGO_CUARTOS ccuartos = new CATALOGO_CUARTOS { NOMBRE_CUARTO = txtNombre.Text, DESCRIPCION = txtDescripcion.Text, COSTO = Decimal.Parse(txtCosto.Text), MAX_PACIENTES = int.Parse(txtmaxpersonas.Text), FECHA_CREACION = fec, ESTADO = "Libre", STATUS = "Activo" }; BaseDatos.GetBaseDatos().CATALOGO_CUARTOS.Add(ccuartos); BaseDatos.GetBaseDatos().SaveChanges(); System.Windows.MessageBox.Show("Registro Exitoso, se guardo CORRECTAMENTE"); Limpiar(); this.Close(); } } } } }