protected void btnSave_Click(object sender, EventArgs e)
        {
            LABORATORIO laboratorio = new LABORATORIO();
            ILaboratorios bdd = new BusinessLogic();
            ListaLaboratorio selectedLab = Session["selectedLab"] as ListaLaboratorio;
            if (Session["selectedLab"] != null)
            {
                laboratorio.IDLABORATORIO = selectedLab.IdLaboratorio;
                laboratorio = laboratorio.MarkAsModified();
            }
            else
            {
                laboratorio.IDLABORATORIO = Guid.NewGuid();
                laboratorio = laboratorio.MarkAsAdded();
            }

            Guid idCorporacion = new Guid(ddlCorporacion.SelectedValue);
            if (idCorporacion == Guid.Empty)
                laboratorio.IDCORPORACION = null;
            else
                laboratorio.IDCORPORACION = idCorporacion;

            laboratorio.IDUBICACION = new Guid(ddlUbicacion.SelectedValue);
            laboratorio.DIRECCION = txtDireccion1.Text;
            laboratorio.DIRECCION2 = txtDireccion2.Text;
            laboratorio.NOMBRELABORATORIO = txtNombre.Text;
            laboratorio.OBSERVACION = txtObservacion.Text;
            laboratorio.ORIGEN = ddlOrigen.Text;
            laboratorio.TELEFONO = txtTelefono.Text;
            laboratorio.ABREVIATURALABORATORIO = txtAbreviatura.Text;
            bdd.SaveLaboratorio(laboratorio);
            Response.Redirect("~/ui/MantenimientoCorpLab.aspx");
        }
        private void FixupLABORATORIO(LABORATORIO previousValue)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.MOVIMIENTOSUBPRODUCTO.Contains(this))
            {
                previousValue.MOVIMIENTOSUBPRODUCTO.Remove(this);
            }

            if (LABORATORIO != null)
            {
                if (!LABORATORIO.MOVIMIENTOSUBPRODUCTO.Contains(this))
                {
                    LABORATORIO.MOVIMIENTOSUBPRODUCTO.Add(this);
                }

                IDLABORATORIO = LABORATORIO.IDLABORATORIO;
            }
            if (ChangeTracker.ChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("LABORATORIO")
                    && (ChangeTracker.OriginalValues["LABORATORIO"] == LABORATORIO))
                {
                    ChangeTracker.OriginalValues.Remove("LABORATORIO");
                }
                else
                {
                    ChangeTracker.RecordOriginalValue("LABORATORIO", previousValue);
                }
                if (LABORATORIO != null && !LABORATORIO.ChangeTracker.ChangeTrackingEnabled)
                {
                    LABORATORIO.StartTracking();
                }
            }
        }