using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using LLNet.Utils;
using LLNet.GUI;
using System.Data.OracleClient;

namespace LLNet.Tienda.MainForms
{
    public partial class frm_retiros_IMP : Form
    {
        public static string id_retiro;
        public frm_retiros_IMP()
        {
            InitializeComponent();
        }

        private void frm_retiros_IMP_Load(object sender, EventArgs e)
        {

        }

        private void gridControl1_Load(object sender, EventArgs e)
        {
            string user_pos;
            string jornada_actual;


            user_pos = GUI.CApp.usuario.ToString();
            jornada_actual = Convert.ToString(Program.Jornada);

            // Emanuel Carvajal Marin -- !*******************************************************************

            string conexion = CApp.bll.ConnectionString;
            OracleConnection orc = new OracleConnection(conexion);
            string consulta_sql;


            consulta_sql = ("SELECT * FROM v_retiros_caja WHERE JORNADA ='" + jornada_actual + "'AND USUARIO = '" + user_pos + "'");


            OracleDataAdapter da = new OracleDataAdapter(consulta_sql, orc);
            System.Data.DataSet ds = new System.Data.DataSet();

            da.Fill(ds, "v_retiros_caja");

            //Bloq Edicịn de Datos.



            gridControl1.DataSource = ds;
            gridControl1.DataMember = "v_retiros_caja";
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            id_retiro = "";
            foreach (int handle in gridView1.GetSelectedRows())
            {
                id_retiro = Convert.ToString(gridView1.GetRowCellValue(handle, colRetiro));
            }

            Reporte_Impreso___Retiros.report_viewer frm = new Reporte_Impreso___Retiros.report_viewer();
            frm.ShowDialog();

        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.Hide();


        }
    }
}