Exemplo n.º 1
0
        private void txt_CodigoBarra_TextChanged(object sender, EventArgs e)
        {
            int       b           = 0;
            string    CodigoBarra = txt_CodigoBarra.Text;
            cInsumo   insumo      = new cInsumo();
            DataTable trdoIn      = insumo.GetInsumoxCodigoBarra(CodigoBarra);

            if (trdoIn.Rows.Count > 0)
            {
                if (trdoIn.Rows[0]["CodInsumo"].ToString() != "")
                {
                    b = 1;
                    Int32 CodInsumo = Convert.ToInt32(trdoIn.Rows[0]["CodInsumo"].ToString());
                    txt_Cantidad.Text = trdoIn.Rows[0]["Cantidad"].ToString();
                    //cInsumo insumo = new cInsumo();
                    DataTable trdo = insumo.GetInsumoxCodigo(CodInsumo);
                    if (trdo.Rows.Count > 0)
                    {
                        txtCodigo.Text  = CodInsumo.ToString();
                        txt_Nombre.Text = trdo.Rows[0]["Nombre"].ToString();
                        txt_Precio.Text = trdo.Rows[0]["Precio"].ToString();
                        if (trdo.Rows[0]["ActualizaStock"].ToString() == "1")
                        {
                            chk_ActualizaStock.Checked = true;
                        }
                        else
                        {
                            chk_ActualizaStock.Checked = false;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void txtCodigoBarra_TextChanged(object sender, EventArgs e)
        {
            int       b           = 0;
            string    CodigoBarra = txtCodigoBarra.Text;
            cInsumo   insumo      = new cInsumo();
            DataTable trdoIn      = insumo.GetInsumoxCodigoBarra(CodigoBarra);

            if (trdoIn.Rows.Count > 0)
            {
                if (trdoIn.Rows[0]["CodInsumo"].ToString() != "")
                {
                    b = 1;
                    Int32 CodInsumo = Convert.ToInt32(trdoIn.Rows[0]["CodInsumo"].ToString());
                    //cInsumo insumo = new cInsumo();
                    DataTable trdo = insumo.GetInsumoxCodigo(CodInsumo);
                    if (trdo.Rows.Count > 0)
                    {
                        txtCodigo.Text   = trdo.Rows[0]["CodInsumo"].ToString();
                        txtCantidad.Text = trdo.Rows[0]["Cantidad"].ToString();
                        txt_Precio.Text  = trdo.Rows[0]["Precio"].ToString();
                        txt_Nombre.Text  = trdo.Rows[0]["Nombre"].ToString();
                        if (txtCantidad.Text == "")
                        {
                            txtCantidad.Text = "0";
                        }

                        if (txt_Precio.Text != "")
                        {
                            txt_Precio.Text = fun.SepararDecimales(txt_Precio.Text);
                            txt_Precio.Text = fun.FormatoEnteroMiles(txt_Precio.Text);
                        }
                        AplicarPorcentaje();
                    }
                }
            }
            if (b == 0)
            {
                txtCodigo.Text   = "";
                txtCantidad.Text = "";
                txt_Precio.Text  = "";
                txt_Nombre.Text  = "";
            }
        }
Exemplo n.º 3
0
        private void BuscarInsumoxCodBarra(string CodigoBarra)
        {
            cInsumo   insumo = new cInsumo();
            DataTable trdo   = insumo.GetInsumoxCodigoBarra(CodigoBarra);
            int       b      = 0;

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["CodInsumo"].ToString() != "")
                {
                    b = 1;
                    Int32 CodInsumo = Convert.ToInt32(trdo.Rows[0]["CodInsumo"].ToString());
                    BuscarInsumoxCodigo(CodInsumo);
                }
            }
            if (b == 0)
            {
                txtCodigo.Text      = "";
                txtCantidad.Text    = "";
                txt_Precio.Text     = "";
                txt_Nombre.Text     = "";
                txtPrecioVenta.Text = "";
            }
        }