コード例 #1
0
 protected void btnAccept_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         if (!DataOk())
         {
             return;
         }
         if (newRecord)
         {
             usuarioextranet = new UsuarioExtranet();
         }
         UnloadData(usuarioextranet);
         if (newRecord)
         {
             ctx.Add(usuarioextranet);
         }
         ctx.SaveChanges();
         if (newRecord)
         {
             RadAjaxManager1.ResponseScripts.Add(String.Format("closeWindowRefreshGrid('{0}', 'new');", caller));
         }
         else
         {
             RadAjaxManager1.ResponseScripts.Add(String.Format("closeWindowRefreshGrid('{0}', 'edit');", caller));
             //RadAjaxManager1.ResponseScripts.Add(String.Format("MyAlert('{0}');", caller));
         }
     }
     catch (Exception ex)
     {
         ControlDeError(ex);
     }
 }
コード例 #2
0
 string caller = ""; // who's calling the grid form
 #endregion
 #region Init, load, unload events
 protected void Page_Init(object sender, EventArgs e)
 {
     // it gets an appropiate context (LainsaSciCTX -> web.config)
     ctx = new LainsaSci("LainsaSciCTX");
     // verify if a Usuario is logged
     uex = CntLainsaSci.GetUsuarioExtranet((int)Session["UsuarioExtranetId"], ctx);
     if (uex == null)
     {
         Response.Redirect("Default.aspx");
     }
     //
     CntWinWeb.TranslateRadGridFilters(RadGrid1);
     if (Request.QueryString["Mode"] != null)
     {
         mode = Request.QueryString["Mode"];
     }
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
     }
     if (Request.QueryString["GrupoMensajesId"] != null)
     {
         grupoMensajes = CntLainsaSci.GetGrupoMensajes(int.Parse(Request.QueryString["GrupoMensajesId"]), ctx);
         if (grupoMensajes != null)
         {
             //RadGrid1.Columns.FindByDataField("GrupoMensajes.Nombre").Visible = false;
         }
     }
 }
コード例 #3
0
ファイル: Extranet.cs プロジェクト: rafaelgr/falck-sci
 public static IList <Documento> GetDocumentos(Subcategoria subCategoria, UsuarioExtranet uex, LainsaSci ctx)
 {
     if (uex.Empresa == null)
     {
         return((from d in ctx.Documentos
                 where d.Subcategoria.SubcategoriaId == subCategoria.SubcategoriaId
                 select d).ToList <Documento>());
     }
     else
     {
         if (uex.Instalacion == null)
         {
             return((from d in ctx.Documentos
                     where d.Subcategoria.SubcategoriaId == subCategoria.SubcategoriaId &&
                     d.Empresa.EmpresaId == uex.Empresa.EmpresaId
                     select d).ToList <Documento>());
         }
         else
         {
             return((from d in ctx.Documentos
                     where d.Subcategoria.SubcategoriaId == subCategoria.SubcategoriaId &&
                     d.Empresa.EmpresaId == uex.Empresa.EmpresaId &&
                     d.Instalacion.InstalacionId == uex.Instalacion.InstalacionId
                     select d).ToList <Documento>());
         }
     }
 }
コード例 #4
0
 protected void Page_Init(object sender, EventArgs e)
 {
     // lo primero es cargar el contexto
     ctx = new LainsaSci("LainsaSciCTX"); // (LainsaSciCTX -> web.config)
     // Comprobar si hay un usuario logado
     if (Session["UsuarioExtranetId"] != null)
     {
         int id = (int)Session["UsuarioExtranetId"];
         uex = CntLainsaSci.GetUsuarioExtranet(id, ctx);
         if (uex == null)
         {
             Response.Redirect("Default.aspx");
         }
     }
     else
     {
         Response.Redirect("Default.aspx");
     }
     if (Request.QueryString["DocumentoId"] != null)
     {
         documentoId = int.Parse(Request.QueryString["DocumentoId"]);
         documento   = CntLainsaSci.GetDocumento(documentoId, ctx);
         if (documento != null)
         {
             string newFileName = String.Format("{0:000000000}", documento.DocumentoId) + documento.Extension;
             string repodir     = ConfigurationManager.AppSettings["Repositorio"];
             string origen      = repodir + "\\" + newFileName;
             string destino     = Session["UsuarioDir"] + "\\" + newFileName;
             File.Copy(origen, destino, true);
             SplView.ContentUrl = String.Format("/Docs/A{0:000000}/{1}", uex.UsuarioExtranetId, newFileName);
         }
     }
 }
