private void ParaCadaUno(int[] arreglo, Funcion funcion)
 {
     foreach (int ix in arreglo)
     {
         funcion(ix);
     }
 }
Exemple #2
0
 public ABMCliente()
 {
     funcion = Funcion.nuevo;
     InitializeComponent();
     CrearCampos();
     Application.DoEvents();
 }
Exemple #3
0
        public ABMCliente(Datos.Cliente.CLNT p_CLNT) 
        {
            funcion = Funcion.editar;
            _CLNT = p_CLNT;
            InitializeComponent();
            CrearCampos();
            Application.DoEvents();
            LlenarCampos();

        }
        public static void Inicializar()
        {
            FactoryHelper.Inicializar();


            Funcion oFuncion = new Funcion();
            lstFuncion = new List<Funcion>();
            foreach (DataRow item in oFuncion.TraerListado().Tables[0].Rows)
            {
                oFuncion = new Funcion();
                oFuncion.DataRowToObject(item);
                lstFuncion.Add(oFuncion);
            }
        }
Exemple #5
0
 private void cbProveedor_Leave(object sender, EventArgs e)
 {
     if (txtSerie1.Text != "" && txtSerie2.Text != "" && txtNumero.Text != "" && cbProveedor.Text != "")
     {
         txtPorcetajeDevolucion.Focus();
         string sqlConsultar = "select e.IDEMCABEZADOCOMPRA, e.IMPUESTO, p.IVAESTADO, p.NOMBREPRODUCTO,d.CANTIDAD, d.CODIGOBARRAPRODUCTO, d.ICE, d.PRECIOCOMRPA,d.IRBP " +
                               " from TbEncabezadoyPieCompra e, TbDetalleCompra d, TbProducto p, TbProveedor pro" +
                               " where d.IDENCABEZADOCOMPRA = e.IDEMCABEZADOCOMPRA and p.CODIGOBARRA = d.CODIGOBARRAPRODUCTO" +
                               " and pro.IDPROVEEDOR = e.IDPROVEEDOR and e.SERIE1 = '" + txtSerie1.Text + "' and e.SERIE2 = '" + txtSerie2.Text + "' and e.NUMERO = '" + txtNumero.Text + "'" +
                               " and e.IDPROVEEDOR = " + cbProveedor.SelectedValue + " order by d.IDDETALLECOMPRA";
         DataTable dt = objConsultas.BoolDataTable(sqlConsultar);
         if (dt.Rows.Count > 0)
         {
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 DataRow row = dt.Rows[i];
                 if (i == dgvProductosDevolucion.RowCount - 1)
                 {
                     dgvProductosDevolucion.Rows.Add();
                 }
                 dgvProductosDevolucion.Rows[i].Cells[0].Value = row["CODIGOBARRAPRODUCTO"];                                 //codigo
                 dgvProductosDevolucion.Rows[i].Cells[1].Value = row["NOMBREPRODUCTO"];                                      //producto
                 dgvProductosDevolucion.Rows[i].Cells[2].Value = row["CANTIDAD"];                                            //cantidad
                 dgvProductosDevolucion.Rows[i].Cells[3].Value = Funcion.reemplazarcaracter(row["PRECIOCOMRPA"].ToString()); //precio
                 dgvProductosDevolucion.Rows[i].Cells[4].Value = Funcion.reemplazarcaracter(row["ICE"].ToString());          //ice
                 dgvProductosDevolucion.Rows[i].Cells[5].Value = Funcion.reemplazarcaracter(row["IRBP"].ToString());         //irbp
                 if (!ckbDevolver.Checked)
                 {
                     dgvProductosDevolucion.Rows[i].Cells[9].ReadOnly  = false;
                     dgvProductosDevolucion.Rows[i].Cells[10].ReadOnly = false;
                     dgvProductosDevolucion.Rows[i].Cells[9].Value     = "0";
                     dgvProductosDevolucion.Rows[i].Cells[10].Value    = "0%";
                 }
                 else
                 {
                     dgvProductosDevolucion.Rows[i].Cells[9].ReadOnly  = true;
                     dgvProductosDevolucion.Rows[i].Cells[10].ReadOnly = true;
                 }
                 txtImpuesto.Text = row["IMPUESTO"].ToString();
                 compraDetalle    = Convert.ToInt32(row["IDEMCABEZADOCOMPRA"]);
                 ivaEstado        = Convert.ToBoolean(row["IVAESTADO"]);
                 float    precioCompra        = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[3].Value.ToString()));
                 float    cantidad            = Convert.ToInt32(dgvProductosDevolucion.Rows[i].Cells[2].Value.ToString());
                 float    precioICE           = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[4].Value.ToString()));
                 float    precioIRBP          = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[5].Value.ToString()));
                 float    subtotalP           = 0.0f;
                 float    totalP              = 0.0f;
                 string[] separadorPorcentaje = txtImpuesto.Text.Split('%');
                 int      tipoIva             = Convert.ToInt32(separadorPorcentaje[0]);
                 float    ivaP = 0.0f;
                 if (ivaEstado)
                 {
                     ivaP = (((precioCompra + precioICE) * cantidad) * tipoIva) / 100;
                 }
                 else
                 {
                     ivaP = 0;
                 }
                 subtotalP = ((precioCompra + precioICE + precioIRBP) * cantidad);
                 totalP    = subtotalP + ivaP;
                 dgvProductosDevolucion.Rows[i].Cells[7].Value = Funcion.reemplazarcaracter(Math.Round(ivaP, 2).ToString("#####0.00"));
                 dgvProductosDevolucion.Rows[i].Cells[6].Value = Funcion.reemplazarcaracter(Math.Round(subtotalP, 2).ToString("#####0.00"));
                 dgvProductosDevolucion.Rows[i].Cells[8].Value = Funcion.reemplazarcaracter(Math.Round(totalP, 2).ToString("#####0.00"));
             }
         }
         Calcular(2);
         if (ckbDevolver.Checked)
         {
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 dgvProductosDevolucion.Rows[i].Cells[9].Value  = dgvProductosDevolucion.Rows[i].Cells[2].Value;
                 dgvProductosDevolucion.Rows[i].Cells[11].Value = dgvProductosDevolucion.Rows[i].Cells[2].Value;
                 dgvProductosDevolucion.Rows[i].Cells[10].Value = "100%";
             }
             Calcular(11);
         }
         else
         {
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 dgvProductosDevolucion.Rows[i].Cells[9].Value  = "0";
                 dgvProductosDevolucion.Rows[i].Cells[11].Value = "0";
                 dgvProductosDevolucion.Rows[i].Cells[10].Value = "0%";
             }
             Calcular(11);
         }
     }
 }
Exemple #6
0
 private void TxtTamañoPieFact_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.SoloValores(e, TxtTamañoPieFact.Text);
 }
Exemple #7
0
 public void calcularBilletes()
 {
     billetesTotal          = (Convert.ToInt32(txtBillestes1.Text) * 1) + (Convert.ToInt32(txtBillestes5.Text) * 5) + (Convert.ToInt32(txtBillestes10.Text) * 10) + (Convert.ToInt32(txtBillestes20.Text) * 20) + (Convert.ToInt32(txtBillestes50.Text) * 50) + (Convert.ToInt32(txtBillestes100.Text) * 100);
     txtTotalBillestes.Text = Funcion.reemplazarcaracter(billetesTotal.ToString());
     txtTotalRecaudado.Text = Funcion.reemplazarcaracter((Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalBillestes.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalMonedas.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalCheque.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtAvances.Text))).ToString());
     totalRecaudado         = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalRecaudado.Text));
 }
