Exemple #1
0
        private bool CrearDirectorioDest(string path)
        {
            bool bResult = false;

            try
            {
                if (!Directory.Exists(path))
                {
                    // Crear Directorio
                    DirectoryInfo di = Directory.CreateDirectory(path);
                    //.T.
                    bResult = true;
                }
                else
                {
                    bResult = true;
                }
            }
            catch (IOException ioex)
            {
                //Mensaje y .F.
                MessageBoxTemporal.Show(ioex.Message + "- (Directorio inválido)", "Error!", 5, true);
                bResult = false;
            }
            //Retornar
            return(bResult);
        }
Exemple #2
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            string mySQL     = "";
            int    iTilde    = 0;
            int    IdMenu    = 0;
            int    IdDetMenu = 0;

            //DESTILDAR TODO LOS ITEMS DE LA DERECHA
            foreach (DataGridViewRow row in dgvFrmAcc.Rows)
            {
                //Detalle Menu
                IdDetMenu = Convert.ToInt32(row.Cells["IdDetMenu"].Value.ToString());
                //Usuario
                IdMenu = Convert.ToInt32(row.Cells["IdMenu"].Value.ToString());
                //Tilde

                iTilde = Convert.ToInt32(row.Cells["Habilitado"].Value);
                mySQL  = "UPDATE MenuOpcionesUser SET Habilitado = " + iTilde + " WHERE IdDetMenu = " + IdDetMenu
                         + " AND IdMenu = " + IdMenu +
                         " AND IdUser = "******"Codigo"].Value.ToString());
                clsDataBD.GetSql(mySQL);
            }

            //MessageBox
            MessageBoxTemporal.Show("Los cambios se guardaron con exito!", "Información!", 4, true);
        }
Exemple #3
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            //Elegir carpeta destino
            if (FolderBrowser.ShowDialog() == DialogResult.OK)
            {
                lblDest.Text = FolderBrowser.SelectedPath;
            }

            //Articulos
            MakeArticulos();

            //Mensaje Final
            MessageBoxTemporal.Show("Los Archivos han sido generados exitosamente!", "Información!", 4, true);

            //Clean
            lblPorc.Text = "0 %";
            pBar.Value   = 0;
        }
Exemple #4
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            //Variable que contempla el orden
            int Item = 1;

            //Recorrer Rubros y guardar Orden
            foreach (DataGridViewRow row in dgvRubros.Rows)
            {
                //Cargar el producto en la tabla
                //Guardar la factura
                string myCadSQL = "UPDATE RubrosArticulos SET Orden = " + Item + " WHERE IdRubroArticulo = " + Convert.ToInt32(row.Cells["IdRubroArticulo"].Value);

                clsDataBD.GetSql(myCadSQL);

                Item++;
            }

            MessageBoxTemporal.Show("Los cambios se han guardado correctamente!", "Información!", 3, false);
        }
Exemple #5
0
        private void btImgClipBoard_Click(object sender, EventArgs e)
        {
            Image img = ClipboardImage();

            if (img != null)
            {
                string nombreArchivo = "ImagenClipboard_" + DateTime.Now.ToString().Replace("/", "-").Replace(" ", "_").Replace(":", "") + ".jpg";
                img.Save(nombreArchivo);

                adjuntostemp.Add(Application.StartupPath + "\\" + nombreArchivo);
                txtImagenes.Text = nombreArchivo + " ; " + txtImagenes.Text;


                txtImagenes.Visible        = true;
                btEliminarImagenes.Visible = true;
            }
            else
            {
                MessageBoxTemporal.Show("El portapapeles no contiene una imagen.", "Error Portapeles", 2);
            }
        }
