1º Passo: Ir até a pasta da lexos localizada geralmente no disco local C (C:\lexos\Classes);
2º Passo: Achar o arquivo com o nome MenuVendas_SalvarCFes.cs e abrí-lo;
3º Passo: Abra o arquivo e substitua as informações contidas pelo código abaixo:
/*System.Drawing.dll;System.Windows.Forms.dll;Lex_Manager.dll;Estoque.exe;LEX_PedidoCompra.exe;Vendas.exe;LEX_NFe.exe;ILex_Manager.dll;DBAccess.dll;Domain.SAT.Client.dll;Domain.NFCe.dll;FIMREFERENCIAS*/
//SAT.Data.dll;
using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;using System.Drawing;using Vendas;using Domain.SAT.Client;//using SAT.Data;using Domain.NFCe;using DBAccess;
namespace dValuate{
class MenuVendas_SalvarCFes
{
public object EvaluateIt(object[] oParams)
{
try
{
Manager.Manager myManager = (Manager.Manager)oParams[1];
System.Windows.Forms.Form myFormPai = (System.Windows.Forms.Form)oParams[2];
Vendas.frmNFCeSalvarXML myForm = new Vendas.frmNFCeSalvarXML(new Domain.SAT.Client.Service.ServiceSAT(new SATCFeRepository(myManager.MyDBAccess), new Domain.SAT.Client.Service.ServiceConfigurationCFe()), myManager.LojaAtual.LojaId);
myForm.ShowDialog();
}
catch (Exception Ex) { CatchError(Ex, "ABRREQ01"); }
return "";
}
#region "Métodos auxiliares da classe"
private void CatchError(Exception Ex, string cErrorCode)
{
string cErro = Ex.Message + "\n";
cErro += Ex.Source + "\n";
cErro += Ex.StackTrace + "\n";
GenerateException(cErro, cErrorCode, Ex);
}
/// <summary>
/// Gera uma exceção no caso ocorra um erro
/// </summary>
/// <param name="cMessage">Mensagem do erro</param>
/// <param name="cCode">Código do erro</param>
/// <param name="myInnerException">Exceção anterior que deve ser carregada</param>
private void GenerateException(string cMessage, string cCode, Exception myInnerException)
{
if (!(myInnerException == null))
{
if (myInnerException.GetType() == typeof(System.InvalidOperationException))
throw (new InvalidOperationException("", myInnerException));
else if (myInnerException.GetType() == typeof(System.Reflection.TargetInvocationException))
{
if (!(myInnerException.InnerException == null))
{
if (myInnerException.InnerException.GetType() == typeof(System.InvalidOperationException))
throw (new InvalidOperationException("", myInnerException.InnerException));
else
{
if (cMessage.Substring(0, 5) == "CLEAN")
throw (new InvalidOperationException(cMessage.Substring(7, cMessage.Length - 7)));
else
throw (new InvalidOperationException("Erro FormAux [" + cCode + "] " + cMessage));
}
}
else
{
if (cMessage.Substring(0, 5) == "CLEAN")
throw (new InvalidOperationException(cMessage.Substring(7, cMessage.Length - 7)));
else
throw (new InvalidOperationException("Erro FormAux [" + cCode + "] " + cMessage));
}
}
else
{
if (cMessage.Substring(0, 5) == "CLEAN")
throw (new InvalidOperationException(cMessage.Substring(7, cMessage.Length - 7)));
else
throw (new InvalidOperationException("Erro FormAux [" + cCode + "] " + cMessage));
}
}
else
{
if (cMessage.Substring(0, 5) == "CLEAN")
throw (new InvalidOperationException(cMessage.Substring(7, cMessage.Length - 7)));
else
throw (new InvalidOperationException("Erro FormAux [" + cCode + "] " + cMessage));
}
}
#endregion
}
}
4º Passo: Salve o arquivo com as alterações feitas e gere novamente os XML's do período solicitado.