Exemple #8
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            if (!TextArea.Text.Equals(string.Empty))
            {
                Consola.Text = "";
                Gramatica    grammar  = new Gramatica();
                LanguageData lenguaje = new LanguageData(grammar);
                Parser       parser   = new Parser(lenguaje);
                ParseTree    arbol    = parser.Parse(TextArea.Text);

                if (arbol.ParserMessages.Count != 0)
                {
                    MessageBox.Show("Se han encontrado errores", "Errores",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);

                    List <LogMessage> errores = arbol.ParserMessages;
                    foreach (LogMessage error in errores)
                    {
                        if (error.Message.Contains("Sintax"))
                        {
                            Consola.AppendText("Error Sintactico, " + error.Message + " Linea: " + error.Location.Line + ", Columna: " + error.Location.Column);
                        }
                        else
                        {
                            Consola.AppendText("Error Lexico, " + error.Message + " Linea: " + error.Location.Line + ", Columna: " + error.Location.Column);
                        }
                    }
                }
                else
                {
                    GeneradorAST generadorAST = new GeneradorAST(arbol);
                    AST          ast          = generadorAST.arbol;
                    Entorno      ent          = new Entorno(null);

                    if (ast != null)
                    {
                        foreach (Instruccion ins in ast.Instrucciones)
                        {
                            ins.ejecutar(ent, ast);
                        }

                        if (ast.existeFuncion("main"))
                        {
                            Funcion main = ast.getFuncion("main");
                            foreach (Instruccion ins in main.instrucciones)
                            {
                                ins.ejecutar(ent, ast);
                            }
                        }
                        else
                        {
                            MessageBox.Show("No se encontró la funcion main!!", "Errores",
                                            MessageBoxButtons.OK,
                                            MessageBoxIcon.Error);
                        }

                        Graficador j = new Graficador();
                        j.graficar(arbol.Root);
                    }
                    else
                    {
                        MessageBox.Show("Error generando el AST", "Errores",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Error);
                    }
                }
            }
        }
Exemple #9
0
 private void TxtNumeroItemsFactura_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.Validar_Numeros(e);
 }
Exemple #10
0
        private void Calcular(int posicion)
        {
            float cantidad = 0, pc = 0.0f;

            sumasubiva = 0.0f; sumasubcero = 0.0f; totalpagar = 0.0f; ivatotal = 0.0f; sumaice = 0.0f; sumairbp = 0.0f; subtotalPie = 0.0f;
            try
            {
                for (int i = 0; i < dgvProductosDevolucion.RowCount; i++)
                {
                    cantidad = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[posicion].Value.ToString()));
                    if (Convert.ToSingle(dgvProductosDevolucion.Rows[i].Cells[7].Value.ToString()) != 0)
                    {
                        pc          = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[3].Value.ToString()));
                        sumasubiva += Convert.ToSingle(cantidad * pc);
                    }
                    if (Convert.ToSingle(dgvProductosDevolucion.Rows[i].Cells[7].Value.ToString()) == 0)
                    {
                        pc           = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[3].Value.ToString()));
                        sumasubcero += Convert.ToSingle(cantidad * pc);
                    }
                    sumaice  += Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[4].Value.ToString())) * Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[posicion].Value.ToString()));
                    sumairbp += Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[5].Value.ToString())) * Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvProductosDevolucion.Rows[i].Cells[posicion].Value.ToString()));
                    if (Convert.ToString(dgvProductosDevolucion.Rows[i + 1].Cells[0].Value) == "")
                    {
                        break;
                    }
                }
                string[] s   = txtImpuesto.Text.Split('%');
                float    iva = Convert.ToSingle(s[0]) / 100;
                ivatotal    = (sumasubiva + sumaice) * iva;
                subtotalPie = sumasubcero + sumasubiva;
                totalpagar  = sumairbp + sumaice + subtotalPie + ivatotal;
                if (posicion == 2)
                {
                    txtICE.Text         = Funcion.reemplazarcaracter(Math.Round(sumaice, 2).ToString("#####0.00"));
                    txtIRBP.Text        = Funcion.reemplazarcaracter(Math.Round(sumairbp, 2).ToString("#####0.00"));
                    txtIVA.Text         = Funcion.reemplazarcaracter(Math.Round(ivatotal, 2).ToString("#####0.00"));
                    txtSubtotal0.Text   = Funcion.reemplazarcaracter(Math.Round(sumasubcero, 2).ToString("#####0.00"));
                    txtSubtutalIVA.Text = Funcion.reemplazarcaracter(Math.Round(sumasubiva, 2).ToString("#####0.00"));
                    txtSubtotal.Text    = Funcion.reemplazarcaracter(Math.Round(subtotalPie, 2).ToString("#####0.00"));
                    txtTotal.Text       = Funcion.reemplazarcaracter(Math.Round(totalpagar, 2).ToString("#####0.00"));
                }
                else
                {
                    txtIceDevolucion.Text         = Funcion.reemplazarcaracter(Math.Round(sumaice, 2).ToString("#####0.00"));
                    txtIrbpDevolucion.Text        = Funcion.reemplazarcaracter(Math.Round(sumairbp, 2).ToString("#####0.00"));
                    txtIvaDevolucion.Text         = Funcion.reemplazarcaracter(Math.Round(ivatotal, 2).ToString("#####0.00"));
                    txtSubtotal0Devolucion.Text   = Funcion.reemplazarcaracter(Math.Round(sumasubcero, 2).ToString("#####0.00"));
                    txtSubtotalIvaDevolucion.Text = Funcion.reemplazarcaracter(Math.Round(sumasubiva, 2).ToString("#####0.00"));
                    txtSubtotalDevolucion.Text    = Funcion.reemplazarcaracter(Math.Round(subtotalPie, 2).ToString("#####0.00"));
                    txtTotalDevolucion.Text       = Funcion.reemplazarcaracter(Math.Round(totalpagar, 2).ToString("#####0.00"));
                }
                sumasubiva  = Convert.ToSingle(Math.Round(sumasubiva, 6));
                ivatotal    = Convert.ToSingle(Math.Round(ivatotal, 6));
                sumasubcero = Convert.ToSingle(Math.Round(sumasubcero, 6));
                sumaice     = Convert.ToSingle(Math.Round(sumaice, 6));
                sumairbp    = Convert.ToSingle(Math.Round(sumairbp, 6));
                subtotalPie = Convert.ToSingle(Math.Round(subtotalPie, 6));
                totalpagar  = Convert.ToSingle(Math.Round(totalpagar, 6));
            }
            catch (Exception EX) {}
        }
Exemple #11
0
 private bool NoExisteEnEditObject(Funcion funcion)
 {
     return(_editObject == null || !_editObject.Funciones.Exists(f => f.Id == funcion.Id));
 }
