Ejemplo n.º 1
0
 /// <summary>
 /// first method called from the SKIDATA application after a fiscal device instance has been created. It starts the initialization of the fiscal device. Depending on the result, this method will be called at least once. A return value of trueTruetrue signals that the fiscal device was detected, connected and initialized properly.
 /// </summary>
 /// <param name="configuration"></param>
 /// <returns></returns>
 public Result Install(FiscalDeviceConfiguration configuration)
 {
     WriteToTrace("#####     Method :: Install    ####");
     comPort = configuration.CommunicationChannel;
     if (Bixolon.CheckFPrinter() == false)
     {
         if (Reinstall())
         {
             if (DeviceAvaileableMemory())
             {
                 EmitU0ZReport();
                 return(new Result(true));
             }
             else
             {
                 return(new Result(false));
             }
         }
         else
         {
             return(new Result(false));
         }
     }
     return(new Result(false));
 }
 public void DetectarImpresora()
 {
     try
     {
         bool test1 = fiscal.CheckFPrinter();
         if (fiscal.OpenFpCtrl(Puerto))
         {
             if (!fiscal.ReadFpStatus())
             {
                 throw (new Exception(string.Format("Error de conexión, Estatus {0} verifique el puerto por favor...", fiscal.Status_Error)));
             }
         }
         else
         {
             var  texto = fiscal.ComPort;
             bool test  = fiscal.CheckFPrinter();
             var  x     = fiscal.Estado;
             throw (new Exception(string.Format("Error al abrir el puerto {0}", Puerto)));
         }
     }
     catch (TfhkaNet.IF.PrinterException x)
     {
         throw new Exception(string.Format("Error de impresora: {0}, estatus {1}", x.Message, fiscal.Estado));
     }
 }