/// <summary> /// Método desusado para agregar un nuevo objeto al EntitySet Laboratorio. Considere la posibilidad de usar el método .Add de la propiedad ObjectSet<T> asociada. /// </summary> public void AddToLaboratorio(Laboratorio laboratorio) { base.AddObject("Laboratorio", laboratorio); }
private void InsertarLaboratorio() { try { if (txtNombre.Text != "") { Usuario objusuario = (Usuario)Session[Constantes.sesionUsuario]; objlaboratorio.LAB_Nombre = txtNombre.Text.Trim(); objlaboratorio.IDTipoLaboratorio = ddlTipoLaboratorio.SelectedValue == "0" ? (int?)null : Convert.ToInt32(ddlTipoLaboratorio.SelectedValue); objlaboratorio.LAB_Estado = Constantes.EstadoActivo; objlaboratorio.LAB_UsuarioCreacion = objusuario.IDUsuario.ToString(); objlaboratorio.LAB_FechaHoraCreacion = DateTime.Now; objlaboratorio = LaboratorioBL.Instancia.Insertar(objlaboratorio); LimpiarCampos(); ClientScript.RegisterStartupScript(this.GetType(), "Confirmacion", "$(function(){MostrarMensaje('msjRegistroOK');});", true); } } catch { ClientScript.RegisterStartupScript(this.GetType(), "Error", "$(function(){MostrarMensaje('msjErrorGrabar');});", true); } }
/// <summary> /// Crear un nuevo objeto Laboratorio. /// </summary> /// <param name="iDLaboratorio">Valor inicial de la propiedad IDLaboratorio.</param> public static Laboratorio CreateLaboratorio(global::System.Int32 iDLaboratorio) { Laboratorio laboratorio = new Laboratorio(); laboratorio.IDLaboratorio = iDLaboratorio; return laboratorio; }