Exemple #12
0
 private void BtnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         if (TxtCabecera.Text != "" && TxtLinea1.Text != "" && TxtLinea2.Text != "" && TxtLinea3.Text != "" && TxtLinea4.Text != "" && TxtLinea5.Text != "" && TxtMontoInicial.Text != "0.00" && TxtMontoFinal.Text != "0.00")
         {
             Promocion ObjPromocion = new Promocion(Funcion.FormarFecha(DtpFechaInicio.Value.ToShortDateString()), Funcion.FormarFecha(DtpFechaFin.Value.ToShortDateString()),
                                                    Funcion.FormarFecha(DtpFechaVencimientoCupon.Value.ToShortDateString()), TxtCabecera.Text, TxtLinea1.Text, TxtLinea2.Text, TxtLinea3.Text, TxtLinea4.Text,
                                                    TxtLinea5.Text, CmbTipoPromocion.Text, true, Convert.ToInt32(NudNumTickets.Value), Convert.ToDouble(Funcion.reemplazarcaracterViceversa(TxtMontoInicial.Text)), Convert.ToDouble(Funcion.reemplazarcaracterViceversa(TxtMontoFinal.Text)));
             if (!bandera_Estado) // Para identificar si se va ingresar
             {
                 String resultado = ObjPromocion.InsertarPromocion();
                 if (resultado == "Datos Guardados")
                 {
                     MessageBox.Show(CmbTipoPromocion.Text + " Registrada Correctamente ", "Exito", MessageBoxButtons.OK);
                     inicializarDatos();
                 }
                 else if (resultado == "Error al Registrar")
                 {
                     MessageBox.Show("Error al guardar", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
                 else if (resultado == "Existe")
                 {
                     MessageBox.Show("Ya Existe esta Promoción", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
             else if (bandera_Estado)                                                     // Para identificar si se va modificar
             {
                 String Resultado = ObjPromocion.ModificarPromocion(TxtIdPromocion.Text); // retorna true si esta correcto todo
                 if (Resultado == "Correcto")
                 {
                     MessageBox.Show("Promoción Actualizada", "Exito");
                     IDPromocionDatagirdSelect = "";
                     inicializarDatos();
                 }
                 else
                 {
                     MessageBox.Show("Error al actualizar Cliente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
                 inicializarDatos();
                 bandera_Estado  = false;
                 BtnGuardar.Text = "&Guardar";
                 BtnLimpiar.Text = "&Limpiar";
             }
         }
         else
         {
             MessageBox.Show("Ingrese todos los datos correctamente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     { MessageBox.Show("Resultado: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
 }
Exemple #13
0
 private void btnConsultar_Click(object sender, EventArgs e)
 {
     obtenerFechas();
     consultaVentas();
     for (int i = 0; i < dgvInformeVentas.RowCount - 1; i++)
     {
         if (Convert.ToString(dgvInformeVentas.Rows[i].Cells[0].Value) != "")
         {
             for (int j = 7; j < 11; j++)
             {
                 dgvInformeVentas.Rows[i].Cells[j].Value = Funcion.reemplazarcaracter(Math.Round(Convert.ToSingle(Funcion.reemplazarcaracterViceversa(dgvInformeVentas.Rows[i].Cells[j].Value.ToString())), 2).ToString());
             }
             if (Convert.ToString(dgvInformeVentas.Rows[i + 1].Cells[0].Value) == "")
             {
                 break;
             }
         }
     }
     Funcion.dosDecimales(ref dgvInformeVentas, 7, 11, 0);
 }
Exemple #14
0
 private void txtMonedas1Dolar_Leave(object sender, EventArgs e)
 {
     calcularMonedas();
     //txtTotalMonedas.Text = Funcion.reemplazarcaracter((Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalMonedas.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtMonedas1Dolar.Text))).ToString());
     //e.Handled = true;
     txtTotalRecaudado.Text = Funcion.reemplazarcaracter((Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalBillestes.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalMonedas.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalCheque.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtAvances.Text))).ToString());
     totalRecaudado         = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalRecaudado.Text));
     BtnGuardar.Focus();
 }
Exemple #15
0
        private void Imprimir()
        {
            CrearTicket ticket = new CrearTicket();
            //int maximoCaracteres = 40;
            string espacios       = "";
            string cajaImprimir   = "CAJA #" + Program.NumeroCaja;
            string fecha          = DateTime.Now.Date.ToString();
            string cantidadAvance = txtCantidadAvances.Text;
            string avances        = Funcion.reemplazarcaracterViceversa(txtAvances.Text);
            string efectivo       = Convert.ToString(Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalBillestes.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalMonedas.Text)));
            string cheques        = Funcion.reemplazarcaracterViceversa(txtTotalCheque.Text);
            string Empresa        = objConsulta.ObtenerValorCampo("NOMBRE", "TbEmpresa", "where IDEMPRESA = " + Program.IDEMPRESA);

            ticket.TextoCentro(Empresa);
            ticket.TextoIzquierda("     ");
            ticket.TextoCentro("ARQUEO DE CAJA");
            ticket.TextoIzquierda("         ");
            ticket.TextoCentro(cajaImprimir);
            ticket.TextoCentro(Program.Usuario);
            ticket.TextoIzquierda("         ");
            ticket.TextoCentro(fecha);
            ticket.lineasAsteriscos();
            ticket.TextoExtremos(cantidadAvance + " Avances: ", "$" + Funcion.reemplazarcaracter(avances));
            ticket.lineasAsteriscos();
            ticket.TextoExtremos("Cheques: ", "$" + Funcion.reemplazarcaracter(cheques));
            ticket.lineasAsteriscos();
            ticket.TextoExtremos("Efectivo: ", "$" + Funcion.reemplazarcaracter(efectivo));
            ticket.lineasAsteriscos();
            ticket.TextoExtremos("V.Entregado: ", "$" + Funcion.reemplazarcaracter(Convert.ToString(Convert.ToSingle(efectivo) + Convert.ToSingle(cheques) + Convert.ToSingle(avances))));
            ticket.lineasAsteriscos();

            //}
            ticket.CortaTicket();

            //String ruta = @"\\AIRCONTROL\BodegaPedido";
            //ticket.ImprimirTicket(ruta);
            var valor = ConfigurationManager.AppSettings["Local"];

            ticket.ImprimirTicket(valor);//Nombre de la impresora ticketera
        }
Exemple #16
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            string sqlInsert = " INSERT INTO[dbo].[TbCierreCaja]([TOTALBILLETES],[TOTALMONEDAS],[TOTALCHEQUES],[TOTALAVANCES],[TOTALRECAUDADO],[TOTALENTREGADO],[FECHA],[IDUSUARIO],[CAJA])" +
                               " VALUES(" + Funcion.reemplazarcaracter(billetesTotal.ToString()) + ", " + Funcion.reemplazarcaracter(monedasTotal.ToString()) + "," + Funcion.reemplazarcaracter(totalCheque.ToString()) + "," + Funcion.reemplazarcaracter(txtAvances.Text.ToString()) + "," + Funcion.reemplazarcaracter(totalRecaudado.ToString()) + ",0,'" + Funcion.reemplazarcaracterFecha(DateTime.Now.Date.ToShortDateString()) + "', " + Program.IDUsuarioMenu + ", " + Program.NumeroCaja + ")";
            bool correcto = objConsulta.EjecutarSQL(sqlInsert);

            if (correcto)
            {
                MessageBox.Show("Registrado Correctamente");
                Imprimir();
                inicializar();
                FrmClaveUsuario.f.Close();
            }
            else
            {
                MessageBox.Show("Error al Registrar");
            }
        }
Exemple #17
0
 private void txtBillestes1_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.Validar_Numeros(e);
 }
Exemple #18
0
 public void calcularMonedas()
 {
     monedasTotal           = ((Convert.ToSingle(txtMonedas1.Text) * 1) / 100) + ((Convert.ToSingle(txtMonedas5.Text) * 5) / 100) + ((Convert.ToSingle(txtMonedas10.Text) * 10) / 100) + ((Convert.ToSingle(txtMonedas25.Text) * 25) / 100) + ((Convert.ToSingle(txtMonedas50.Text) * 50) / 100);
     monedasTotal           = monedasTotal + Convert.ToSingle(txtMonedas1Dolar.Text);
     txtTotalMonedas.Text   = Funcion.reemplazarcaracter(monedasTotal.ToString());
     txtTotalRecaudado.Text = Funcion.reemplazarcaracter((Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalBillestes.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalMonedas.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalCheque.Text)) + Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtAvances.Text))).ToString());
     totalRecaudado         = Convert.ToSingle(Funcion.reemplazarcaracterViceversa(txtTotalRecaudado.Text));
 }