コード例 #5
0
 protected void btnAccept_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         if (!DataOk())
         {
             return;
         }
         if (newRecord)
         {
             usuarioextranet = new UsuarioExtranet();
         }
         UnloadData(usuarioextranet);
         if (newRecord)
         {
             ctx.Add(usuarioextranet);
         }
         ctx.SaveChanges();
         //if (newRecord)
         //    RadAjaxManager1.ResponseScripts.Add(String.Format("closeWindowRefreshGrid('{0}', 'new');", caller));
         //else
         //{
         //    RadAjaxManager1.ResponseScripts.Add(String.Format("closeWindowRefreshGrid('{0}', 'edit');", caller));
         //    RadAjaxManager1.ResponseScripts.Add(String.Format("MyAlert('{0}');", caller));
         //}
         RadNotification1.Text = "Sus datos han sido guardados haga clic en cualquier elemento del árbol a su izquierda para continuar";
         RadNotification1.Show();
     }
     catch (Exception ex)
     {
         ControlDeError(ex);
     }
 }
コード例 #6
0
 protected void UnloadData(UsuarioExtranet usuarioext)
 {
     usuarioext.Nombre = txtNombre.Text;
     // Grupo de usuario asociado
     //usuarioext.Global = chkGlobal.Checked;
     //if (!usuarioext.Global)
     //{
     usuarioext.Empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     if (rdcInstalacion.SelectedValue != "")
     {
         usuarioext.Instalacion = CntLainsaSci.GetInstalacion(int.Parse(rdcInstalacion.SelectedValue), ctx);
     }
     else
     {
         usuarioext.Instalacion = null;
     }
     //}
     //else
     //{
     //    usuarioext.Empresa = null;
     //    usuarioext.Instalacion = null;
     //}
     usuarioext.Login  = txtLogin.Text;
     usuarioext.Correo = txtEmail.Text;
     if (txtPassword.Text != "")
     {
         usuarioext.Password = CntAutenticacion.GetHashCode(txtPassword.Text);
     }
 }
コード例 #7
0
ファイル: Extranet.cs プロジェクト: rafaelgr/falck-sci
        public static IList <Documento> GetDocumentos(Empresa empresa, UsuarioExtranet uex, LainsaSci ctx)
        {
            IList <Documento> ldocs = (from d in ctx.Documentos
                                       where d.Instalacion == null && d.Empresa.EmpresaId == empresa.EmpresaId
                                       select d).ToList <Documento>();

            return(ldocs);
        }
コード例 #8
0
 string caller = "";  // who's calling the grid form
 #endregion
 #region Init, load, unload events
 protected void Page_Init(object sender, EventArgs e)
 {
     // it gets an appropiate context (LainsaSciCTX -> web.config)
     ctx = new LainsaSci("LainsaSciCTX");
     // verify if a Usuario is logged
     uex = CntLainsaSci.GetUsuarioExtranet((int)Session["UsuarioExtranetId"], ctx);
     if (uex == null)
     {
         Response.Redirect("Default.aspx");
     }
     // si llega aquí está autorizado
 }
コード例 #9
0
 string caller           = ""; // who's calling the grid form
 #endregion
 #region Init, load, unload events
 protected void Page_Init(object sender, EventArgs e)
 {
     // it gets an appropiate context (LainsaSciCTX -> web.config)
     ctx = new LainsaSci("LainsaSciCTX");
     // verify if a Usuario is logged
     Usuario = CntWinWeb.IsSomeoneLogged(this, ctx);
     if (Usuario == null)
     {
         Response.Redirect("Default.aspx");
     }
     else
     {
         Session["UsuarioId"] = Usuario.UsuarioId;
     }
     // si llega aquí está autorizado
     permiso = CntLainsaSci.GetPermiso(Usuario.GrupoUsuario, "UsuarioExtranetGrid", ctx);
     if (permiso == null)
     {
         RadNotification1.Text = String.Format("<b>{0}</b><br/>{1}",
                                               (string)GetGlobalResourceObject("ResourceLainsaSci", "Warning"),
                                               (string)GetGlobalResourceObject("ResourceLainsaSci", "NoPermissionsAssigned"));
         RadNotification1.Show();
         RadAjaxManager1.ResponseScripts.Add("closeWindow();");
     }
     if (Request.QueryString["Mode"] != null)
     {
         mode = Request.QueryString["Mode"];
     }
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
     }
     RadTabStrip1.Tabs[1].Visible = false;
     if (Request.QueryString["EmpresaId"] != null)
     {
         empresa = CntLainsaSci.GetEmpresa(int.Parse(Request.QueryString["EmpresaId"]), ctx);
     }
     if (Request.QueryString["RevisionId"] != null)
     {
         instalacion = CntLainsaSci.GetInstalacion(int.Parse(Request.QueryString["RevisionId"]), ctx);
     }
     if (Request.QueryString["UsuarioExtranetId"] != null)
     {
         usuarioExtranetId = int.Parse(Request.QueryString["UsuarioExtranetId"]);
         uext       = CntLainsaSci.GetUsuarioExtranet(usuarioExtranetId, ctx);
         this.Title = String.Format("Usuario: {0}", uext.Nombre);
     }
     // control de skin
     if (Session["Skin"] != null)
     {
         RadSkinManager1.Skin = Session["Skin"].ToString();
     }
 }
コード例 #10
0
        public static UsuarioExtranet LoginExtranet(string login, string password, LainsaSci ctx)
        {
            UsuarioExtranet uex = null;

            uex = CntLainsaSci.GetUsuarioExtranet(login, ctx);
            if (uex != null)
            {
                if (uex.Password != GetHashCode(password))
                {
                    uex = null;
                }
            }
            return(uex);
        }
コード例 #11
0
 protected void Page_Init(object sender, EventArgs e)
 {
     // it gets an appropiate context (LainsaSciCTX -> web.config)
     ctx = new LainsaSci("LainsaSciCTX");
     // verify if a Usuario is logged
     ctx = new LainsaSci("LainsaSciCTX"); // (LainsaSciCTX -> web.config)
     // Comprobar si hay un usuario logado
     if (Session["UsuarioExtranetId"] != null)
     {
         int id = (int)Session["UsuarioExtranetId"];
         usuarioextranet = CntLainsaSci.GetUsuarioExtranet(id, ctx);
         if (usuarioextranet == null)
         {
             Response.Redirect("Default.aspx");
         }
     }
     else
     {
         Response.Redirect("Default.aspx");
     }
     // Is it a new record or not?
     if (Request.QueryString["UsuarioExtranetId"] != null)
     {
         usuarioextranet = CntLainsaSci.GetUsuarioExtranet(int.Parse(Request.QueryString["UsuarioExtranetId"]), ctx);
         LoadData(usuarioextranet);
         newRecord = false;
     }
     else
     {
         if (instalacion != null)
         {
             rdcInstalacion.Items.Clear();
             rdcInstalacion.Items.Add(new RadComboBoxItem(instalacion.Nombre, instalacion.InstalacionId.ToString()));
             rdcInstalacion.SelectedValue = instalacion.InstalacionId.ToString();
             empresa = instalacion.Empresa;
         }
         if (empresa != null)
         {
             rdcEmpresa.Items.Clear();
             rdcEmpresa.Items.Add(new RadComboBoxItem(empresa.Nombre, empresa.EmpresaId.ToString()));
             rdcEmpresa.SelectedValue = empresa.EmpresaId.ToString();
         }
     }
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
         caller = caller.Replace("'", "");
     }
 }
コード例 #12
0
ファイル: Extranet.cs プロジェクト: rafaelgr/falck-sci
 public static IList <Empresa> GetEmpresas(UsuarioExtranet uex, LainsaSci ctx)
 {
     //if (uex.Global)
     //{
     //    return (from e in ctx.Empresas
     //            orderby e.Nombre
     //            select e).ToList<Empresa>();
     //}
     //else
     //{
     return((from e in ctx.Empresas
             where e.EmpresaId == uex.Empresa.EmpresaId
             select e).ToList <Empresa>());
     //}
 }
コード例 #13
0
ファイル: Extranet.cs プロジェクト: rafaelgr/falck-sci
 public static IList <Instalacion> GetInstalaciones(UsuarioExtranet uex, Empresa empresa, LainsaSci ctx)
 {
     if (uex.Instalacion == null)
     {
         return((from i in ctx.Instalacions
                 where i.Empresa.EmpresaId == empresa.EmpresaId
                 select i).ToList <Instalacion>());
     }
     else
     {
         return((from i in ctx.Instalacions
                 where i.Empresa.EmpresaId == empresa.EmpresaId &&
                 i.InstalacionId == uex.Instalacion.InstalacionId
                 select i).ToList <Instalacion>());
     }
 }
コード例 #14
0
 string caller   = ""; // who's calling the grid form
 #endregion
 #region Init, load, unload events
 protected void Page_Init(object sender, EventArgs e)
 {
     // it gets an appropiate context (LainsaSciCTX -> web.config)
     ctx = new LainsaSci("LainsaSciCTX");
     // verify if a Usuario is logged
     uex = CntLainsaSci.GetUsuarioExtranet((int)Session["UsuarioExtranetId"], ctx);
     if (uex == null)
     {
         Response.Redirect("Default.aspx");
     }
     if (Request.QueryString["MensajeId"] != null)
     {
         mensaje    = CntLainsaSci.GetMensaje(int.Parse(Request.QueryString["MensajeId"]), ctx);
         lblT2.Text = mensaje.Titulo;
         lblM2.Text = mensaje.Cuerpo;
     }
 }
コード例 #15
0
        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            // we only process commands with a datasource (our image buttons)
            if (e.CommandSource == null)
            {
                return;
            }
            string typeOfControl = e.CommandSource.GetType().ToString();

            if (typeOfControl.Equals("System.Web.UI.WebControls.ImageButton"))
            {
                int         id   = 0;
                ImageButton imgb = (ImageButton)e.CommandSource;
                if (imgb.ID != "New" && imgb.ID != "Exit")
                {
                    id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];
                }
                switch (imgb.ID)
                {
                case "Select":
                    break;

                case "Edit":
                    break;

                case "Delete":
                    try
                    {
                        UsuarioExtranet uex = CntLainsaSci.GetUsuarioExtranet(id, ctx);
                        CntLainsaSci.CTXEliminar(uex, ctx);
                        CntLainsaSci.CTXGuardar(ctx);
                        RefreshGrid(true);
                    }
                    catch (Exception ex)
                    {
                        ControlDeError(ex);
                    }
                    break;
                }
            }
        }
コード例 #16
0
 protected void btnAceptar_Click(object sender, EventArgs e)
 {
     uex = CntAutenticacion.LoginExtranet(txtLogin.Text, txtPassword.Text, ctx);
     if (uex != null)
     {
         // grabar Id de usario en la sesion
         Session["UsuarioExtranetId"] = uex.UsuarioExtranetId;
         // montamos el directorio personal
         string userDir = MapPath("/") + "Docs\\A" + String.Format("{0:000000}", uex.UsuarioExtranetId);
         CntWinWeb.PrepareUserFolder(userDir);
         Session["UsuarioDir"] = userDir;
         RadAjaxManager1.ResponseScripts.Add("window.open('MainPage.aspx');");
         // Response.Redirect("MainPage.aspx");
     }
     else
     {
         // mostramos error en el login
         string mensaje = (string)GetGlobalResourceObject("LainsaSciExtranet", "FalloLogin");
         RadWindowManager1.RadAlert(mensaje, null, null, "Login EXTRANET", "noHaceNada");
     }
 }
コード例 #17
0
 protected void LoadData(UsuarioExtranet usuarioext)
 {
     txtUsuarioId.Text = usuarioext.UsuarioExtranetId.ToString();
     txtNombre.Text    = usuarioext.Nombre;
     // Cargar el grupo al que pertenece el usuario
     if (usuarioext.Empresa != null)
     {
         rdcEmpresa.Items.Clear();
         rdcEmpresa.Items.Add(new RadComboBoxItem(usuarioext.Empresa.Nombre, usuarioext.Empresa.EmpresaId.ToString()));
         rdcEmpresa.SelectedValue = usuarioext.Empresa.EmpresaId.ToString();
     }
     if (usuarioext.Instalacion != null)
     {
         rdcInstalacion.Items.Clear();
         rdcInstalacion.Items.Add(new RadComboBoxItem(usuarioext.Instalacion.Nombre, usuarioext.Instalacion.InstalacionId.ToString()));
         rdcInstalacion.SelectedValue = usuarioext.Instalacion.InstalacionId.ToString();
     }
     // Asignar el Login
     txtLogin.Text = usuarioext.Login;
     txtEmail.Text = usuarioext.Correo;
 }
コード例 #18
0
    UsuarioExtranet uex = null; // usuario logado
    #endregion
    #region Eventos iniciales de carga de página
    protected void Page_Init(object sender, EventArgs e)
    {
        // lo primero es cargar el contexto
        ctx = new LainsaSci("LainsaSciCTX"); // (LainsaSciCTX -> web.config)
        // Comprobar si hay un usuario logado
        if (Session["UsuarioExtranetId"] != null)
        {
            int id = (int)Session["UsuarioExtranetId"];
            uex = CntLainsaSci.GetUsuarioExtranet(id, ctx);
            if (uex == null)
            {
                Response.Redirect("Default.aspx");
            }
        }
        else
        {
            Response.Redirect("Default.aspx");
        }
        // mostrar la versión del programa
        String strVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

        LblTituloDerechoInferior.Text = String.Format("VRS {0}", strVersion);
    }
コード例 #19
0
 protected void Page_Init(object sender, EventArgs e)
 {
     // it gets an appropiate context (LainsaSciCTX -> web.config)
     ctx = new LainsaSci("LainsaSciCTX");
     // verify if a Usuario is logged
     uex = CntLainsaSci.GetUsuarioExtranet((int)Session["UsuarioExtranetId"], ctx);
     if (uex == null)
     {
         Response.Redirect("Default.aspx");
     }
     // si llega aquí está autorizado
     if (Request.QueryString["EmpresaId"] != null)
     {
         empresaId = int.Parse(Request.QueryString["EmpresaId"]);
         empresa   = CntLainsaSci.GetEmpresa(empresaId, ctx);
     }
     if (Request.QueryString["CategoriaId"] != null)
     {
         categoriaId = int.Parse(Request.QueryString["CategoriaId"]);
         categoria   = CntLainsaSci.GetCategoria(categoriaId, ctx);
     }
     if (Request.QueryString["InstalacionId"] != null)
     {
         instalacionId = int.Parse(Request.QueryString["InstalacionId"]);
         instalacion   = CntLainsaSci.GetInstalacion(instalacionId, ctx);
     }
     if (Request.QueryString["SubCategoriaId"] != null)
     {
         subCategoriaId = int.Parse(Request.QueryString["SubCategoriaId"]);
         subCategoria   = CntLainsaSci.GetSubcategoria(subCategoriaId, ctx);
     }
     if (Request.QueryString["REVISION"] != null)
     {
         revisables = true;
     }
 }
コード例 #20
0
ファイル: Extranet.cs プロジェクト: rafaelgr/falck-sci
        public static IList <Documento> GetDocumentos(Instalacion instalacion, UsuarioExtranet uex, LainsaSci ctx)
        {
            IList <Documento> ldocs2 = new List <Documento>();
            IList <Documento> ldocs  = (from d in ctx.Documentos
                                        where d.Instalacion.InstalacionId == instalacion.InstalacionId
                                        select d).ToList <Documento>();

            //if (uex.Global)
            //{
            //    foreach (Documento d in ldocs)
            //    {
            //        foreach (PermisoCategoria pc in uex.PermisoCategorias)
            //        {
            //            if (d.Categoria.CategoriaId == pc.Categoria.CategoriaId) ldocs2.Add(d);
            //        }
            //    }

            //}
            //else
            //{
            ldocs2 = ldocs;
            //}
            return(ldocs2);
        }
コード例 #21
0
        protected void btnGenerar_Click(object sender, ImageClickEventArgs e)
        {
            string jCommand = "";

            if (!DataOk())
            {
                return;
            }
            if (newRecord)
            {
                usuarioextranet = new UsuarioExtranet();
            }
            UnloadData(usuarioextranet);

            //string pass = CntLainsaSci.CreateRandomPassword(10);
            string pass = "******";

            usuarioextranet.Password      = CntAutenticacion.GetHashCode(pass);
            usuarioextranet.PlainPassword = pass;
            if (newRecord)
            {
                ctx.Add(usuarioextranet);
            }
            ctx.SaveChanges();
            string nomempresa = "";
            string calle      = "";
            string cPostal    = "";
            string poblacion  = "";
            string provincia  = "";
            string pais       = "";

            if (usuarioextranet.Empresa != null)
            {
                nomempresa = usuarioextranet.Empresa.Nombre;
                Direccion dir = usuarioextranet.Empresa.Direcciones[0];
                calle     = dir.DirPostal;
                poblacion = dir.Poblacion;
                cPostal   = dir.CodPostal;
                provincia = dir.Provincia;
                pais      = dir.Pais;
            }
            if (usuarioextranet.Instalacion != null)
            {
                Direccion dir = usuarioextranet.Instalacion.Direcciones[0];
                calle     = dir.DirPostal;
                poblacion = dir.Poblacion;
                cPostal   = dir.CodPostal;
                provincia = dir.Provincia;
                pais      = dir.Pais;
            }
            //-- Ahora llamar a la plantilla de carta.
            //Plantilla pl = CntLainsaSci.GetPlantilla(1, ctx);

            //string contenido = String.Format(pl.Contenido,
            //                                 usuarioextranet.Nombre,
            //                                 calle,
            //                                 cPostal,
            //                                 poblacion,
            //                                 String.Format("{0:dd/MM/yyyy}", DateTime.Now),
            //                                 usuarioextranet.Login,
            //                                 usuarioextranet.PlainPassword,
            //                                 nomempresa,
            //                                 provincia,
            //                                 pais);
            //Session["Plantilla"] = contenido;
            //jCommand = "abrirPlantilla();";
            //RadAjaxManager1.ResponseScripts.Add(jCommand);
            //RadAjaxManager1.ResponseScripts.Add("var w1 = window.open('VisorInformeForm.aspx?PlantillaId=1', 'PLANTILLA', 'width=800, height=600,resizable=1'); w1.focus();");
            //-- Y seguir como si fuera aceptar.
            if (newRecord)
            {
                jCommand = String.Format("closeWindowRefreshGrid('{0}', 'new');", caller);
                RadAjaxManager1.ResponseScripts.Add(jCommand);
            }
            else
            {
                jCommand = String.Format("closeWindowRefreshGrid('{0}', 'edit');", caller);
                RadAjaxManager1.ResponseScripts.Add(jCommand);
            }
        }
コード例 #22
0
        protected void Page_Init(object sender, EventArgs e)
        {
            // it gets an appropiate context (LainsaSciCTX -> web.config)
            ctx = new LainsaSci("LainsaSciCTX");
            // verify if a Usuario is logged
            usuariolog = CntWinWeb.IsSomeoneLogged(this, ctx);
            if (usuariolog == null)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                Session["UsuarioId"] = usuariolog.UsuarioId;
            }
            //
            permiso = CntLainsaSci.GetPermiso(usuariolog.GrupoUsuario, "usuarioextranetgrid", ctx);
            if (permiso == null)
            {
                RadNotification1.Text = String.Format("<b>{0}</b><br/>{1}",
                                                      (string)GetGlobalResourceObject("ResourceLainsaSci", "Warning"),
                                                      (string)GetGlobalResourceObject("ResourceLainsaSci", "NoPermissionsAssigned"));
                RadNotification1.Show();
                RadAjaxManager1.ResponseScripts.Add("closeWindow();");
            }
            btnAccept.Visible = permiso.Modificar;

            if (Request.QueryString["EmpresaId"] != null)
            {
                empresa = CntLainsaSci.GetEmpresa(int.Parse(Request.QueryString["EmpresaId"]), ctx);
            }
            if (Request.QueryString["RevisionId"] != null)
            {
                instalacion = CntLainsaSci.GetInstalacion(int.Parse(Request.QueryString["RevisionId"]), ctx);
            }
            // Is it a new record or not?
            if (Request.QueryString["UsuarioExtranetId"] != null)
            {
                usuarioextranet = CntLainsaSci.GetUsuarioExtranet(int.Parse(Request.QueryString["UsuarioExtranetId"]), ctx);
                LoadData(usuarioextranet);
                newRecord = false;
            }
            else
            {
                if (instalacion != null)
                {
                    rdcInstalacion.Items.Clear();
                    rdcInstalacion.Items.Add(new RadComboBoxItem(instalacion.Nombre, instalacion.InstalacionId.ToString()));
                    rdcInstalacion.SelectedValue = instalacion.InstalacionId.ToString();
                    empresa = instalacion.Empresa;
                }
                if (empresa != null)
                {
                    rdcEmpresa.Items.Clear();
                    rdcEmpresa.Items.Add(new RadComboBoxItem(empresa.Nombre, empresa.EmpresaId.ToString()));
                    rdcEmpresa.SelectedValue = empresa.EmpresaId.ToString();
                }
            }
            if (Request.QueryString["Caller"] != null)
            {
                caller = Request.QueryString["Caller"];
                caller = caller.Replace("'", "");
            }
        }