Example #1
0
        /// <summary>
        /// Elimina un expediente de la tabla Facturas por una llave primaria compuesta.
        /// </summary>
        //public bool Delete(string CodigoUsuario,string CodigoRol)
        //{
        //    int CodigoRetorno = -1;
        //    try
        //    {
        //        using (_DBMLSeguridadSistemaDataContext SeguridadDC = new _DBMLSeguridadSistemaDataContext(conexion))
        //        {
        //            CodigoRetorno = SeguridadDC.omgc_mnt_Delete_UsuarioRol(CodigoUsuario, CodigoRol);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    return CodigoRetorno == 0 ? true : false;
        //}

        public bool DeleteWS(int codUsuarioRol)
        {
            bool blnResult = false;

            try
            {
                using (_DBMLSeguridadSistemaDataContext SeguridadDC = new _DBMLSeguridadSistemaDataContext(conexion))
                {
                    var resulSet = SeguridadDC.usp_sis_D_UsuarioRol(codUsuarioRol);
                    foreach (var item in resulSet)
                    {
                        blnResult = item.desMessage == "OK" ? true : false;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(blnResult);
        }