protected void btnGuardar_Click(object sender, EventArgs e)
        {
            XElement vFunciones = new XElement("FUNCIONES");

            grdMenuGeneral.ExpandAllItems();    //SE EXPANDEN LOS NODOS PARA OBTENER LA SELECCIÓN DE TODOS LOS NODOS QUE VISUALMENTE ESTÁN OCULTOS
            vFunciones.Add(grdMenuGeneral.SelectedItems.Select(i => new XElement("FUNCION", new XAttribute("ID_FUNCION", ((TreeListDataItem)i).GetDataKeyValue("ID_FUNCION").ToString()))));

            grdMenuModulos.ExpandAllItems();    //SE EXPANDEN LOS NODOS PARA OBTENER LA SELECCIÓN DE TODOS LOS NODOS QUE VISUALMENTE ESTÁN OCULTOS
            vFunciones.Add(grdMenuModulos.SelectedItems.Select(i => new XElement("FUNCION", new XAttribute("ID_FUNCION", ((TreeListDataItem)i).GetDataKeyValue("ID_FUNCION").ToString()))));

            grdMenuAdicionales.ExpandAllItems();    //SE EXPANDEN LOS NODOS PARA OBTENER LA SELECCIÓN DE TODOS LOS NODOS QUE VISUALMENTE ESTÁN OCULTOS
            vFunciones.Add(grdMenuAdicionales.SelectedItems.Select(i => new XElement("FUNCION", new XAttribute("ID_FUNCION", ((TreeListDataItem)i).GetDataKeyValue("ID_FUNCION").ToString()))));

            SPE_OBTIENE_C_ROL_Result vRol = new SPE_OBTIENE_C_ROL_Result
            {
                CL_ROL           = txtClRol.Text,
                FG_ACTIVO        = chkActivo.Checked,
                NB_ROL           = txtNbRol.Text,
                XML_AUTORIZACION = vFunciones.ToString()
            };

            if (vClOperacion.Equals(E_TIPO_OPERACION_DB.A) && vIdRol != null)
            {
                vRol.ID_ROL = (int)vIdRol;
            }

            RolNegocio nRol = new RolNegocio();

            E_RESULTADO vResultado = nRol.InsertaActualizaRoles(vClOperacion, vRol, vFunciones, vClUsuario, vNbPrograma);
            string      vMensaje   = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE;

            UtilMensajes.MensajeResultadoDB(rwmAlertas, vMensaje, vResultado.CL_TIPO_ERROR);
        }
Beispiel #2
0
        //#region INSERTA ACTUALIZA DATOS  C_ROL
        //public int InsertaActualiza_C_ROL(string tipo_transaccion, SPE_OBTIENE_C_ROL_Result V_C_ROL, string usuario, string programa)
        //{
        //    RolOperaciones operaciones = new RolOperaciones();
        //    return operaciones.InsertaActualiza_C_ROL(tipo_transaccion, V_C_ROL, usuario, programa);
        //}

        public E_RESULTADO InsertaActualizaRoles(E_TIPO_OPERACION_DB pClTipoOperacion, SPE_OBTIENE_C_ROL_Result pRol, XElement pXmlFunciones, string pClUsuario, string pNbPrograma)
        {
            RolOperaciones oRol = new RolOperaciones();

            return(UtilRespuesta.EnvioRespuesta(oRol.InsertarActualizarRoles(pClTipoOperacion, pRol, pXmlFunciones, pClUsuario, pNbPrograma)));
        }
 public XElement InsertarActualizarRoles(E_TIPO_OPERACION_DB pClTipoOperacion, SPE_OBTIENE_C_ROL_Result pRol, XElement pXmlFunciones, string pClUsuario, string pNbPrograma)
 {
     using (context = new ACRUXLICENCIAMIENTOEntities())
     {
         ObjectParameter pOutClRetorno = new ObjectParameter("XML_RESULTADO", typeof(XElement));
         context.SPE_INSERTA_ACTUALIZA_ROLES(pOutClRetorno, pRol.ID_ROL, pRol.CL_ROL, pRol.NB_ROL, pRol.FG_ACTIVO, pXmlFunciones.ToString(), pClUsuario, pNbPrograma, pClTipoOperacion.ToString());
         return(XElement.Parse(pOutClRetorno.Value.ToString()));
     }
 }