protected void btnNuevoPrecio_Click(object sender, EventArgs e)
        {
            AgregarVariableSession("operacionPrecio", 1);
            int linProCodigo = (int)LeerVariableSesion("proCodigo");

            clsListaPrecios oListaPrecioLst = new clsListaPrecios();
            clsLotesArt oLotesArtLst = new clsLotesArt();

            int linLprCod = oListaPrecioLst.MaxListaPrecioCod();
            int linLotCod = oLotesArtLst.MaxLotesCod();
            int linNroLot = oLotesArtLst.MaxLotNro(linProCodigo) + 1;

            txtLote.Text = linNroLot.ToString();
            txtCodigoPrecio.Text = linLprCod.ToString();
            lblCodigoLote.Text = linLotCod.ToString();

            //GUARDAR DATOS NUEVO PRODUCTO INGRESADOS
            GuardarDatosProducto_Sesion();

            pnlEditProductos.Visible = false;
            pnlBusqueda.Visible = false;
            pnlProductos.Visible = false;
            pnlListaPrecios.Visible = false ;
            pnlDetallePrecio.Visible = true ;
            lblMensajes.Visible = false;

            txtPrecio.Text = "0";
            txtDescuento.Text = "0";
            txtStockLote.Text = "0";
            txtFecVenceLote.Text = DateTime.Today.ToString(); ;
            chkEstadoPrecio.Checked = true;
        }
        protected void gvwListaPrecios_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //presiona BOTON MODIFICAR EN GRILLA
            if (e.CommandName == "SeleccionaPrecio")
            {

                int linPrecioCodigo;
                linPrecioCodigo = Convert.ToInt32(e.CommandArgument);

                AgregarVariableSession("precioCodigo", linPrecioCodigo);
                AgregarVariableSession("operacionPrecio", 2);

                clsListaPrecios oListaPrecioList = new clsListaPrecios();
                ListaPrecios oListaPrecio = new ListaPrecios();
                oListaPrecio =  oListaPrecioList.GetPrecio(linPrecioCodigo);

                clsLotesArt oLotesArtList = new clsLotesArt();
                LotesArt oLotesArt = new LotesArt();
                oLotesArt = oLotesArtList.GetLotesPrecio(linPrecioCodigo);

                if (oListaPrecio != null)
                {

                    txtCodigoPrecio.Text = oListaPrecio.LprCod.ToString();
                    txtPrecio.Text = oListaPrecio.LprPrecio.ToString();
                    txtDescuento.Text = oListaPrecio.LprDscto.ToString();
                    txtLote.Text = oLotesArt.LotNro.ToString();
                    //grabamos el stock del lote
                    decimal ldeStockLote = 0;
                    if (oLotesArt.LotStock.HasValue )
                       ldeStockLote = oLotesArt.LotStock.Value;

                    txtStockLote.Text = ldeStockLote.ToString();
                    this.AgregarVariableSession("stockLote", ldeStockLote);

                    txtFecVenceLote.Text = oLotesArt.LotFecVenci.ToString();
                    chkEstadoPrecio.Checked = oListaPrecio.LprEstado;
                    lblCodigoLote.Text = oLotesArt.LotCod.ToString();

                    pnlBusqueda.Visible = false;
                    pnlProductos.Visible = false;
                    pnlEditProductos.Visible = false ;
                    pnlListaPrecios.Visible = false;
                    pnlDetallePrecio.Visible = true;
                    lblMensajes.Visible = false;

                    GuardarDatosProducto_Sesion();
                }
            }
            //presiona BOTON ELIMINAR EN GRILLA
            if (e.CommandName == "EliminaPrecio")
            {
                int linPrecioCodigo;
                linPrecioCodigo = Convert.ToInt32(e.CommandArgument);

                clsListaPrecios oListaPrecioList = new clsListaPrecios();
                ListaPrecios oListaPrecio = new ListaPrecios();
                oListaPrecio = oListaPrecioList.GetPrecio(linPrecioCodigo);
                oListaPrecio.LprEstado = false;

                clsLotesArt oLotesArtList = new clsLotesArt();
                LotesArt oLotesArt = new LotesArt();
                oLotesArt = oLotesArtList.GetLotesPrecio(linPrecioCodigo);
                oLotesArt.LotEstado = false;

                oListaPrecioList.Update(oListaPrecio);
                oListaPrecioList.SaveChanges();

                oLotesArtList.Update(oLotesArt);
                oLotesArtList.SaveChanges();

                lblMensajes.Visible = true;
                lblMensajes.Text = "El registro se Elimino Satisfactoriamente.";
                this.MessageBox("El registro se Elimino Satisfactoriamente.");

            }
        }
        private void EventoGuardarPrecio()
        {
            int linOperacion = (int)LeerVariableSesion("operacionPrecio");

            if (linOperacion == 1)        //NUEVO
            {
                int linProCodigo = (int)LeerVariableSesion("proCodigo");

                clsListaPrecios oListaPrecioLst = new clsListaPrecios();
                clsLotesArt oLotesArtLst = new clsLotesArt();

                ListaPrecios oListaPrecio = new ListaPrecios();
                LotesArt oLotesArt = new LotesArt();

                int linLprCod = oListaPrecioLst.MaxListaPrecioCod() + 1;
                int linLotCod = oLotesArtLst.MaxLotesCod() + 1;
                int linNroLot = oLotesArtLst.MaxLotNro(linProCodigo) + 1;

                oListaPrecio.LprPrecio = Convert.ToDecimal( txtPrecio.Text);
                oListaPrecio.LprDscto = Convert.ToDecimal( txtDescuento.Text);
                oListaPrecio.LprCod = linLprCod;
                oListaPrecio.LprFecRegis = DateTime.Today;
                oListaPrecio.LprEstado = true;
                oListaPrecio.ArtCod = linProCodigo;

                oLotesArt.LotStock = Convert.ToDecimal(txtStockLote.Text);
                oLotesArt.LotFecVenci = DateTime.Parse( txtFecVenceLote.Text);
                oLotesArt.LprCod = linLprCod;
                oLotesArt.LotCod = linLotCod;
                oLotesArt.LotNro = Convert.ToInt32(txtLote.Text);
                oLotesArt.LotFecModi = DateTime.Today;
                oLotesArt.LotFecRegis = DateTime.Today;
                oLotesArt.LotEstado = true;

                try
                {
                    oListaPrecioLst.Add(oListaPrecio);
                    oListaPrecioLst.SaveChanges();

                    oLotesArtLst.Add(oLotesArt);
                    oLotesArtLst.SaveChanges();

                    RestaurarDatosProducto_sesion();

                    lblMensajes.Visible = true;
                    lblMensajes.Text = "El registro se Grabo Satisfactoriamente.";
                    this.MessageBox("El registro se Grabo Satisfactoriamente.");
                    pnlBusqueda.Visible = false;
                    //pnlTipoProductos.Visible = false;
                    pnlProductos.Visible = false;
                    pnlEditProductos.Visible = true;
                    pnlListaPrecios.Visible = true;
                    pnlDetallePrecio.Visible = false;
                }
                catch (Exception ex)
                {
                    lblMensajes.Text = "Error:" + ex.Message;
                    this.MessageBox("Error:" + ex.Message);
                }

            }
            else             // MODIFICAR
            {
                int linPrecioCodigo = (int)LeerVariableSesion("precioCodigo");

                ListaPrecios oListaPrecio = new ListaPrecios();
                clsListaPrecios oListaPrecioLst  =  new clsListaPrecios ();
                oListaPrecio =  oListaPrecioLst.GetPrecio(linPrecioCodigo);

                LotesArt oLotesArt = new LotesArt();
                clsLotesArt oLotesArtLst = new clsLotesArt();
                oLotesArt = oLotesArtLst.GetLotesPrecio(oListaPrecio.LprCod);

                oListaPrecio.LprPrecio = Convert.ToDecimal( txtPrecio.Text);
                oListaPrecio.LprDscto = Convert.ToDecimal( txtDescuento.Text);

                oLotesArt.LotStock = Convert.ToDecimal(txtStockLote.Text);
                oLotesArt.LotFecVenci = DateTime.Parse( txtFecVenceLote.Text);

                try
                {
                    oListaPrecioLst.Update(oListaPrecio);
                    oListaPrecioLst.SaveChanges();

                    oLotesArtLst.Update(oLotesArt);
                    oLotesArtLst.SaveChanges();

                    lblMensajes.Visible = true;
                    lblMensajes.Text = "El registro se Grabo Satisfactoriamente.";
                    this.MessageBox("El registro se Grabo Satisfactoriamente.");
                    pnlBusqueda.Visible = false;
                    //pnlTipoProductos.Visible = false;
                    pnlProductos.Visible = false;
                    pnlEditProductos.Visible = true;
                    pnlListaPrecios.Visible = true;
                    pnlDetallePrecio.Visible = false;

                    RestaurarDatosProducto_sesion();
                }
                catch (Exception ex)
                {
                    lblMensajes.Text = "Error:" + ex.Message;
                    this.MessageBox("Error:" + ex.Message);
                }

            }
        }
 private void MostrarPreciosLotes(int pArtCod)
 {
     clsLotesArt oLotesArtLst = new clsLotesArt();
     gvwListaPrecios.DataSource = oLotesArtLst.GetListaLotes(pArtCod);
     gvwListaPrecios.DataBind();
 }
        protected void gvwListaPrecios_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int linProCodigo = (int)LeerVariableSesion("proCodigo");
            //presiona BOTON MODIFICAR EN GRILLA
            if (e.CommandName == "SeleccionaPrecio")
            {

                int LoteCodigo;
                LoteCodigo = Convert.ToInt32(e.CommandArgument);

                AgregarVariableSession("loteCodigo", LoteCodigo);
                AgregarVariableSession("operacionPrecio", 2);

                clsLotesArt oLotesArtList = new clsLotesArt();
                LotesArt oLotesArt = new LotesArt();
                oLotesArt = oLotesArtList.GetLoteArt(linProCodigo,LoteCodigo);

                if (oLotesArt != null)
                {

                    txtCodigoPrecio.Text = oLotesArt.LotCod.ToString();
                    txtPrecio.Text = oLotesArt.LotPrecioVen.ToString();
                    txtDescuento.Text = "0.0";
                    txtLote.Text = oLotesArt.LotNro.ToString();
                    //grabamos el stock del lote
                    decimal ldeStockLote = 0;
                    if (oLotesArt.LotStock.HasValue )
                       ldeStockLote = oLotesArt.LotStock.Value;

                    txtStockLote.Text = ldeStockLote.ToString();
                    this.AgregarVariableSession("stockLote", ldeStockLote);

                    DateTime FechaVenci ;

                    FechaVenci = oLotesArt.LotFecVenci.Value;

                    txtFecVenceLote.Text = FechaVenci.ToString("yyyy-MM-dd");
                    if (oLotesArt.LotEstado == "A")
                        chkEstadoPrecio.Checked = true;
                    else
                        chkEstadoPrecio.Checked = false;

                    lblCodigoLote.Text = oLotesArt.LotCod.ToString();

                    pnlBusqueda.Visible = false;
                    pnlProductos.Visible = false;
                    pnlEditProductos.Visible = false ;
                    pnlListaPrecios.Visible = false;
                    pnlDetallePrecio.Visible = true;
                    lblMensajes.Visible = false;

                    GuardarDatosProducto_Sesion();
                }
            }
            //presiona BOTON ELIMINAR EN GRILLA
            if (e.CommandName == "EliminaPrecio")
            {
                int LoteCodigo;
                LoteCodigo = Convert.ToInt32(e.CommandArgument);

                clsLotesArt oLotesArtList = new clsLotesArt();
                LotesArt oLotesArt = new LotesArt();
                oLotesArt = oLotesArtList.GetLoteArt(linProCodigo, LoteCodigo);
                oLotesArt.LotEstado = "I";
                oLotesArt.LotStock = 0;
                oLotesArt.LotPrecioCom = 0;
                oLotesArt.LotPrecioVen = 0;

                try
                {
                    oLotesArtList.Update(oLotesArt);
                    oLotesArtList.SaveChanges();

                    RestaurarDatosProducto_sesion();

                    txtStock.Text = CalcularStock(linProCodigo).ToString();
                    EventoGuardar(false );

                    lblMensajes.Visible = true;
                    lblMensajes.Text = "El registro se Elimino Satisfactoriamente.";
                    this.MessageBox("El registro se Elimino Satisfactoriamente.");
                }
                catch (Exception ex)
                {
                    lblMensajes.Visible = true;
                    lblMensajes.Text = ex.Message;
                    this.MessageBox(ex.Message);
                }
            }
        }
        private void EventoEliminar(int proCodigo)
        {
            clsLotesArt oLotesArtLst = new clsLotesArt();
            var lstPreciosLotes = oLotesArtLst.GetListaLotes(proCodigo);

            if (lstPreciosLotes.Count > 0)
            {
                lblMensajes.Text = "No se pudo ELIMINAR el registro, tiene Precios Asignados.";
                this.MessageBox("No se pudo ELIMINAR el registro, tiene Precios Asignados.");
            }
            else
            {

                CArticulo oArticulo = new CArticulo();
                int nResp = oArticulo.fnArticuloDelete(proCodigo);
                if (nResp <= 0)
                {
                    lblMensajes.Visible = true;
                    if (oArticulo.NroError == 547)
                    {
                        lblMensajes.Text = "No se pudo ELIMINAR el registro, tiene Precios Asignados.";
                        this.MessageBox("No se pudo ELIMINAR el registro, tiene Precios Asignados.");
                    }
                    else
                    {
                        lblMensajes.Text = oArticulo.DescripcionError;
                        this.MessageBox(oArticulo.DescripcionError);
                    }
                }
                else
                {
                    lblMensajes.Visible = true;
                    lblMensajes.Text = "El registro se Eliminó Satisfactoriamente.";
                    this.MessageBox("El registro se Eliminó Satisfactoriamente.");

                    string sBuscado = this.LeerVariableSesion("sBuscado").ToString();
                    EventoBuscarProductos(sBuscado);

                }
            }
        }
        private decimal CalcularStock(int pArtCod)
        {
            Decimal decStockTotal = 0;
            int linProCodigo = (int)LeerVariableSesion("proCodigo");
            clsLotesArt oLotesArtLst = new clsLotesArt();
            var lstPreciosLotes = oLotesArtLst.GetListaLotes(linProCodigo);

            decStockTotal = (decimal)lstPreciosLotes.Sum(Lo => Lo.LotStock);
            return decStockTotal;
        }
        protected void lsbArticulos_SelectedIndexChanged(object sender, EventArgs e)
        {
            nTasIGV = double.Parse(lblTasIGV.Value);
            int ArtCod = 0;
            int PrvCod = 0;
            int LotNro = 0;
            double LprPrecio = 0.0;
            double LprDscto = 0.0;
            double nPrecio = 0.0;
            ArtCod = int.Parse(lsbArticulos.SelectedValue);
            PrvCod = int.Parse(ddlLaboratorios.SelectedValue);

            txtLotVenci.Text = "";
            txtLotNro.Text = "";
            txtLotStock.Text = "0";

            clsArticulos lstArticulos = new clsArticulos();
            clsListaPrecios lstPrecios = new clsListaPrecios();
            clsLotesArt lstLotesArt = new clsLotesArt();
            Articulos oArticulo = new Articulos();
            ListaPrecios oPrecio = new ListaPrecios();
            LotesArt oLoteArt = new LotesArt();

            txtLotNro.Enabled = false;
            txtLotVenci.Enabled = false;
            txtLotStock.Enabled = false;
            txtArtDescuento.Enabled = true;

            oPrecio = lstPrecios.GetArticuloPrecio(ArtCod);
            oLoteArt = lstLotesArt.GetLoteArt(ArtCod);

            //oLoteArt.ListaPrecios.Articulos

            oArticulo = lstArticulos.GetArticulo(ArtCod);
            if (oArticulo != null)
            {
                txtArtCod.Text = oArticulo.ArtCod.ToString();
                txtArtUniMed.Text = oArticulo.Unidades.UniDescripcion;
                txtStockFact.Text = oArticulo.ArtStockFac.ToString();
                txtStockFis.Text = oArticulo.ArtStock.ToString();
                hideStockLote.Value = lstLotesArt.GetLoteArtStock(ArtCod).ToString();

                if (oLoteArt != null)
                {
                    txtLotNro.Text = oLoteArt.LotNro.ToString();
                    txtLotStock.Text = oLoteArt.LotStock.ToString();
                    if (oLoteArt.LotFecVenci != null)
                        txtLotVenci.Text = ((DateTime)oLoteArt.LotFecVenci).ToString("yyyy-MM-dd");
                }

                if (oArticulo.ArtStock <= 0)
                    txtStockFis.ForeColor = System.Drawing.Color.Red;
                else
                    txtStockFis.ForeColor = System.Drawing.Color.Gray;

                txtArtPreUnitario.Text = lstPrecios.GetCostoPromedio(ArtCod, nTasIGV).ToString();

                //if (oPrecio == null)
                //    txtArtPreUnitario.Text = "0.0";
                //else
                //{
                //    nPrecio = (double)oPrecio.LprPrecio;
                //    var nDcto = Math.Round((nPrecio * (double)oPrecio.LprDscto / 100), 2);
                //    nPrecio -= nDcto;
                //    var nFlete = Math.Round(nPrecio / 100, 2);
                //    nPrecio += nFlete;
                //    var nIgv = Math.Round(nPrecio * nTasIGV, 2);
                //    nPrecio += nIgv;
                //    if (oArticulo.Proveedores.PrvGanancia != 0)
                //        nPrecio = Math.Round((nPrecio * (double)oArticulo.Proveedores.PrvGanancia), 2);
                //    txtArtPreUnitario.Text = nPrecio.ToString();
                //}

                if (BuscarArticulo(oArticulo.ArtCod, ref LotNro, ref LprPrecio, ref LprDscto))
                {
                    txtArtDescuento.Enabled = false;
                    txtArtDescuento.Text = LprDscto.ToString();
                }
                else
                {
                    txtArtDescuento.Enabled = true;
                    txtArtDescuento.Text = "0";
                }
                txtArtCant.Text = "1";
            }
            else
                txtArtCant.Text = "0";

            txtImpTotal.Text = "0.0";

            lstArticulos = null;
            oArticulo = null;
            lstPrecios = null;
            oPrecio = null;

            CalcularTotalArticulo();
            lsbArticulos.Focus();
        }
        protected void lsbArticulos_SelectedIndexChanged(object sender, EventArgs e)
        {
            int ArtCod = 0;
            int LotNro = 0;
            double LprPrecio = 0.0;
            double LprDscto = 0.0;

            if (lsbArticulos.SelectedValue != "")
                ArtCod = int.Parse(lsbArticulos.SelectedValue);

            clsArticulos lstArticulos = new clsArticulos();
            clsListaPrecios lstPrecios = new clsListaPrecios();
            clsLotesArt lstLotesArt = new clsLotesArt();
            Articulos oArticulo = new Articulos();
            ListaPrecios oPrecio = new ListaPrecios();

            oPrecio = lstPrecios.GetArticuloPrecio(ArtCod);
            oArticulo = lstArticulos.GetArticulo(ArtCod);

            if (oArticulo != null) {
                txtArtCod.Text = oArticulo.ArtCod.ToString();
                txtArtUniMed.Text = oArticulo.Unidades.UniDescripcion;
                txtStockFact.Text = oArticulo.ArtStockFac.ToString();
                txtStockFis.Text = oArticulo.ArtStock.ToString();
                txtArtDescuento.Text = (oArticulo.Proveedores.PrvDscto).ToString();
                ddlTipDcto.SelectedValue = "%";
                txtLotVenci.Text = DateTime.Now.AddDays(30).ToString("yyyy-MM-dd");
                ddlLaboratorios.SelectedValue = oArticulo.PrvCod.ToString();
                hideStockLote.Value = lstLotesArt.GetLoteArtStock(ArtCod).ToString();

                if (oArticulo.ArtStock <= 0)
                {
                    txtStockFis.ForeColor = System.Drawing.Color.Red;
                }
                else
                {
                    txtStockFis.ForeColor = System.Drawing.Color.Gray;
                }

                if (oPrecio == null)
                {
                    txtArtPreUnitario.Text = "0.0";
                }
                else
                {
                    txtArtPreUnitario.Text = oPrecio.LprPrecio.ToString();
                }

                if (BuscarArticulo(oArticulo.ArtCod, ref LotNro, ref LprPrecio, ref LprDscto))
                {
                    if (lblEstadoVenArticulo.Value == "NORMAL")
                        txtArtPreUnitario.Enabled = false;
                    else
                        txtArtPreUnitario.Enabled = true;
                    txtLotNro.Enabled = false;
                    txtLotNro.Text = LotNro.ToString();
                    txtArtPreUnitario.Text = LprPrecio.ToString();
                }
                else
                {
                    txtArtPreUnitario.Enabled = true;
                    txtLotNro.Enabled = true;
                    LotNro = lstLotesArt.MaxLotNro(ArtCod);
                    txtLotNro.Text = (LotNro + 1).ToString();
                }
                if (lblEstadoVenArticulo.Value == "NORMAL")
                    txtArtCant.Text = "1";
            }
            else
                LimpiarCamposArticulos();

            txtImpTotal.Text = "0.0";

            lstArticulos = null;
            oArticulo = null;
            lstPrecios = null;
            oPrecio = null;
            lstLotesArt = null;

            CalcularTotalArticulo();
            lsbArticulos.Focus();
        }
Exemplo n.º 10
0
        protected void lsbArticulos_SelectedIndexChanged(object sender, EventArgs e)
        {
            nTasIGV = double.Parse(lblTasIGV.Value);
            int ArtCod = 0;
            int PrvCod = 0;
            int LotNro = 0;
            double LprPrecio = 0.0;
            double LprDscto = 0.0;
            double nTipCam = g_nTipoCambio;

            //VARIABLES PARA TOMAR PRECIO SIN CALCULAR FLETE  E  IGV
            DateTime dLotFecRegis = DateTime.Today;
            int nLotNro;
            double nLprPrecio = 0.0;

            ArtCod = int.Parse(lsbArticulos.SelectedValue);
            PrvCod = int.Parse(ddlLaboratorios.SelectedValue);

            txtLotVenci.Text = "";
            txtLotNro.Text = "";
            txtLotStock.Text = "0";

            clsArticulos lstArticulos = new clsArticulos();
            clsLotesArt lstLotesArt = new clsLotesArt();
            Articulos oArticulo = new Articulos();
            LotesArt oLoteArt = new LotesArt();

            txtLotNro.Enabled = false;
            txtLotVenci.Enabled = false;
            txtLotStock.Enabled = false;
            txtArtDescuento.Enabled = true;

            oLoteArt = lstLotesArt.GetLoteArt(ArtCod);

            if (oLoteArt != null)
            {
                nLotNro = oLoteArt.LotNro;
                if (oLoteArt.LotFecModi.HasValue)
                    dLotFecRegis = oLoteArt.LotFecRegis.Value;

                if (oLoteArt.LotPrecioVen.HasValue)
                    nLprPrecio = (double)oLoteArt.LotPrecioVen;
            }
            else
                nLotNro = 0;

            oArticulo = lstArticulos.GetArticulo(ArtCod);
            nLprPrecio = (double)oArticulo.ArtCostoProm;

            if (oArticulo != null)
            {
                txtArtCod.Text = oArticulo.ArtCod.ToString();
                txtArtUniMed.Text = oArticulo.Unidades.UniDescripcion;
                txtStockFact.Text = oArticulo.ArtStockFac.ToString();
                txtStockFis.Text = oArticulo.ArtStock.ToString();
                hideStockLote.Value = lstLotesArt.GetLoteArtStock(ArtCod).ToString();

                if (oLoteArt != null)
                {
                    txtLotNro.Text = oLoteArt.LotNro.ToString();
                    txtLotStock.Text = oLoteArt.LotStock.ToString();
                    if (oLoteArt.LotFecVenci != null)
                        txtLotVenci.Text = ((DateTime)oLoteArt.LotFecVenci).ToString("yyyy-MM-dd");
                    else
                        txtLotVenci.Text = DateTime.Today.ToString("yyyy-MM-dd");

                }

                if (oArticulo.ArtStock <= 0)
                    txtStockFis.ForeColor = System.Drawing.Color.Red;
                else
                    txtStockFis.ForeColor = System.Drawing.Color.Gray;

                //if (nLotNro == 1 && DateTime.Compare(dLotFecRegis, DateTime.Parse("2013-04-09")) == 0)
                //    txtArtPreUnitario.Text = Math.Round(((nLprPrecio * (double)oArticulo.Proveedores.PrvGanancia) / nTipCam), 2).ToString();
                //else
                //    txtArtPreUnitario.Text = Math.Round((lstPrecios.GetCostoPromedio(ArtCod, nTasIGV) / nTipCam), 2).ToString();

                /////Cambio hecho 06-06-2013 se desea q se muestre elprecio venta q se ve en  el modulo almacen -articulos///
                //////////silvia////////////////////////////////////////////////////////////////////////////////////////////
                txtArtPreUnitario.Text = Math.Round(((nLprPrecio) / nTipCam), 2).ToString("0.00");
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////

                //txtArtPreUnitario.Text = Math.Round((lstPrecios.GetCostoPromedio(ArtCod, nTasIGV) / nTipCam), 2).ToString();

                if (BuscarArticulo(oArticulo.ArtCod, ref LotNro, ref LprPrecio, ref LprDscto))
                {
                    txtArtDescuento.Enabled = false;
                    txtArtDescuento.Text = LprDscto.ToString();
                }
                else
                {
                    txtArtDescuento.Enabled = true;
                    txtArtDescuento.Text = "0";
                }
                txtArtCant.Text = "1";
            }
            else
                txtArtCant.Text = "0";

            txtImpTotal.Text = "0.0";

            lstArticulos = null;
            oArticulo = null;

            CalcularTotalArticulo();
            lsbArticulos.Focus();
        }