Exemple #19
0
 private void txtDescripcionCategoriaUsuario_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.validar_Num_Letras(e);
 }
Exemple #20
0
 private static string GetSysKey(Funcion funcion)
 {
     return(funcion.Sistema.Id + "_" + funcion.Modulo);
 }
 // POST api/values
 public IHttpActionResult Post([FromBody] Funcion funcion)
 {
     GetSetNeo4j.SetFuncion(funcion);
     return(Ok());
 }
Exemple #22
0
        private void btnGuardarEmpresa_Click(object sender, EventArgs e)
        {
            byte[] bitDataLogo  = null;
            byte[] bitDataFondo = null;


            if (txtNombreEmpresa.Text != "" && txtRUCEmpresa.Text != "" && txtNombreComercialEmpresa.Text != "" && txtRazonSocialEmpresa.Text != "" && txtGerenteEmpresa.Text != "" && txtEmailEmpresa.Text != "" && txtCeluar1Empresa.Text != "" && txtClaveUsuario.Text != "")
            {
                if (nameLogo != "")
                {
                    Image img1 = pbLogoEmpresa.Image;
                    bitDataLogo = Funcion.imgToByteArray(img1);
                }
                if (nameFondo != "")
                {
                    Image img2 = pbfondoPantallaEmpresa.Image;
                    bitDataFondo = Funcion.imgToByteArray(img2);
                }
                Empresa ObjEmpresa = new Empresa(txtNombreEmpresa.Text, txtRUCEmpresa.Text, txtNombreComercialEmpresa.Text, txtRazonSocialEmpresa.Text, txtGerenteEmpresa.Text, txtDireccionEmpresa.Text, txtEmailEmpresa.Text, dtpFechaInicioContableEmpresa.Value, txtCeluar1Empresa.Text, txtCelular2Empresa.Text, txtRUCContadorEmpresa.Text, txtNombreContadorempresa.Text, txtEmailContadorEmpresa.Text, txtCelular1ContadorEmpresa.Text, txtCelular2ContadorEmpresa.Text, bitDataLogo, bitDataFondo, txtClaveUsuario.Text);

                if (!bandera_Estado)                                           // Para identificar si se va ingresar
                {
                    String resultado = ObjEmpresa.Insertarempresa(ObjEmpresa); // retorna true si esta correcto todo
                    if (resultado == "Datos Guardados")
                    {
                        MessageBox.Show("Empresa Registrada Correctamente ", "Exito", MessageBoxButtons.OK);
                        //rbtActivosEmpresa.Checked = true;
                        Program.razonsocialempresa = txtRazonSocialEmpresa.Text;
                        Program.rucempresa         = txtRUCEmpresa.Text;
                        Program.direccionempresa   = txtDireccionEmpresa.Text;

                        inicializarDatos();
                        cargarDatos();
                    }
                    else if (resultado == "Error al Registrar")
                    {
                        MessageBox.Show("Error al guardar", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else if (resultado == "Existe")
                    {
                        MessageBox.Show("Ya Existe el Empleado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else if (bandera_Estado)                                       // Para identificar si se va modificar
                {
                    String Resultado = ObjEmpresa.ModificarEmpresa(GlobalRuc); // retorna true si esta correcto todo
                    if (Resultado == "Correcto")
                    {
                        MessageBox.Show("Empresa Actualizada", "Exito");
                        //rbtActivosEmpleado.Checked = true;
                        Program.razonsocialempresa = txtRazonSocialEmpresa.Text;
                        Program.rucempresa         = txtRUCEmpresa.Text;
                        Program.direccionempresa   = txtDireccionEmpresa.Text;
                        GlobalRuc = "";
                    }
                    else
                    {
                        MessageBox.Show("Error al actualizar la Empresa", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    inicializarDatos();
                    bandera_Estado         = false;
                    btnGuardarEmpresa.Text = "&Guardar";
                    btnLimpiarEmpresa.Text = "&Limpiar";
                }
            }
            else
            {
                MessageBox.Show("Ingrese los datos de la Empresa", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #23
0
        private void timerEmpleados_Tick(object sender, EventArgs e)
        {
            tiempo += 1;

            switch (tiempo)
            {
            case 1:
                Mensajes.Caja("Information", "Atención", "Cargando datos, espere por favor...");
                dtNacimiento.Format       = DateTimePickerFormat.Custom;
                dtNacimiento.CustomFormat = "yyyy-MM-dd";

                txts   = new object[] { txtId, txtNombre, txtAP, txtAM, txtCorreo, txtDirección, txtNIP, txtRFID, txtTelefono, txtCP };
                combos = new object[] { comboArea, comboCargo, comboEstado, comboEstatus, comboMunicipio, comboPrivilegio };

                Validar.EvitaCP(txts);
                Validar.EvitaCP(new object[] { txtBuscar });
                Validar.PlaceHolderFlotante(panel1);
                Validar.Email(txtCorreo);
                Validar.EnteroSinFormato(new object[] { txtNIP, txtCP });
                Validar.Enteros(new object[] { "tel", txtTelefono });
                Validar.Letras(new object[] { txtNombre, txtAP, txtAM });

                break;

            case 2:
                Conexion.Consulta(String.Format("select * from estados"));
                CargaCombos("Estado...", comboEstado, "id_estado", "nombre_estado");
                Conexion.con.Close();

                Conexion.Consulta("select * from estatus_empleados");
                CargaCombos("Estatus...", comboEstatus, "id_estatus", "nombre_estatus");
                Conexion.con.Close();

                Conexion.Consulta("select * from cargos");
                CargaCombos("Cargo...", comboCargo, "id_cargo", "nombre");
                Conexion.con.Close();

                Conexion.Consulta("select * from privilegios");
                CargaCombos("Privilegios...", comboPrivilegio, "id_privilegio", "privilegio");
                Conexion.con.Close();

                Conexion.Consulta("select id_area, nombre from areas");
                CargaCombos("Area...", comboArea, "id_area", "nombre");
                Conexion.con.Close();

                AtributosCombo item0 = new AtributosCombo();
                item0.Value = "0";
                item0.Text  = "Municipio...";

                comboMunicipio.Items.Add(item0);
                break;

            case 3:
                Conexion.Paginar(
                    string.Format("select * from listarEmpleados order by num desc"),
                    "DataMember1", 20);

                Funcion.CargaTablaDatos_Estilos_Botones(tablaEmpleados);
                Actualizar();
                SendKeys.SendWait("{ENTER}");

                tablaEmpleados.Columns[2].Visible = false;
                tablaEmpleados.Columns[3].Visible = false;

                break;

            case 4:
                foreach (var ctrl in panel1.Controls.OfType <MetroFramework.Controls.MetroComboBox>())
                {
                    var combo = ctrl as MetroFramework.Controls.MetroComboBox;
                    combo.SelectedIndex = 0;
                }

                comboCantidadReg.SelectedIndex = 0;
                break;

            default:
                timerCarga.Stop();
                break;
            }
        }
Exemple #24
0
 private void txtRUCEmpresa_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.Validar_Numeros(e);
 }
Exemple #25
0
        private void Procesar()
        {
            try
            {
                int contadorNE = 0, contadorAutorizado = 0, contadorEnviados = 0, contadorNoautorizados = 0, contadorDevuelta = 0, contadorRecibida = 0, contador = 0, contadorAR = 0;
                if (DtDocuemtosXML.Rows.Count > 0)
                {
                    pictureBox1.Load(RutaImagenCargando);

                    foreach (DataRow myRow in DtDocuemtosXML.Rows)
                    {
                        NombreXML    = myRow["NombreXML"].ToString();
                        FechaEmision = myRow["FechaEmision"].ToString();
                        contador++;
                        //Inicio menuInferior
                        if (contador == DtDocuemtosXML.Rows.Count)
                        {
                            terminado = true;
                        }


                        TollMenuLablelDocumento.Text = "Documento : " + NombreXML + ".xml";
                        TollMenuLablelFecha.Text     = "Fecha : " + Funcion.reemplazarcaracterFecha(Convert.ToDateTime(FechaEmision).Date.ToShortDateString());
                        //Fin menuInferior

                        string RutaXML1        = RutaPathServer;
                        string pathXml         = RutaXML1 + @"\sonna_judith_vega_solis.p12";
                        string contadoraenviar = contador + " de " + DtDocuemtosXML.Rows.Count + " Archivos.";
                        //string cne="";
                        if (System.IO.File.Exists(RutaXML1 + @"\Generados" + @"\" + NombreXML + ".xml"))
                        {
                            EnvioArchivos.EnviarArchivos(pathXml, ContraseñaCertificado, RutaXML1, NombreXML, LinkSRIrecepcion, LinkSRIautorizacion, nombreEmpresa, EmailEmpresa, passEmail, ref contadorRecibida, ref contadorAutorizado, ref contadorNoautorizados, ref contadorDevuelta);
                            contadorEnviados++;

                            Thread.Sleep(500);

                            CambiarProgreso(NombreXML, FechaEmision, contadorDevuelta.ToString(), contadorRecibida.ToString(), contadorAutorizado.ToString(), contadorNoautorizados.ToString(), contadorEnviados.ToString(), contadoraenviar, contadorNE.ToString(), contadorAR.ToString(), terminado);
                        }
                        else
                        {
                            contadorNE++;
                            Objconsul.EjecutarSQL("INSERT INTO [dbo].[TbArchivosNoEncontrados]([NombreXML],[FECHA])" +
                                                  "VALUES ('" + NombreXML + "','" + Funcion.reemplazarcaracterFecha(DtpFecha.Value.Date.ToShortDateString()) + "')");
                            //CambiarProgreso(NombreXML, FechaEmision, contadorDevuelta.ToString(), contadorRecibida.ToString(), contadorAutorizado.ToString(), contadorNoautorizados.ToString(), contadorEnviados.ToString(), contadoraenviar, contadorNE.ToString(),contadorAR.ToString(),terminado);

                            RestaurarXml objcRestaurar = new RestaurarXml(NombreXML, DtpFecha.Value.Date.ToShortDateString(), RutaXML1, NombreXML);
                            bool         confirmar     = objcRestaurar.FormarXml();
                            Thread.Sleep(500);
                            if (confirmar)
                            {
                                contadorAR++;
                                if (System.IO.File.Exists(RutaXML1 + @"\Generados" + @"\" + NombreXML + ".xml"))
                                {
                                    EnvioArchivos.EnviarArchivos(pathXml, ContraseñaCertificado, RutaXML1, NombreXML, LinkSRIrecepcion, LinkSRIautorizacion, nombreEmpresa, EmailEmpresa, passEmail, ref contadorRecibida, ref contadorAutorizado, ref contadorNoautorizados, ref contadorDevuelta);
                                    contadorEnviados++;

                                    Thread.Sleep(200);
                                }
                            }
                            CambiarProgreso(NombreXML, FechaEmision, contadorDevuelta.ToString(), contadorRecibida.ToString(), contadorAutorizado.ToString(), contadorNoautorizados.ToString(), contadorEnviados.ToString(), contadoraenviar, contadorNE.ToString(), contadorAR.ToString(), terminado);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("No se encontró ningun archivo.");
                }

                Thread.Sleep(500);

                //btnEnviar.Enabled = true;
            }
            catch (Exception ex)
            {
            }
        }
Exemple #26
0
        private void btnGenerarKardex_Click(object sender, EventArgs e)
        {
            //string cantidadProducto = "select CANTIDAD from TbProducto where CODIGOBARRA = '" + txtProducto.Text + "'";
            //string cantidadCompra = "sum(CANTIDAD) from TbDetalleCompra where CODIGOBARRAPRODUCTO = '" + txtProducto.Text + "'";
            //string cantidadVenta = "select sum(CANTIDAD) from TbDetalleFactura where CODIGOBARRAPRODUCTO = '" + txtProducto.Text + "'";
            inicializar();
            if (consultoFormularioExterno)
            {
                LblNombreProducto.Visible = true; consultoFormularioExterno = false;
            }
            else
            {
                LblNombreProducto.Visible = false;
            }

            if (txtProducto.Text != "")
            {
                float     cantProducto = Convert.ToSingle(objConsulta.ObtenerValorCampo("CANTIDAD", "TbProducto", " where CODIGOBARRA = '" + txtProducto.Text + "' OR NOMBREPRODUCTO = '" + txtProducto.Text + "'"));
                float     existencia   = 0;
                DataTable cantCompra   = objConsulta.BoolDataTable("select sum(CANTIDAD) from TbDetalleCompra c, TbEncabezadoyPieCompra e " +
                                                                   " where c.IDENCABEZADOCOMPRA = e.IDEMCABEZADOCOMPRA and  (CODIGOBARRAPRODUCTO = '" + txtProducto.Text + "' OR NOMBREPRODUCTO = '" + txtProducto.Text + "' )and e.FECHAORDENCOMPRA < '" + Funcion.reemplazarcaracterFecha(dtpDesde.Value.ToShortDateString()) + "'");
                DataTable cantVenta = objConsulta.BoolDataTable("select sum(CANTIDAD) from TbDetalleFactura d, TbEncabezadoFactura e " +
                                                                " where d.NFACTURA = e.IDFACTURA and (CODIGOBARRAPRODUCTO = '" + txtProducto.Text + "' OR NOMBREPRODUCTO = '" + txtProducto.Text + "' ) and e.FECHA < '" + Funcion.reemplazarcaracterFecha(dtpDesde.Value.ToShortDateString()) + "'");
                if (cantCompra != null && cantVenta != null)
                {
                    DataRow compra = cantCompra.Rows[0];
                    DataRow venta  = cantVenta.Rows[0];
                    if (Convert.ToString(venta[0]) != "" && Convert.ToString(compra[0]) != "")
                    {
                        existencia = cantProducto + Convert.ToSingle(venta[0]) - Convert.ToSingle(compra[0]);
                    }
                    else
                    {
                        existencia = cantProducto;
                    }
                }
                dgvKardex.Rows[0].Cells[0].Value  = Funcion.reemplazarcaracterFecha(dtpDesde.Value.ToShortDateString());
                dgvKardex.Rows[0].Cells[1].Value  = "Existencia";
                dgvKardex.Rows[0].Cells[2].Value  = existencia;
                dgvKardex.Rows[0].Cells[3].Value  = "0";
                dgvKardex.Rows[0].Cells[4].Value  = "0";
                dgvKardex.Rows[0].Cells[8].Value  = existencia;
                dgvKardex.Rows[0].Cells[9].Value  = "0";
                dgvKardex.Rows[0].Cells[10].Value = "0";


                //---- desde aqui esta bien
                DataTable datosCompra = objConsulta.BoolDataTable("select e.SERIE1+''+e.SERIE2+''+e.NUMERO as NFactura, d.PRECIOCOMRPA, e.FECHAORDENCOMPRA, d.CANTIDAD" +
                                                                  " from TbEncabezadoyPieCompra e, TbDetalleCompra d, TbProducto p  where e.IDEMCABEZADOCOMPRA = d.IDENCABEZADOCOMPRA and" +
                                                                  " d.CODIGOBARRAPRODUCTO = p.CODIGOBARRA and (p.CODIGOBARRA = '" + txtProducto.Text + "' OR p.NOMBREPRODUCTO = '" + txtProducto.Text + "') and e.FECHAORDENCOMPRA between  '" + Funcion.reemplazarcaracterFecha(dtpDesde.Value.ToShortDateString()) + "' and '" + Funcion.reemplazarcaracterFecha(dtpHasta.Value.ToShortDateString()) + "' order by e.FECHAORDENCOMPRA");

                DataTable datosVenta = objConsulta.BoolDataTable("select e.SUCURSAL, e.CAJA, e.NFACTURA, d.PRECIO, d.CANTIDAD, e.FECHA" +
                                                                 " from TbEncabezadoFactura e, TbDetalleFactura d, TbProducto p where e.IDFACTURA = d.NFACTURA and" +
                                                                 " d.CODIGOBARRAPRODUCTO = p.CODIGOBARRA and (p.CODIGOBARRA = '" + txtProducto.Text + "' OR p.NOMBREPRODUCTO = '" + txtProducto.Text + "') and e.FECHA between  '" + Funcion.reemplazarcaracterFecha(dtpDesde.Value.ToShortDateString()) + "' and '" + Funcion.reemplazarcaracterFecha(dtpHasta.Value.ToShortDateString()) + "' order by e.FECHA");

                DataTable datosNotaCredito = objConsulta.BoolDataTable("select enc.SERIE1, enc.SERIE2, enc.NUMERO, dc.PRECIOCOMRPA, dnc.CANTIDAD, enc.FECHA, dnc.PORCENTAJE, dc.CANTIDAD as CANTCOMPRA " +
                                                                       " from TbEncabezadoNotaCredito enc, TbDetalleNotaCredito dnc, TbEncabezadoyPieCompra ec, TbDetalleCompra dc " +
                                                                       " where dnc.IDENCABEZADONOTACREDITO = enc.IDENCABEZADONOTACREDITO and enc.IDENCABEZADOCOMPRA = ec.IDEMCABEZADOCOMPRA and " +
                                                                       " dc.IDENCABEZADOCOMPRA = ec.IDEMCABEZADOCOMPRA and enc.FECHA between '" + Funcion.reemplazarcaracterFecha(dtpDesde.Value.ToShortDateString()) + "' and '" + Funcion.reemplazarcaracterFecha(dtpHasta.Value.ToShortDateString()) + "' and dnc.CODIGOBARRA = '" + txtProducto.Text + "' " +
                                                                       " order by enc.FECHA");


                if (datosCompra != null)
                {
                    for (int i = 0; i < datosCompra.Rows.Count; i++)
                    {
                        DataRow dtCompra = datosCompra.Rows[i];
                        dgvKardex.Rows[i + 1].Cells[0].Value = dtCompra["FECHAORDENCOMPRA"];
                        dgvKardex.Rows[i + 1].Cells[1].Value = "Compra S/F " + dtCompra["NFactura"];
                        dgvKardex.Rows[i + 1].Cells[2].Value = dtCompra["CANTIDAD"];
                        dgvKardex.Rows[i + 1].Cells[3].Value = dtCompra["PRECIOCOMRPA"];
                        dgvKardex.Rows[i + 1].Cells[4].Value = Convert.ToSingle(dgvKardex.Rows[i].Cells[3].Value) * Convert.ToInt32(dgvKardex.Rows[i].Cells[2].Value);
                        notaCredito = false;
                        if (i == dgvKardex.RowCount - 1)
                        {
                            dgvKardex.Rows.Add();
                        }
                        //dgvKardex.Rows.Insert(1,1);
                    }
                }
                if (datosVenta != null)
                {
                    for (int i = 0; i < datosVenta.Rows.Count; i++)
                    {
                        int     j = 01;
                        bool    banderaIngreso = false;
                        DataRow dtVenta        = datosVenta.Rows[i];
                        for (j = 0; j < dgvKardex.RowCount - 1; j++)
                        {
                            if (Convert.ToDateTime(dtVenta["FECHA"]) < Convert.ToDateTime(dgvKardex.Rows[j].Cells[0].Value))
                            {
                                int numeroFactura = Convert.ToInt32(dtVenta["NFactura"]), serie1 = Convert.ToInt32(dtVenta["SUCURSAL"]), serie2 = Convert.ToInt32(dtVenta["CAJA"]);
                                dgvKardex.Rows.Insert(j, 1);
                                dgvKardex.Rows[j].Cells[0].Value = dtVenta["FECHA"];
                                dgvKardex.Rows[j].Cells[1].Value = "Venta S/F " + serie1.ToString("D3") + serie2.ToString("D3") + numeroFactura.ToString("D9");
                                dgvKardex.Rows[j].Cells[5].Value = dtVenta["CANTIDAD"];
                                if (Convert.ToString(dgvKardex.Rows[j - 1].Cells[9].Value) == "0")
                                {
                                    dgvKardex.Rows[j].Cells[6].Value = dtVenta["PRECIO"];
                                }
                                else
                                {
                                    dgvKardex.Rows[j].Cells[6].Value = dgvKardex.Rows[j - 1].Cells[9].Value;
                                }
                                dgvKardex.Rows[j].Cells[7].Value = Convert.ToSingle(dgvKardex.Rows[j].Cells[6].Value) * Convert.ToSingle(dgvKardex.Rows[j].Cells[5].Value);
                                banderaIngreso = true;
                                notaCredito    = false;
                                break;
                            }
                            if (Convert.ToString(dgvKardex.Rows[j + 1].Cells[1].Value) == "")
                            {
                                j++;
                                break;
                            }
                        }
                        if (!banderaIngreso)
                        {
                            if (j == dgvKardex.RowCount - 1)
                            {
                                dgvKardex.Rows.Add();
                            }
                            int numeroFactura = Convert.ToInt32(dtVenta["NFactura"]), serie1 = Convert.ToInt32(dtVenta["SUCURSAL"]), serie2 = Convert.ToInt32(dtVenta["CAJA"]);
                            //dgvKardex.Rows.Insert(, 1);
                            dgvKardex.Rows[j].Cells[0].Value = dtVenta["FECHA"];
                            dgvKardex.Rows[j].Cells[1].Value = "Venta S/F " + serie1.ToString("D3") + serie2.ToString("D3") + numeroFactura.ToString("D9");
                            dgvKardex.Rows[j].Cells[5].Value = dtVenta["CANTIDAD"];
                            if (Convert.ToString(dgvKardex.Rows[j - 1].Cells[9].Value) == "0")
                            {
                                dgvKardex.Rows[j].Cells[6].Value = dtVenta["PRECIO"];
                            }
                            else
                            {
                                dgvKardex.Rows[j].Cells[6].Value = dgvKardex.Rows[j - 1].Cells[9].Value;
                            }
                            dgvKardex.Rows[j].Cells[7].Value = Convert.ToSingle(dgvKardex.Rows[j].Cells[6].Value) * Convert.ToSingle(dgvKardex.Rows[j].Cells[5].Value);
                            notaCredito = false;
                        }
                        calculoExistecia();
                    }
                }
                if (datosNotaCredito != null)
                {
                    for (int i = 0; i < datosNotaCredito.Rows.Count; i++)
                    {
                        int     j = 0;
                        bool    banderaIngreso = false;
                        DataRow dtNotaCredito  = datosNotaCredito.Rows[i];
                        for (j = 0; j < dgvKardex.RowCount - 1; j++)
                        {
                            if (Convert.ToString(dtNotaCredito["PORCENTAJE"]) != "0" || Convert.ToString(dtNotaCredito["CANTIDAD"]) != "0")
                            {
                                if (Convert.ToDateTime(dtNotaCredito["FECHA"]) < Convert.ToDateTime(dgvKardex.Rows[j].Cells[0].Value))
                                {
                                    int numeroFactura = Convert.ToInt32(dtNotaCredito["NUMERO"]), serie1 = Convert.ToInt32(dtNotaCredito["SERIE1"]), serie2 = Convert.ToInt32(dtNotaCredito["SERIE2"]);
                                    dgvKardex.Rows.Insert(j, 1);
                                    dgvKardex.Rows[j].Cells[0].Value = dtNotaCredito["FECHA"];
                                    dgvKardex.Rows[j].Cells[1].Value = "D/Compra S/NC " + serie1.ToString("D3") + serie2.ToString("D3") + numeroFactura.ToString("D9");
                                    //dgvKardex.Rows[j].Cells[5].Value = dtNotaCredito["CANTIDAD"];
                                    dgvKardex.Rows[j].Cells[6].Value = dtNotaCredito["PRECIOCOMRPA"];
                                    if (Convert.ToString(dtNotaCredito["PORCENTAJE"]) != "0")
                                    {
                                        string porcentaje = Convert.ToString(dtNotaCredito["PORCENTAJE"]);
                                        dgvKardex.Rows[j].Cells[5].Value = dtNotaCredito["CANTCOMPRA"];
                                        float por = ((Convert.ToSingle(dgvKardex.Rows[j].Cells[6].Value) * Convert.ToSingle(dgvKardex.Rows[j].Cells[5].Value)) * Convert.ToSingle(porcentaje) / 100);
                                        dgvKardex.Rows[j].Cells[7].Value = por;
                                        notaCredito = true;
                                    }
                                    else if (Convert.ToString(dtNotaCredito["CANTIDAD"]) != "0")
                                    {
                                        dgvKardex.Rows[j].Cells[5].Value = dtNotaCredito["CANTIDAD"];
                                        dgvKardex.Rows[j].Cells[7].Value = Convert.ToSingle(dgvKardex.Rows[j].Cells[6].Value) * Convert.ToInt32(dgvKardex.Rows[j].Cells[5].Value);
                                        notaCredito = false;
                                    }
                                    banderaIngreso = true;
                                    break;
                                }
                                if (Convert.ToString(dgvKardex.Rows[j + 1].Cells[1].Value) == "")
                                {
                                    j++;
                                    break;
                                }
                            }
                        }
                        if (!banderaIngreso)
                        {
                            if (Convert.ToString(dtNotaCredito["PORCENTAJE"]) != "0" || Convert.ToString(dtNotaCredito["CANTIDAD"]) != "0")
                            {
                                if (j == dgvKardex.RowCount - 1)
                                {
                                    dgvKardex.Rows.Add();
                                }
                                int numeroFactura = Convert.ToInt32(dtNotaCredito["NUMERO"]), serie1 = Convert.ToInt32(dtNotaCredito["SERIE1"]), serie2 = Convert.ToInt32(dtNotaCredito["SERIE2"]);
                                //dgvKardex.Rows.Insert(, 1);
                                dgvKardex.Rows[j].Cells[0].Value = dtNotaCredito["FECHA"];
                                dgvKardex.Rows[j].Cells[1].Value = "D/Compra S/NC " + serie1.ToString("D3") + serie2.ToString("D3") + numeroFactura.ToString("D9");
                                //dgvKardex.Rows[j].Cells[5].Value = dtNotaCredito["CANTIDAD"];
                                dgvKardex.Rows[j].Cells[6].Value = dtNotaCredito["PRECIOCOMRPA"];
                                if (Convert.ToString(dtNotaCredito["PORCENTAJE"]) != "0")
                                {
                                    string porcentaje = Convert.ToString(dtNotaCredito["PORCENTAJE"]);
                                    dgvKardex.Rows[j].Cells[5].Value = dtNotaCredito["CANTCOMPRA"];
                                    float por = ((Convert.ToSingle(dgvKardex.Rows[j].Cells[6].Value) * Convert.ToSingle(dgvKardex.Rows[j].Cells[5].Value)) * Convert.ToSingle(porcentaje) / 100);
                                    dgvKardex.Rows[j].Cells[7].Value = por;
                                    notaCredito = true;
                                }
                                else if (Convert.ToString(dtNotaCredito["CANTIDAD"]) != "0")
                                {
                                    dgvKardex.Rows[j].Cells[5].Value = dtNotaCredito["CANTIDAD"];
                                    dgvKardex.Rows[j].Cells[7].Value = Convert.ToSingle(dgvKardex.Rows[j].Cells[6].Value) * Convert.ToInt32(dgvKardex.Rows[j].Cells[5].Value);
                                    notaCredito = false;
                                }
                            }
                        }
                        calculoExistecia();
                    }
                }
                //eliminaVacio();
            }
            else
            {
                MessageBox.Show("Ingrese el producto.");
            }
        }
        public void inicializarDatos()
        {
            cbIdentificacionProveedor.SelectedIndex = 0;
            cbNacionalidadProveedor.SelectedIndex   = 0;
            cbNaturalezaProveedor.SelectedIndex     = 0;
            //CmbPais.SelectedIndex = 1;
            //CmbParroquia.SelectedIndex = 1;
            //cbProvinciaProveedor.SelectedIndex = 1;
            cbTipoGastoProveedor.SelectedIndex = 0;
            //CmbTipoServicio.SelectedIndex = 1;

            txtDireccionProveedor.Text   = "";
            txtRazonSocialProveedor.Text = "";
            txtResponsableProveedor.Text = "";
            txtCelularProveedor.Text     = "";
            txtTelefonoProveedor.Text    = "";
            txtEmailProveedor.Text       = "";
            txtGiraChequeProveedor.Text  = "";
            txtPlazo.Text = "";
            txtFax.Text   = "";
            TxtCelularResponsable.Text = "";
            ckbRISEProveedor.Checked   = false;
            Funcion.Limpiarobjetos(gbDatosAutorizacionProveedor);
            Funcion.Limpiarobjetos(gbInformcionGeneralProveedor);
            dgvDatosAutorizacionProveedor.Controls.Clear();
            //dgvDatosProveedor.Controls.Clear();
            dgvCodigoRetencionProveedor.Controls.Clear();
            txtConsultarProveedor.Text = "";

            cargarDatos("1");

            //cbPaisProveedor.SelectedIndex = 0;
            cbProvinciaProveedor.SelectedValue = 9;
            cbCantonProveedor.SelectedValue    = 80;
            cbParroquiaProveedor.SelectedValue = 41;


            consultas.BoolLlenarComboBox(cbCuentaContableProveedor, "Select IDPLANCUENTA as ID ,'[' +CUENTA +']' + ' - ' + DESCRIPCIONCUENTA AS Texto FROM dbo.TbPlanCuenta ");
            consultas.BoolLlenarComboBox(cbTipoServicioProveedor, "Select IDSERVICIO as ID, DESCRIPCION AS Texto from TbTipoServicio");


            IDProveedor = consultas.ObtenerID("IDProveedor", "TbProveedor", "");
            if (IDProveedor > 0)
            {
                GlobalCodigoProveedor = (IDProveedor + 1).ToString();
            }
            else
            {
                GlobalCodigoProveedor = "1";
            }

            //switch (GlobalCodigoProveedor.Length)
            //{
            //    case 1:
            //        GlobalCodigoProveedor = "000" + GlobalCodigoProveedor;
            //        break;
            //    case 2:
            //        GlobalCodigoProveedor = "00" + GlobalCodigoProveedor;
            //        break;
            //    case 3:
            //        GlobalCodigoProveedor = "0" + GlobalCodigoProveedor;
            //        break;
            //    default:
            //        break;
            //}
            txtCodigo.Text = GlobalCodigoProveedor;

            cbCreditoProveedor.DataSource   = null;
            cbICEProveedor.DataSource       = null;
            cbCodigo101Proveedor.DataSource = null;

            dgvDatosAutorizacionProveedor.Rows.Clear();
            dgvCodigoRetencionProveedor.Rows.Clear();

            for (int i = 0; i < 3; i++)
            {
                dgvCodigoRetencionProveedor.Rows.Add();
                dgvDatosAutorizacionProveedor.Rows.Add();
            }
            tabControl1.SelectedIndex = 0;
            tcProveedor.SelectedIndex = 0;
        }
Exemple #28
0
        //-----------------------------------------------------------------------------------------------
        public static void InitMagic(type pt, bitbrd[][] attacks, bitbrd[] magics, bitbrd[] masks, uint[] shifts, sq[] deltas, Funcion index)
        {
            int[][] MagicBoosters = new int[2][]{
               				new int[] { 969, 1976, 2850,  542, 2069, 2852, 1708,  164 },
               		new int[] { 3101,  552, 3555,  926,  834,   26, 2131, 1117 }
            };

              cAleatorio rk = new cAleatorio(4474);
              bitbrd[] occupancy = new UInt64[4096], reference = new UInt64[4096];
              bitbrd edges, b;
              int i, size, booster;

              for (sq s = cCasilla.A1; s <= cCasilla.H8; s++)
              {
            edges = ((cBitBoard.F1 | cBitBoard.F8) & ~cBitBoard.GetFilaS1(s)) | ((cBitBoard.A | cBitBoard.H) & ~cBitBoard.GetColumnaSq(s));

            masks[s] = AtaqueSlide(deltas, s, 0) & ~edges;
            shifts[s] = 32 - (uint)cBitBoard.CountMax15(masks[s]);

            b = 0;
            size = 0;
            do
            {
              occupancy[size] = b;
              reference[size] = AtaqueSlide(deltas, s, b);
              size++;
              b = (b - masks[s]) & masks[s];
            } while (b != 0);

            attacks[s] = new bitbrd[size];
            booster = MagicBoosters[0][cTypes.Fila(s)];

            do
            {
              do magics[s] = rk.NumeroMagico(booster);
              while (cBitBoard.CountMax15((magics[s] * masks[s]) >> 56) < 6);

              Array.Clear(attacks[s], 0, size);

              for (i = 0; i < size; i++)
              {
            bitbrd attack = attacks[s][index(s, occupancy[i], pt)];

            if (attack != 0 && attack != reference[i])
              break;

            attacks[s][index(s, occupancy[i], pt)] = reference[i];
              }
            } while (i != size);
              }
        }
Exemple #29
0
 private void TxtLargo_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.SoloValores(e, TxtLargo.Text);
 }
Exemple #30
0
 public void updateFuncion(Funcion obj)
 {
 }
Exemple #31
0
 private void txtEmailEmpresa_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.SinEspaciosEmail(e);
 }
Exemple #32
0
        private void FrmCierreCaja_Load(object sender, EventArgs e)
        {
            string sqlCheque = "select * from VistaChequesCierreCaja where IDUSUARIO = " + Program.IDUsuarioMenu + " AND FECHA = '" + Funcion.reemplazarcaracterFecha(Convert.ToString(DateTime.Now.Date.ToShortDateString())) + "' and CAJA = " + Program.NumeroCaja + "";

            objConsulta.boolLlenarDataGrid(dgvCheque, sqlCheque, 4, 3, 0);
            for (int i = 0; i < dgvCheque.RowCount - 1; i++)
            {
                totalCheque = totalCheque + Convert.ToSingle(dgvCheque.Rows[i].Cells[3].Value);
                if (Convert.ToString(dgvCheque.Rows[i + 1].Cells[0].Value) == "")
                {
                    break;
                }
            }
            txtTotalCheque.Text = Funcion.reemplazarcaracter(totalCheque.ToString());
            string sqlAvance = "select COUNT(a.CANTIDAD) AS CATIDADADELANTO, sum(a.CANTIDAD) AS CANTIDADTOTAL from TbAvance a, TbUsuario u " +
                               " where a.IDEMPLEADO = u.IDEMPLEADO and u.IDUSUARIO = " + Program.IDUsuarioMenu + "  and a.CAJA = " + Program.NumeroCaja + " and a.FECHA = '" + Funcion.reemplazarcaracterFecha(Convert.ToString(DateTime.Now.Date.ToShortDateString())) + "'";
            DataTable dt = objConsulta.BoolDataTable(sqlAvance);

            if (dt.Rows.Count > 0)
            {
                DataRow row = dt.Rows[0];
                txtCantidadAvances.Text = row[0].ToString();
                if (row[1].ToString() != "")
                {
                    txtAvances.Text = Funcion.reemplazarcaracter(row[1].ToString());
                }
                else
                {
                    txtAvances.Text = "0.00";
                }
            }
        }
 private void txtIdentificacionCliente_Leave(object sender, EventArgs e)
 {
     if (txtIdentificacionCliente.Text != "")
     {
         if (cbIdentificacionCliente.SelectedIndex == 0)
         {
             if (!Funcion.VerificarCedula(txtIdentificacionCliente.Text))
             {
                 MessageBox.Show("Ingrese la Cédula Correctamente", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                 txtIdentificacionCliente.Focus();
                 txtIdentificacionCliente.Select(0, txtIdentificacionCliente.Text.Length);
             }
         }
         if (cbIdentificacionCliente.SelectedIndex == 1)
         {
             if (txtIdentificacionCliente.Text.Length == 13)
             {
                 if (txtIdentificacionCliente.Text.Substring(10, 3) != "001" || Funcion.VerificarCedula(txtIdentificacionCliente.Text.Substring(0, 10)) == false)
                 {
                     MessageBox.Show("Ingrese el RUC Correctamente", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                     txtIdentificacionCliente.Focus();
                     txtIdentificacionCliente.Select(0, txtIdentificacionCliente.Text.Length);
                 }
             }
             else
             {
                 MessageBox.Show("Ingrese el RUC Correctamente", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtIdentificacionCliente.Focus();
                 txtIdentificacionCliente.Select(0, txtIdentificacionCliente.Text.Length);
             }
         }
     }
 }
Exemple #34
0
 private void txtNombreContadorempresa_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.Validar_Letras(e);
 }
Exemple #35
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="obj"></param>
 public void insertFuncion(Funcion obj)
 {
     this.ExecuteNonQuery(String.Format(""));
     if (this.ExistError)
         throw new Exception(this.MessageError);
 }
Exemple #36
0
 private void txtRazonSocialEmpresa_KeyPress(object sender, KeyPressEventArgs e)
 {
     Funcion.ValidarLetrasPuntoNumero(e, txtRazonSocialEmpresa.Text);
 }
Exemple #37
0
 public void eliminaFuncion(Funcion obj)
 {
     this.ExecuteNonQuery(String.Format("EXECUTE "));
     if (this.ExistError)
         throw new Exception(this.MessageError);
 }
 public bool UsuarioPuedeAcceder(Funcion function)
 {
     return(Usuarios.PuedeAcceder(_usuarioLogueado, function));
 }