示例#1
0
 private void dataLista_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         //label3.Text = dataLista.CurrentRow.Cells["idmov_stock"].Value.ToString();
         dataGridView1.DataSource = NegocioMovStock.mostrarDetalleMovStock(Convert.ToInt32(dataLista.CurrentRow.Cells["idmov_stock"].Value));
     }
 }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string correlativa    = "0";
            string serie          = "0";
            string comprobante    = "";
            string ingresouegreso = "";
            string respuesta      = "";

            if (ChRegistrar.Checked == true && proveedor != string.Empty)
            {
                correlativa = txtCorrelativa.Text == string.Empty ? txtCorrelativa.Text = "0" : txtCorrelativa.Text;
                serie       = txtSerie.Text == string.Empty ? txtSerie.Text = "0" : txtSerie.Text;
                comprobante = cbTipoComprobante.Text;
            }
            else if (ChRegistrar.Checked == false)
            {
                proveedor = "0";
            }

            DataTable dt = new DataTable();

            dt.Columns.Add("Codigo", typeof(string));
            dt.Columns.Add("Precio", typeof(decimal));
            dt.Columns.Add("PrecioVenta", typeof(decimal));
            dt.Columns.Add("Cantidad", typeof(string));
            dt.Columns.Add("StockActual", typeof(string));

            ingresouegreso = rdbIngreso.Checked == true ? "INGRESO" : "EGRESO";

            foreach (DataGridViewRow row in dataListaMov.Rows)
            {
                dt.Rows.Add(row.Cells[0].Value, row.Cells[2].Value, row.Cells[3].Value, row.Cells[4].Value, row.Cells[5].Value);
            }
            if (dataListaMov.RowCount != 0)
            {
                respuesta = NegocioMovStock.insertar(Convert.ToInt32(proveedor), DateTime.Today,
                                                     serie, correlativa, comprobante, 0, "EMITIDO", ingresouegreso, dt);
            }


            if (respuesta.Equals("ok"))
            {
                limpiartodo();
                UtilityFrm.mensajeConfirm("Se Agrego Correctamente");
                dataListaMov.Rows.Clear();
                //this.mostrar();
            }
            else
            {
                UtilityFrm.mensajeError("No se ha podido Agregar: " + respuesta);
            }
        }
        private void menuconfventa_Click(object sender, EventArgs e)
        {
            string mensaje  = "";
            bool   constock = false;

            try
            {
                Negociocaja objcaja = new Negociocaja();

                DataGridViewRow row = dataLista.CurrentRow;
                if (Convert.ToBoolean(row.Cells["caja"].Value) == false)
                {
                    if (objcaja.chequeocaja(this.Name, ref mensaje) == true)
                    {
                        Negociocaja.insertarmovcaja(4110107, Convert.ToSingle(row.Cells["Total"].Value.ToString()), 0, Convert.ToString(DateTime.Now), NegocioConfigEmpresa.usuarioconectado, NegocioConfigEmpresa.idusuario, NegocioConfigEmpresa.turno, "Venta nro : " + row.Cells["codigo"].Value.ToString(), Convert.ToInt64(row.Cells["codigo"].Value.ToString()), true);


                        if (NegocioConfigEmpresa.confsistema("stock").ToString() == this.Name)
                        {
                            DataTable ventas = cargardetallestock(row.Cells["codigo"].Value.ToString());

                            mensaje = NegocioMovStock.insertar(0, DateTime.Today,
                                                               "", row.Cells["codigo"].Value.ToString(), "VENTA", 0, "EMITIDO", "EGRESO", ventas);
                            if (mensaje != "ok")
                            {
                                constock = false;
                                UtilityFrm.mensajeError(mensaje);
                            }
                            else
                            {
                                constock = true;
                            }
                        }
                        NegocioVenta.cambiarestadoventa(Convert.ToInt32(row.Cells["codigo"].Value.ToString()), true, constock);
                    }
                    else
                    {
                        UtilityFrm.mensajeError(mensaje);
                    }
                }
            }
            catch (Exception i)
            {
                UtilityFrm.mensajeError(i.Message);
            }
            buscarPorFecha();
            actualizarTotal();
        }
        public void mostrar()
        {
            try
            {
                dataLista.Rows.Clear();
                DataTable productos = NegocioMovStock.mostrarDetalleMovStock(Convert.ToInt32(txtCodigo.Text));
                foreach (DataRow producto in productos.Rows)
                {
                    dataLista.Rows.Add(producto["idarticulo"], producto["Nombre del Producto"], producto["PrecioCompra"], producto["cantidad"], producto["subTotal"]);
                }

                //this.dataLista.Columns["precio"].DefaultCellStyle.Format = "c3";
                //this.dataLista.Columns["precio"].ValueType = Type.GetType("System.Decimal");
                this.dataLista.Columns["precioCompra"].DefaultCellStyle.Format = String.Format("###,##0.00");
                this.dataLista.Columns["subtotal"].DefaultCellStyle.Format     = String.Format("###,##0.00");
            }
            catch (Exception ex)
            {
                UtilityFrm.mensajeError("error con la Base de datos: " + ex.Message);
            }
            //datasource el origen de los datos,muestra las categorias en la grilla
        }
示例#5
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            NegocioMovStock objstock = new NegocioMovStock();

            DTStock.DataSource = NegocioMovStock.buscarFecha(TPinicio.Text, TPfin.Text);
        }
示例#6
0
 private void dataLista_SelectionChanged(object sender, EventArgs e)
 {
     //label3.Text = dataLista.CurrentRow.Cells["idmov_stock"].Value.ToString();
     dataGridView1.DataSource = NegocioMovStock.mostrarDetalleMovStock(Convert.ToInt32(dataLista.CurrentRow.Cells["idmov_stock"].Value));
 }
示例#7
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            NegocioMovStock objstock = new NegocioMovStock();

            dataLista.DataSource = NegocioMovStock.buscarFecha(dtpFechaIni.Text, dtpFechaFin.Text);
        }