public static DataSet AL_ListaPrecio_qry(ElistPrecio_Detalle obj)
        {
            DBAccess db = new DBAccess();

               db.AddParameter("@psintypesel", obj.psintypesel);
               db.AddParameter("@pidEmpresa", obj.IdEmpresa);
               db.AddParameter("@ds_producto", obj.ds_producto);
               db.AddParameter("@nu_tf", obj.NuTF);

               return db.ExecuteDataSet("Al_ListadoPrecio_qry");
        }
        private void dgProducto_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                ElistPrecio_Detalle obj = new ElistPrecio_Detalle();

                obj.Precio_mnt = Convert.ToDecimal(dgProducto.CurrentRow.Cells["precio_mnt"].Value);
                pasard(obj);

                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void dgProducto_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {

                if (nuItem.Text == "0")
                {

                    MessageBox.Show("No hay registros", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_producto.Focus();
                }
                else
                {

                    ElistPrecio_Detalle obj = new ElistPrecio_Detalle();

                    obj.Precio_mnt = Convert.ToDecimal(dgProducto.CurrentRow.Cells["precio_mnt"].Value);
                    pasard(obj);

                    this.Dispose();
                    e.SuppressKeyPress = true;
                }
            }
        }
 public static DataSet AL_ListaPrecio_qry(ElistPrecio_Detalle obj)
 {
     return DlistPrecio_Detalle.AL_ListaPrecio_qry(obj);
 }
 public void ejecutarPrecio(ElistPrecio_Detalle lp)
 {
     txtprecio.Text = lp.Precio_mnt.ToString();
 }
        private void ListarPrecio()
        {
            try
            {
                ElistPrecio_Detalle obj = new ElistPrecio_Detalle();
                if (psintypesel == 1)
                {
                    obj.psintypesel = 1;
                    obj.IdEmpresa = wfChgEmpPer.datos.idEmpresa;

                    if (_lblproducto != "")
                    {
                        obj.ds_producto = _lblproducto;
                    }
                    else
                    {
                        obj.ds_producto = txt_producto.Text;
                    }
                    obj.NuTF = txt_nutf.Text;
                    DataSet ds = BlistPrecio_Detalle.AL_ListaPrecio_qry(obj);
                    dgProducto.DataSource = ds.Tables[0];
                    nuItem.Text = Convert.ToInt16(dgProducto.RowCount).ToString();
                }
                else if (psintypesel == 2)
                {
                    obj.psintypesel = 2;
                    obj.IdEmpresa = wfChgEmpPer.datos.idEmpresa;

                    if (_lblproducto != "")
                    {
                        obj.ds_producto = _lblproducto;
                    }
                    else
                    {
                        obj.ds_producto = txt_producto.Text;
                    }

                    obj.NuTF = txt_nutf.Text;

                    DataSet ds = BlistPrecio_Detalle.AL_ListaPrecio_qry(obj);
                    dgProducto.DataSource = ds.Tables[0];
                    nuItem.Text = Convert.ToInt16(dgProducto.RowCount).ToString();
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }