Example #1
0
    protected void rcbInstalacion_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        rcbTipoDispositivo.Items.Clear();
        Instalacion inst = CntLainsaSci.GetInstalacion(int.Parse(rcbInstalacion.SelectedValue), ctx);

        if (inst != null)
        {
            rcbTipoDispositivo.Items.Add(new RadComboBoxItem("", RCD_EMPTY));
            rcbTipoDispositivo.Items.Add(new RadComboBoxItem("Todos", RCD_ALL));
            IList <TipoDispositivo> tipos = new List <TipoDispositivo>();
            foreach (Dispositivo disp in inst.Dispositivos)
            {
                if (!tipos.Contains(disp.TipoDispositivo))
                {
                    tipos.Add(disp.TipoDispositivo);
                    rcbTipoDispositivo.Items.Add(new RadComboBoxItem(disp.TipoDispositivo.Nombre, disp.TipoDispositivo.TipoId.ToString()));
                }
            }
            rcbTipoDispositivo.Items[0].Selected = true;
        }
        else
        {
            CargarTiposDispositivo(CntLainsaSci.GetEmpresa(int.Parse(rcbEmpresa.SelectedValue), ctx));
        }
    }
Example #2
0
 protected void UnloadData(Usuario usuario)
 {
     usuario.Nombre = txtNombre.Text;
     // Grupo de usuario asociado
     usuario.GrupoUsuario = CntLainsaSci.GetGrupoUsuario(int.Parse(rdcGrupo.SelectedValue), ctx);
     usuario.Login        = txtLogin.Text;
     if (rdcInstalacion.SelectedValue != "")
     {
         // La instalación marca la empresa
         instalacion = CntLainsaSci.GetInstalacion(int.Parse(rdcInstalacion.SelectedValue), ctx);
         if (instalacion != null)
         {
             usuario.Instalacion = instalacion;
             usuario.Empresa     = instalacion.Empresa;
         }
     }
     else
     {
         if (rdcEmpresa.SelectedValue != "")
         {
             empresa             = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
             usuario.Empresa     = empresa;
             usuario.Instalacion = null;
         }
     }
     if (txtPassword.Text != "")
     {
         usuario.Password = CntAutenticacion.GetHashCode(txtPassword.Text);
     }
 }
Example #3
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);
     }
 }
 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, "Instalaciongrid", 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["InTab"] != null)
     {
         inTab = Request.QueryString["InTab"];
     }
     // Si esto no va antes de InstalacionID tendrás problemas.
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
         caller = caller.Replace("'", "");
     }
     // Mirar si se ha pasado una empresa
     if (Request.QueryString["EmpresaId"] != null)
     {
         empresa = CntLainsaSci.GetEmpresa(int.Parse(Request.QueryString["EmpresaId"]), ctx);
         CargaEmpresa(empresa);
     }
     // Is it a new record or not?
     if (Request.QueryString["RevisionId"] != null)
     {
         instalacion = CntLainsaSci.GetInstalacion(int.Parse(Request.QueryString["RevisionId"]), ctx);
         LoadData(instalacion);
         this.Title = String.Format("Instalacion: {0}", instalacion.Nombre);
         newRecord  = false;
     }
     else
     {
         CargarEmpresas(null);
     }
     // control de skin
     if (Session["Skin"] != null)
     {
         RadSkinManager1.Skin = Session["Skin"].ToString();
     }
 }
Example #5
0
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            // es llamado desde la selección de una empresa
            Empresa empresa = CntLainsaSci.GetEmpresa(int.Parse(e.Argument), ctx);

            CargaInstalaciones(empresa);
        }
Example #6
0
 protected void rdcEmpresa_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
 {
     if (e.Value != "")
     {
         empresa = CntLainsaSci.GetEmpresa(int.Parse(e.Value), ctx);
         RefreshGrid(true);
     }
 }
Example #7
0
 protected void rdcEmpresa_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
 {
     if (e.Value != "")
     {
         Empresa empresa = CntLainsaSci.GetEmpresa(int.Parse(e.Value), ctx);
         CargaInstalaciones(empresa);
     }
 }
Example #8
0
 protected void UnloadData(Terminal Terminal)
 {
     terminal.Empresa       = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     terminal.Observaciones = txtComentarios.Text;
     terminal.Nombre        = txtNombre.Text;
     txtNombre.Text         = terminal.Nombre;
     terminal.NumeroSerie   = txtNumeroSerie.Text;
     terminal.Tipo          = rdcTipo.SelectedValue;
 }
        public RptResumenEmpresaInstalacion(DateTime desdeFecha, DateTime hastaFecha, int empresaId, int instalacionId, LainsaSci ctx)
            : this()
        {
            Instalacion instalacion = null;

            instalacion     = CntLainsaSci.GetInstalacion(instalacionId, ctx);
            empresa         = CntLainsaSci.GetEmpresa(empresaId, ctx);
            this.DataSource = CntInforme.GetEmpresaInstalacionView(desdeFecha, hastaFecha, empresa, instalacion, false, ctx);
        }
Example #10
0
        public RptResumenEmpresaTipoDispositivo(DateTime desdeFecha, DateTime hastaFecha, int empresaId, int tipoId, LainsaSci ctx)
            : this()
        {
            TipoDispositivo tipo = null;

            tipo            = CntLainsaSci.GetTipoDispositivo(tipoId, ctx);
            empresa         = CntLainsaSci.GetEmpresa(empresaId, ctx);
            this.DataSource = CntInforme.GetEmpresaTipoView(desdeFecha, hastaFecha, empresa, tipo, false, ctx);
        }
Example #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
     usuario = CntWinWeb.IsSomeoneLogged(this, ctx);
     if (usuario == null)
     {
         Response.Redirect("Default.aspx");
     }
     else
     {
         Session["UsuarioId"] = usuario.UsuarioId;
     }
     // Is it a new record or not?
     if (Request.QueryString["EmailId"] != null)
     {
         email = CntLainsaSci.GetEmail(int.Parse(Request.QueryString["EmailId"].ToString()), ctx);
         LoadData(email);
         empresa     = email.Empresa;
         instalacion = email.Instalacion;
         newRecord   = false;
     }
     else
     {
         if (Request.QueryString["EmpresaId"] != null)
         {
             int empresaId = int.Parse(Request.QueryString["EmpresaId"]);
             empresa             = CntLainsaSci.GetEmpresa(empresaId, ctx);
             lblPropietario.Text = "EMPRESA";
             txtPropietario.Text = empresa.Nombre;
         }
         if (Request.QueryString["RevisionId"] != null)
         {
             int instalacionId = int.Parse(Request.QueryString["RevisionId"]);
             instalacion         = CntLainsaSci.GetInstalacion(instalacionId, ctx);
             lblPropietario.Text = "INSTALACION";
             txtPropietario.Text = instalacion.Nombre;
         }
         if (empresa == null && instalacion == null)
         {
             RadNotification1.Text = String.Format("<b>{0}</b><br/>{1}",
                                                   (string)GetGlobalResourceObject("ResourceLainsaSci", "Warning"),
                                                   (string)GetGlobalResourceObject("ResourceLainsaSci", "EmailWithoutOwner"));
             RadNotification1.Show();
         }
     }
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
     }
     // control de skin
     if (Session["Skin"] != null)
     {
         RadSkinManager1.Skin = Session["Skin"].ToString();
     }
 }
Example #12
0
 protected void RefreshGrid(bool rebind)
 {
     empresa             = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     RadGrid1.DataSource = CntLainsaSci.GetProgramas(empresa, usuario, ctx);
     if (rebind)
     {
         RadGrid1.Rebind();
     }
 }
Example #13
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;
     }
     // -- no hya tratamiento de permisos
     //permiso = CntLainsaSci.GetPermiso(Usuario.GrupoUsuario, "grupousuariogrid", 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();");
     //}
     CntWinWeb.TranslateRadGridFilters(RadGrid1);
     if (Request.QueryString["Mode"] != null)
     {
         mode = Request.QueryString["Mode"];
     }
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
     }
     if (Request.QueryString["EmpresaId"] != null)
     {
         int empresaId = int.Parse(Request.QueryString["EmpresaId"]);
         empresa = CntLainsaSci.GetEmpresa(empresaId, ctx);
     }
     if (Request.QueryString["RevisionId"] != null)
     {
         int instalacionId = int.Parse(Request.QueryString["RevisionId"]);
         instalacion = CntLainsaSci.GetInstalacion(instalacionId, ctx);
     }
     if (empresa == null && instalacion == null)
     {
         RadNotification1.Text = String.Format("<b>{0}</b><br/>{1}",
                                               (string)GetGlobalResourceObject("ResourceLainsaSci", "Warning"),
                                               (string)GetGlobalResourceObject("ResourceLainsaSci", "TelephoneWithoutOwner"));
         RadNotification1.Show();
     }
     // control de skin
     if (Session["Skin"] != null)
     {
         RadSkinManager1.Skin = Session["Skin"].ToString();
     }
 }
Example #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
     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, "documentogrid", 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();");
     }
     CntWinWeb.TranslateRadGridFilters(RadGrid1);
     if (Request.QueryString["Mode"] != null)
     {
         mode = Request.QueryString["Mode"];
     }
     if (Request.QueryString["Caller"] != null)
     {
         caller = Request.QueryString["Caller"];
     }
     if (Request.QueryString["EmpresaId"] != null)
     {
         empresa = CntLainsaSci.GetEmpresa(int.Parse(Request.QueryString["EmpresaId"]), ctx);
         if (empresa != null)
         {
             RadGrid1.Columns.FindByDataField("Empresa.Nombre").Visible = false;
         }
     }
     if (Request.QueryString["RevisionId"] != null)
     {
         instalacion = CntLainsaSci.GetInstalacion(int.Parse(Request.QueryString["RevisionId"]), ctx);
         if (instalacion != null)
         {
             RadGrid1.Columns.FindByDataField("Empresa.Nombre").Visible     = false;
             RadGrid1.Columns.FindByDataField("Instalacion.Nombre").Visible = false;
         }
     }
     // control de skin
     if (Session["Skin"] != null)
     {
         RadSkinManager1.Skin = Session["Skin"].ToString();
     }
 }
        public RptFacturableEmpresaInstalacion(DateTime desdeFecha, DateTime hastaFecha, int empresaId, int instId, LainsaSci ctx)
            : this()
        {
            Instalacion instalacion = null;

            if (instId != -1)
            {
                instalacion = CntLainsaSci.GetInstalacion(instId, ctx);
            }
            empresa         = CntLainsaSci.GetEmpresa(empresaId, ctx);
            this.DataSource = CntInforme.GetEmpresaInstalacionView(desdeFecha, hastaFecha, empresa, instalacion, true, ctx);
        }
Example #16
0
        public RptFacturableEmpresaTipoDispositivo(DateTime desdeFecha, DateTime hastaFecha, int empresaId, int tipoId, LainsaSci ctx)
            : this()
        {
            TipoDispositivo tipo = null;

            if (tipoId != -1)
            {
                tipo = CntLainsaSci.GetTipoDispositivo(tipoId, ctx);
            }
            empresa         = CntLainsaSci.GetEmpresa(empresaId, ctx);
            this.DataSource = CntInforme.GetEmpresaTipoView(desdeFecha, hastaFecha, empresa, tipo, true, ctx);
        }
 protected void UnloadData(Responsable responsable)
 {
     responsable.Nombre = txtNombre.Text;
     if (rdcEmpresa.SelectedValue != "")
     {
         responsable.Empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     }
     else
     {
         responsable.Empresa = null;
     }
 }
Example #18
0
 protected void UnloadData(Prioridad prioridad)
 {
     prioridad.Nombre = txtNombre.Text;
     if (rdcEmpresa.SelectedValue != "")
     {
         prioridad.Empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     }
     else
     {
         prioridad.Empresa = null;
     }
 }
Example #19
0
 protected bool DatosOk()
 {
     fechaActa = (DateTime)rdtFechaActa.SelectedDate;
     if (rcbInstalacion.SelectedValue != "")
     {
         instalacion = CntLainsaSci.GetInstalacion(int.Parse(rcbInstalacion.SelectedValue), ctx);
     }
     emp                = CntLainsaSci.GetEmpresa(int.Parse(rcbEmpresa.SelectedValue), ctx);
     actaNumero         = txtActaNumero.Text;
     observaciones      = txtObservaciones.Text;
     tecnicoResponsable = CntLainsaSci.GetUsuario(int.Parse(rcbUsuario.SelectedValue), ctx);
     return(true);
 }
Example #20
0
 protected void UnloadData(Estado estado)
 {
     estado.Nombre     = txtNombre.Text;
     estado.EnApertura = chkEnApertura.Checked;
     estado.EnCierre   = chkEnCierre.Checked;
     if (rdcEmpresa.SelectedValue != "")
     {
         estado.Empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     }
     else
     {
         estado.Empresa = null;
     }
 }
Example #21
0
 protected void rdcEmpresa_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
 {
     if (rdcEmpresa.SelectedValue != "")
     {
         empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
         rdcInstalacion.Items.Clear();
         if (empresa != null)
         {
             foreach (Instalacion ins in empresa.Instalaciones)
             {
                 rdcInstalacion.Items.Add(new RadComboBoxItem(ins.Nombre, ins.InstalacionId.ToString()));
             }
         }
     }
 }
 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);
     }
 }
Example #23
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, "EmpresaGrid", 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"];
     }
     if (Request.QueryString["EmpresaId"] != null)
     {
         empresaId  = int.Parse(Request.QueryString["EmpresaId"]);
         this.Title = String.Format("Empresa: {0}", CntLainsaSci.GetEmpresa(empresaId, ctx).Nombre);
     }
     else
     {
         CntWinWeb.OcultarPestanyas(RadTabStrip1);
     }
     // control de skin
     if (Session["Skin"] != null)
     {
         RadSkinManager1.Skin = Session["Skin"].ToString();
     }
 }
 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);
     }
 }
Example #25
0
 protected void UnloadData(ModeloDispositivo modelo)
 {
     modelo.Nombre = txtNombre.Text;
     if (rdcEmpresa.SelectedValue != "")
     {
         modelo.Empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     }
     if (rdcInstalacion.SelectedValue != "")
     {
         modelo.Instalacion = CntLainsaSci.GetInstalacion(int.Parse(rdcInstalacion.SelectedValue), ctx);
         modelo.Empresa     = modelo.Instalacion.Empresa;
     }
     if (rdcTipo.SelectedValue != "")
     {
         modelo.TipoDispositivo = CntLainsaSci.GetTipoDispositivo(int.Parse(rdcTipo.SelectedValue), ctx);
     }
 }
Example #26
0
 protected void btnLanzador_Click(object sender, EventArgs e)
 {
     btnLanzador.Enabled = false;
     using (ctx)
     {
         empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
         if (empresa != null)
         {
             if (ExportarTerminal(empresa, GetSelectedItems()))
             {
                 GuardarTerminal();
             }
             Session["selectedItems"] = null;
             RefreshGrid(true);
         }
     }
     btnLanzador.Enabled = true;
 }
Example #27
0
 protected void UnloadData(TipoDispositivo tipo)
 {
     tipo.Nombre = txtNombre.Text;
     if (rdcEmpresa.SelectedValue != "")
     {
         tipo.Empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     }
     if (rdcInstalacion.SelectedValue != "")
     {
         tipo.Instalacion = CntLainsaSci.GetInstalacion(int.Parse(rdcInstalacion.SelectedValue), ctx);
         tipo.Empresa     = tipo.Instalacion.Empresa;
     }
     tipo.Caduca = (int)txtCaducidad.Value;
     if (antCaduca != 0 && antCaduca != tipo.Caduca)
     {
         CntLainsaSci.CambioCaducidad(tipo.Caduca, tipo, ctx);
     }
 }
Example #28
0
 protected void CargaComboEmpresa()
 {
     rdcEmpresa.Items.Clear();
     if (usuario == null)
     {
         return;
     }
     foreach (Empresa emp in CntLainsaSci.GetEmpresas(usuario, ctx))
     {
         rdcEmpresa.Items.Add(new RadComboBoxItem(emp.Nombre, emp.EmpresaId.ToString()));
     }
     if (rdcEmpresa.Items.Count > 0)
     {
         rdcEmpresa.Items[0].Selected = true;
         empresa = CntLainsaSci.GetEmpresa(int.Parse(rdcEmpresa.SelectedValue), ctx);
     }
     //rcbEmpresa.Text = "";
 }
Example #29
0
    protected void CargarInstalaciones(RadTreeNode node)
    {
        if (node.Category != "Empresa")
        {
            return;
        }
        Empresa empresa = CntLainsaSci.GetEmpresa(int.Parse(node.Value), ctx);

        if (empresa == null)
        {
            return;
        }
        if (uex.Instalacion != null)
        {
            if (uex.Instalacion.Empresa.EmpresaId != empresa.EmpresaId)
            {
                return;
            }
            else
            {
                node.Nodes.Clear();
                Instalacion instalacion = uex.Instalacion;
                RadTreeNode childNode   = new RadTreeNode(instalacion.Nombre);
                childNode.Category = "Instalacion";
                childNode.Value    = instalacion.InstalacionId.ToString();
                childNode.ImageUrl = "imagenes/factory_16.png";
                node.Nodes.Add(childNode);
            }
        }
        else
        {
            node.Nodes.Clear();
            // cargamos todas las categoras
            foreach (Instalacion instalacion in empresa.Instalaciones)
            {
                RadTreeNode childNode = new RadTreeNode(instalacion.Nombre);
                childNode.Category = "Instalacion";
                childNode.Value    = instalacion.InstalacionId.ToString();
                childNode.ImageUrl = "imagenes/factory_16.png";
                node.Nodes.Add(childNode);
            }
        }
    }
Example #30
0
 protected void CargaComboEmpresa(Usuario usu)
 {
     rcbEmpresa.Items.Clear();
     if (usu == null)
     {
         return;
     }
     foreach (Empresa emp in CntLainsaSci.GetEmpresas(usu, ctx))
     {
         rcbEmpresa.Items.Add(new RadComboBoxItem(emp.Nombre, emp.EmpresaId.ToString()));
     }
     if (rcbEmpresa.Items.Count > 0)
     {
         rcbEmpresa.Items[0].Selected = true;
         Empresa empresa = CntLainsaSci.GetEmpresa(int.Parse(rcbEmpresa.SelectedValue), ctx);
         CargaInstalaciones(empresa);
         CargarTiposDispositivo(empresa);
     }
     //rcbEmpresa.Text = "";
 }