WEbReference https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc
Codigo C#
ConsultaCFDI.ConsultaCFDIServiceClient oConsulta = new ConsultaCFDIServiceClient();
ConsultaCFDI.Acuse oAcuse = new Acuse();
oAcuse=oConsulta.Consulta("?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075");
MessageBox.Show("Estatus " + oAcuse.CodigoEstatus + " Estado: " + oAcuse.Estado);
Si te interesa hacer algo mas, un desarrollo integración de CFDI o validador de facturas de proveedores -> josmisu_@hotmail.com
Un poco de C#,JScript,VB, y CRM, Drupal, SQL , MSDCRM y MSDSL VBTools, developer, project lider, Social Media Activist, BlackBerry developer, telerik tools. (MCITP)
jueves, 6 de febrero de 2014
Validar UUID del SAT
Etiquetas:
CFDI,
https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc,
SAT,
UUID,
VALIDA CFD,
VALIDA CFDI,
VALIDA FACTURA,
VALIDA SAT
miércoles, 5 de febrero de 2014
Cómo leer Archivo de LCO del SAT
Function FileToString(ByVal filePath As String) As String
Dim f As FileStream
f = New FileStream(filePath, FileMode.Open, FileAccess.Read)
Dim streamLength As Integer = Convert.ToInt32(f.Length)
Dim fileData As Byte() = New Byte(streamLength) {}
f.Read(fileData, 0, streamLength)
f.Close()
Return System.Text.Encoding.Default.GetString(fileData)
End Function
Private Function LimpiaLCO(ByVal sPath As String, ByVal sFile As String) As String
Dim RutaLCO As [String] = sPath
Dim xmlLCO As String = RutaLCO & sFile
'Dim objReader As New StreamReader(xmlLCO)
Dim sRes As String = FileToString(xmlLCO) 'objReader.ReadToEnd()
Dim posIni As Integer = sRes.LastIndexOf("<?xml", System.StringComparison.Ordinal)
Dim posFin As Integer = sRes.LastIndexOf("</lco:LCO>", System.StringComparison.Ordinal)
sRes = sRes.Substring(posIni, posFin)
posFin = sRes.LastIndexOf("</lco:LCO>", System.StringComparison.Ordinal)
sRes = sRes.Substring(0, posFin)
Dim SW As StreamWriter
Dim origName = xmlLCO.Remove(xmlLCO.Length - 4)
origName += "Clean.XML"
SW = File.CreateText(sPath)
SW.WriteLine(sRes)
SW.WriteLine("</lco:LCO>")
SW.Close()
Return origName
End Function
Private Shared Sub LoadLco(ByVal sPathFileLCO_Clean As String)
'Dim RutaLCO As [String] = sPath
Dim xmlLCO As String = sPathFileLCO_Clean ' RutaLCO & sfileClean
'Cargamos XML
Dim xdoc As XDocument = XDocument.Load(xmlLCO)
'Query
Dim LCO = From Contribuyente In xdoc.Descendants("Contribuyente") _
Select New With {Key .RFC = Contribuyente.Attribute("RFC").Value, _
Key .Certificados = Contribuyente.Descendants("Certificado")}
'Resultado
For Each Contribuyente As Object In LCO
Console.WriteLine(Contribuyente.RFC)
For Each Certificado As Object In Contribuyente.Certificados
Dim Result = ""
Dim xAttribute = Certificado.Attribute("noCertificado")
If xAttribute IsNot Nothing Then
Result += " " & Convert.ToString(xAttribute.Value)
End If
Dim attribute = Certificado.Attribute("ValidezObligaciones")
If attribute IsNot Nothing Then
Result += " " & Convert.ToString(attribute.Value)
End If
Dim xAttribute1 = Certificado.Attribute("EstatusCertificado")
If xAttribute1 IsNot Nothing Then
Result += " " & Convert.ToString(xAttribute1.Value)
End If
Dim attribute1 = Certificado.Attribute("FechaInicio")
If attribute1 IsNot Nothing Then
Result += " " & Convert.ToString(attribute1.Value)
End If
Dim xAttribute2 = Certificado.Attribute("FechaFinal")
If xAttribute2 IsNot Nothing Then
Result += " " & Convert.ToString(xAttribute2.Value)
End If
MessageBox.Show(Result)
Next
Next
End Sub
Dim f As FileStream
f = New FileStream(filePath, FileMode.Open, FileAccess.Read)
Dim streamLength As Integer = Convert.ToInt32(f.Length)
Dim fileData As Byte() = New Byte(streamLength) {}
f.Read(fileData, 0, streamLength)
f.Close()
Return System.Text.Encoding.Default.GetString(fileData)
End Function
Private Function LimpiaLCO(ByVal sPath As String, ByVal sFile As String) As String
Dim RutaLCO As [String] = sPath
Dim xmlLCO As String = RutaLCO & sFile
'Dim objReader As New StreamReader(xmlLCO)
Dim sRes As String = FileToString(xmlLCO) 'objReader.ReadToEnd()
Dim posIni As Integer = sRes.LastIndexOf("<?xml", System.StringComparison.Ordinal)
Dim posFin As Integer = sRes.LastIndexOf("</lco:LCO>", System.StringComparison.Ordinal)
sRes = sRes.Substring(posIni, posFin)
posFin = sRes.LastIndexOf("</lco:LCO>", System.StringComparison.Ordinal)
sRes = sRes.Substring(0, posFin)
Dim SW As StreamWriter
Dim origName = xmlLCO.Remove(xmlLCO.Length - 4)
origName += "Clean.XML"
SW = File.CreateText(sPath)
SW.WriteLine(sRes)
SW.WriteLine("</lco:LCO>")
SW.Close()
Return origName
End Function
Private Shared Sub LoadLco(ByVal sPathFileLCO_Clean As String)
'Dim RutaLCO As [String] = sPath
Dim xmlLCO As String = sPathFileLCO_Clean ' RutaLCO & sfileClean
'Cargamos XML
Dim xdoc As XDocument = XDocument.Load(xmlLCO)
'Query
Dim LCO = From Contribuyente In xdoc.Descendants("Contribuyente") _
Select New With {Key .RFC = Contribuyente.Attribute("RFC").Value, _
Key .Certificados = Contribuyente.Descendants("Certificado")}
'Resultado
For Each Contribuyente As Object In LCO
Console.WriteLine(Contribuyente.RFC)
For Each Certificado As Object In Contribuyente.Certificados
Dim Result = ""
Dim xAttribute = Certificado.Attribute("noCertificado")
If xAttribute IsNot Nothing Then
Result += " " & Convert.ToString(xAttribute.Value)
End If
Dim attribute = Certificado.Attribute("ValidezObligaciones")
If attribute IsNot Nothing Then
Result += " " & Convert.ToString(attribute.Value)
End If
Dim xAttribute1 = Certificado.Attribute("EstatusCertificado")
If xAttribute1 IsNot Nothing Then
Result += " " & Convert.ToString(xAttribute1.Value)
End If
Dim attribute1 = Certificado.Attribute("FechaInicio")
If attribute1 IsNot Nothing Then
Result += " " & Convert.ToString(attribute1.Value)
End If
Dim xAttribute2 = Certificado.Attribute("FechaFinal")
If xAttribute2 IsNot Nothing Then
Result += " " & Convert.ToString(xAttribute2.Value)
End If
MessageBox.Show(Result)
Next
Next
End Sub
jueves, 30 de enero de 2014
Como obtener la Lista de usuarios del ActiveDirectory
Comando para listar el Active Directory en un Documento separado por Coma.
CSVDE -f nombredeldocumento.csv -b usuario dominio contraseña
Para listar solo por usuarios:
CSVDE -f onlyusers.csv -r "(&(objectClass=user)(objectCategory=person))"
CSVDE -f nombredeldocumento.csv -b usuario dominio contraseña
Para listar solo por usuarios:
CSVDE -f onlyusers.csv -r "(&(objectClass=user)(objectCategory=person))"
martes, 29 de octubre de 2013
RadControls for WinForms are not loaded at design-time,
PROBLEM
After you update to a new version of the Telerik WinForms suite, you start seeing RadControls for WinForms in the component tray and you are not able to select them on the form.

