Ejemplo n.º 1
0
        private void frm_menu_Load(object sender, EventArgs e)
        {
            string msn = "";

            if (!EmpresaTR.llenarDatosGlobales(ref msn))
            {
                Mensaje.advertencia(msn);
                Global.nombreImpresora   = "Generic / Text Only";
                Global.cantidadDecimales = 2;
            }
            if (Global.idRol != 1)
            {
                this.tsm_editar.Visible = false;
            }
            List <ItemMenu> items    = MenuTR.consultarItemsXRol(Global.idRol);
            bool            usarGuia = ParametroTR.ConsultarBool("guiaRemision");

            if (usarGuia)
            {
                this.flp_botones.Left -= this.btn_guia.Width / 2;
                this.btn_guia.Show();
            }
            this.procesarMenu(0, null, items);
            this.actualizarColor();
            this.abrirSocket();

            if (ParametroTR.ConsultarSincronizacionContinua("") == 1)
            {
                this.verificarSincronizacionContinua();
            }
            else
            {
                this.verificarSincronizacion();
            }
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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();
 }
Ejemplo n.º 4
0
        private void frm_login_Load(object sender, EventArgs e)
        {
            //Mensaje.advertencia(General.encriptar("admin"));
            EmpresaTR tran      = new EmpresaTR();
            string    msn       = "";
            int       idEmpresa = tran.obtenerIdEmpresa(ref msn);

            if (String.IsNullOrEmpty(msn))
            {
                if (idEmpresa != -1)
                {
                    Global.idEmpresa = idEmpresa;
                }
                else
                {
                    frm_empresa empresa = new frm_empresa();
                    empresa.ShowDialog();
                }
            }
            else
            {
                Mensaje.error(msn);
            }
        }
Ejemplo n.º 5
0
 private void btn_registrar_Click(object sender, EventArgs e)
 {
     try
     {
         XmlDocument xml     = new XmlDocument();
         string      archivo = this.txt_archivo.Text;
         xml.Load(@archivo);
         XmlNode raiz    = xml.FirstChild;
         Empresa empresa = new Empresa();
         empresa.Idtbl_empresa     = Convert.ToInt32(raiz["empresa_id"].InnerText);
         empresa.Ruc               = raiz["ruc"].InnerText;
         empresa.Bodega            = Convert.ToInt32(raiz["bodega_id"].InnerText);
         empresa.Razon_social      = raiz["razon_social"].InnerText;
         empresa.Telefonos         = raiz["telefonos"].InnerText;
         empresa.Direccion         = raiz["direccion"].InnerText;
         empresa.NumeroDecimales   = Convert.ToInt32(raiz["numero_decimales"].InnerText);
         empresa.IdConsumidorFinal = Convert.ToInt32(raiz["consumidor_final_id"].InnerText);
         empresa.ClaveGenerada     = raiz["clave_generada"].InnerText;
         empresa.IdCaja            = Convert.ToInt32(raiz["cuenta_caja_id"].InnerText);
         EmpresaTR tran    = new EmpresaTR(empresa);
         string    mensaje = "";
         if (tran.insertarEmpresa(ref mensaje))
         {
             Mensaje.informacion("Empresa almacenada con éxito.");
             this.Close();
         }
         else
         {
             Mensaje.error(mensaje);
         }
     }
     catch (Exception error)
     {
         Mensaje.advertencia(error.Message);
     }
 }
Ejemplo n.º 6
0
 public frm_reporteSaldos()
 {
     InitializeComponent();
     this.empresa = EmpresaTR.obtenerNombreEmpresa();
     this.Text   += " " + empresa;
 }
Ejemplo n.º 7
0
        private void setDireccionPartida()
        {
            string direccion_partida = EmpresaTR.obtenerDireccionEmpresa();

            this.txt_direccionPartida.Text = direccion_partida;
        }
Ejemplo n.º 8
0
 public frm_sincronizarProducto()
 {
     this.idBodegaProductos = EmpresaTR.obtenerIdBodegaProductos();
     InitializeComponent();
 }
 public frm_reporteProducto()
 {
     InitializeComponent();
     empresa    = EmpresaTR.obtenerNombreEmpresa();
     this.Text += " " + empresa;
 }