예제 #1
0
        private static void enviarError(string mensaje)
        {
            Thread backgroundThread = new Thread(
                new ThreadStart(() =>
            {
                try
                {
                    string targetPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Contifico";
                    string fileName   = "lastError.jpg";
                    if (!System.IO.Directory.Exists(targetPath))
                    {
                        System.IO.Directory.CreateDirectory(targetPath);
                    }
                    string destFile = System.IO.Path.Combine(targetPath, fileName);

                    Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
                    Graphics graphics  = Graphics.FromImage(printscreen as Image);
                    graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);
                    printscreen.Save(destFile, System.Drawing.Imaging.ImageFormat.Jpeg);
                    Mail mail      = new Mail();
                    string empresa = EmpresaTR.obtenerNombreEmpresa();
                    mail.enviarError("Error en " + empresa + " (" + Global.idEmpresa + ")", mensaje, destFile);
                }catch (Exception) {}
            }));

            backgroundThread.Start();
        }
예제 #2
0
 public void enviarCorreoError(int idCaja, string mensaje)
 {
     System.Threading.Thread errorThread = new System.Threading.Thread(
         new System.Threading.ThreadStart(() =>
     {
         try
         {
             string empresa = EmpresaTR.obtenerNombreEmpresa();
             this.enviarError("Error al sincronizar " + empresa + " (" + Global.idEmpresa + ")", "<strong>Caja:</strong>" + idCaja + "<br/><strong>Error:</strong>" + mensaje);
         }
         catch (Exception) { }
     }));
     errorThread.Start();
 }
예제 #3
0
 public frm_reporteSaldos()
 {
     InitializeComponent();
     this.empresa = EmpresaTR.obtenerNombreEmpresa();
     this.Text   += " " + empresa;
 }
 public frm_reporteProducto()
 {
     InitializeComponent();
     empresa    = EmpresaTR.obtenerNombreEmpresa();
     this.Text += " " + empresa;
 }