SOLUTION
The design-time capabilities of RadControls for WinForms are implemented in the Telerik.WinControls.UI.Design.dll assembly. If decide to use our installer to install the WinForms suite on your machine, this assembly is automatically installed in your Global Assemly Cache. The same is the situation if you decide to upgrade your Telerik version via ourVisual Studio Extensions - the Telerik.WinControls.UI.Design assembly will be set in your GAC. However, if you decide to upgrade Telerik assembly references manually by downloading the archive file that contains assemblies only, please be aware that these two approaches do not install the Design assembly in your GAC automatically.
So, to resolve this case, you should simply install the Telerik.WinControls.UI.Design.dll assembly manually in your GAC. If you have downloaded the archive file that contains the Telerik WinForms assemblies, you can find this assembly there. If you decide to follow the Upgrade Wizard approach, then you can find the assembly at: %APPDATA%\Telerik\Updates
If this still does not resolve the issue, please make sure that all references to Telerik assemblies point to assemblies having the latest version. As we provide two builds - one for .NET 2.0 and one for .NET 4.0 it is also
important to make sure that the referenced assemblies end up by the same number - .20 or .40.
After you update to a new version of the Telerik WinForms suite, you start seeing RadControls for WinForms in the component tray and you are not able to select them on the form.

SOLUTION
The design-time capabilities of RadControls for WinForms are implemented in the Telerik.WinControls.UI.Design.dll assembly. If decide to use our installer to install the WinForms suite on your machine, this assembly is automatically installed in your Global Assemly Cache. The same is the situation if you decide to upgrade your Telerik version via ourVisual Studio Extensions - the Telerik.WinControls.UI.Design assembly will be set in your GAC. However, if you decide to upgrade Telerik assembly references manually by downloading the archive file that contains assemblies only, please be aware that these two approaches do not install the Design assembly in your GAC automatically.
So, to resolve this case, you should simply install the Telerik.WinControls.UI.Design.dll assembly manually in your GAC. If you have downloaded the archive file that contains the Telerik WinForms assemblies, you can find this assembly there. If you decide to follow the Upgrade Wizard approach, then you can find the assembly at: %APPDATA%\Telerik\Updates
If this still does not resolve the issue, please make sure that all references to Telerik assemblies point to assemblies having the latest version. As we provide two builds - one for .NET 2.0 and one for .NET 4.0 it is also
important to make sure that the referenced assemblies end up by the same number - .20 or .40.
jueves, 17 de octubre de 2013
JSON Response C#
private static void JsonResponse(object pObject)
{
try
{
HttpResponse response = HttpContext.Current.Response;
response.ContentType = "application/json";
response.Charset = "utf-8";
var utf8 = new UTF8Encoding();
String json = JsonConvert.SerializeObject(pObject);
Byte[] encoded = utf8.GetBytes(json);
response.BinaryWrite(encoded);
response.End();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
viernes, 11 de octubre de 2013
VS2010 and IE10 Attaching the Script debugger to process iexplore.exe failed
There is a simpler fix for the JavaScript debugging issue in IE10:
- Close IE
- In elevated cmd prompt run this command:
regsvr32.exe "%ProgramFiles(x86)%\Common Files\Microsoft Shared\VS7Debug\msdbg2.dll"
(or
%ProgramFiles%
on a 32-bit OS)miércoles, 11 de septiembre de 2013
Open Radwindow o window.open Passing parameters
<telerik:RadButton ID="Imprimir" runat="server" Text="Imprimir" ButtonType="LinkButton" Image-ImageUrl ="imgs/printerOld.png" Visible="False" OnClientClicking = "openRadWindow" Height="32px" Width="32px" > </telerik:RadButton>
<script type="text/javascript">
function openRadWindow(button, args) {
// radopen(button.get_navigateUrl(), "Tranfer");
window.open(button.get_navigateUrl(), "_blank", "toolbar=yes, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes");
args.set_cancel(true);
}
</script>
Protected Sub btnreg_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnreg.Click
Imprimir.NavigateUrl = "frm_transf.aspx?BatNbr=" + Batnbr
End Sub
<script type="text/javascript">
function openRadWindow(button, args) {
// radopen(button.get_navigateUrl(), "Tranfer");
window.open(button.get_navigateUrl(), "_blank", "toolbar=yes, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes");
args.set_cancel(true);
}
</script>
Protected Sub btnreg_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnreg.Click
Imprimir.NavigateUrl = "frm_transf.aspx?BatNbr=" + Batnbr
End Sub
Suscribirse a:
Entradas (Atom)