Exemple #6
0
        private void ExisteNuevaVersion()
        {
            EscribirLog("Comprobar Actualizacion");
            bool acceso = AccesoRutas();

            if (acceso)
            {
                DateTime fServidor = buscarUltimaFechaModificado(RutaServidor);
                DateTime fLocal    = buscarUltimaFechaModificado(RutaLocal);
                bool     Temp      = System.IO.Directory.Exists(RutaTemporal) ?true : false;

                if ((fServidor > fLocal) || (Temp))
                {
                    ExisteAcutalizacion             = true;
                    CheckForIllegalCrossThreadCalls = false;
                    cProgress.Start();
                    Accion("Existe una nueva version", true);
                    Task.Factory.StartNew(() =>
                    {
                        CargarListas();
                    }).ContinueWith((t) =>
                    {
                        //COPIANDO DEL SERVIDOR A TEMPORAL
                        Accion("\t\t ----> Copiar Archivos de Servidor a Temporal", true);
                        CopiarDeSevidorATemporal();
                    }).ContinueWith((t) =>
                    {
                        CargarListas(true);
                        Accion("\t\t ----> Finalizar Copiado " + archivosTemp.Count(), true);
                    }).ContinueWith((t) =>
                    {
                        //MOVIENDO DE TEMPORAL A LOCAL
                        Accion("\t\t ----> Modificando archivos de Solo Lectura", true);
                        CambiarEstadoReadOnly();

                        Accion("\t\t ----> Moviendo Archivos de Temporal a Local", true);
                        MoverTempALocal();
                        Accion("\t\t ----> Finalizar Moviendo ");
                    }).ContinueWith((t) =>
                    {
                        //ELIMINAR TEMPORAL
                        Accion("\t\t ----> Eliminar Temporal", true);
                        EliminarTemporal();
                        Accion("\t\t ----> Finalizar Eliminar ", true);
                    }).ContinueWith((t) =>
                    {
                        //CargarListas();
                        CheckForIllegalCrossThreadCalls = true;
                        cProgress.End();
                        CompletadaActualizacion = true;
                        MessageBoxTemporal.Show("Programa Actualzado", "Comprobar Actualizacion", 1);
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }, TaskScheduler.FromCurrentSynchronizationContext());

                    //CheckForIllegalCrossThreadCalls = true;
                }

                else
                {
                    CompletadaActualizacion = true;
                    Accion("No existe una nueva version", true);
                    MessageBoxTemporal.Show("No existe una nueva version", "Comprobar Actualizacion", 1);
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            else
            {
                Error = "No hay Acceso a la Rutas";
                Accion("No hay Acceso a la Rutas", true);
                MessageBoxTemporal.Show("No hay Acceso a la Rutas", "Comprobar Actualizacion", 2);
                this.DialogResult = DialogResult.Ignore;
                this.Close();
            }
        }
Exemple #7
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            string FileName     = "";
            string FileNameAlic = "";
            int    Mes          = 0;
            int    Ano          = 0;

            //Verificar compras o ventas...
            if (this.rbtVentas.Checked)
            {
                //Nombre Archivo
                if (this.rbtMesCurso.Checked)
                {
                    FileName     = "CITI VENTAS CBTES -" + DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + ".txt";
                    FileNameAlic = "CITI VENTAS ALIC -" + DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + ".txt";
                    Mes          = Convert.ToInt32(DateTime.Today.Month);
                    Ano          = Convert.ToInt32(DateTime.Today.Year);
                }
                else
                {
                    FileName     = "CITI VENTAS CBTES -" + this.nAno.Value.ToString() + "-" + this.nMes.Value.ToString() + ".txt";
                    FileNameAlic = "CITI VENTAS ALIC -" + this.nAno.Value.ToString() + "-" + this.nMes.Value.ToString() + ".txt";
                    Mes          = Convert.ToInt32(this.nMes.Value);
                    Ano          = Convert.ToInt32(this.nAno.Value);
                }


                //Hay DATOS?
                string    sCadSQL     = "Select * from Vista_eFactura WHERE MONTH(Fecha) = " + Mes + " AND YEAR(Fecha) = " + Ano + " ORDER BY Fecha ASC";
                DataTable myDataTable = clsDataBD.GetSql(sCadSQL);
                if (!(myDataTable.Rows.Count > 0))
                {
                    //Mensaje Final
                    MessageBoxTemporal.Show("No hay datos a exportar para el Período indicado!", "Información!", 4, true);
                }
                else
                {
                    //Elegir carpeta destino
                    if (FolderBrowser.ShowDialog() == DialogResult.OK)
                    {
                        lblDest.Text = FolderBrowser.SelectedPath;
                    }

                    //Generar archivo Comprobantes
                    MakeVentas(FileName, Mes, Ano);

                    //Mensaje Final
                    MessageBoxTemporal.Show("El Archivo CITI Ventas Comprobantes ha sido generado exitosamente!", "Información!", 4, true);

                    //Clean
                    lblPorc.Text = "0 %";
                    pBar.Value   = 0;

                    //Generar archivo Alicuotas
                    MakeVentasAlic(FileNameAlic, Mes, Ano);

                    //Mensaje Final
                    MessageBoxTemporal.Show("El Archivo CITI Ventas Alicuotas ha sido generado exitosamente!", "Información!", 4, true);
                }

                //Clean
                lblDest.Text = "Sin especificar...";
                lblPorc.Text = "0 %";
                pBar.Value   = 0;
            }
            else if (this.rbtCompras.Checked)
            {
                //VER GABI

                //MakeCompras();
            }
        }
Exemple #8
0
 private void button1_Click(object sender, EventArgs e)
 {
     MessageBoxTemporal.Show("Mensaje de prueba para karmany.NET", "Título", 5, false);
 }
Exemple #9
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            string sFolder = clsGlobales.sDestinoFs;

            //CAMBIAR PUNTERO MOUSE
            Cursor.Current = Cursors.WaitCursor;

            /*  bool bResult = false;
             *
             * //Crear directorio Destino, si todo .T. ok, sino Quit
             * /* bResult = this.CrearDirectorioDest(sFolder);
             * if (bResult == false) { return; }*/

            this.btnAceptar.Enabled = false;
            this.btnSalir.Enabled   = false;

            //VERIFICAR QUE LISTADO SE IMPRIME
            if (this.rdbMostrador.Checked)
            {
                //Exportar a Excel
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 0, lblCurrent);
            }
            else if (this.rdbRevendedor.Checked)
            {
                //Exportar a Excel
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent);
            }
            else if (this.rdbRev10.Checked)
            {
                //Exportar a Excel
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 4);
            }
            else if (this.rdbRev20.Checked)
            {
                //Exportar a Excel
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 5);
            }
            else if (this.rdbDist.Checked)
            {
                //Exportar a Excel
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 3);
            }
            else if (this.rdbAmbos.Checked)
            {
                //Exportar a Excel
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 0, lblCurrent);
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent);
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 3);
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 4);
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 5);
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 1);
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 2);
            }
            else if (this.rdbLimitCdba.Checked)
            {
                //Exportar a Excel Limitrofe Cordoba
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 1);
            }
            else if (this.rdbLimitLt.Checked)
            {
                //Exportar a Excel Limitrofe de Limitrofe
                clsGlobales.cFormato.ExportToExcel(sFolder, this.pBar, this.lblPorc, 1, lblCurrent, 2);
            }


            this.btnAceptar.Enabled = true;
            this.btnSalir.Enabled   = true;

            //CAMBIAR PUNTERO MOUSE
            Cursor.Current = Cursors.Default;

            //Mensaje
            MessageBoxTemporal.Show("Los Archivos se han generado exitosamente!", "Información!", 3, true);

            //Cerrar
            this.Close();
        }
Exemple #10
0
 public TextConcept()
 {
     InitializeComponent();
     MessageBoxTemporal.Show(String.Concat("Esta Versiòn es de Pruebas para capturar el Muestreo", Environment.NewLine, "Los Datos ingresado no alteraran ningun comprtamiento en el sistema DBMEAL"), "ÀREA IT", 10, true);
 }