private void cmb_temporadaid_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmb_temporadaid.SelectedIndex != -1)
            {
                tb_pt_temporadaBL BL = new tb_pt_temporadaBL();
                tb_pt_temporada BE = new tb_pt_temporada();
                DataTable dt = new DataTable();
                BE.temporadaid = cmb_temporadaid.SelectedValue.ToString();

                try
                {
                    dt = BL.GetAll(EmpresaID, BE).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        lbl01.Text = dt.Rows[0]["mes01"].ToString();
                        lbl02.Text = dt.Rows[0]["mes02"].ToString();
                        lbl03.Text = dt.Rows[0]["mes03"].ToString();
                        lbl04.Text = dt.Rows[0]["mes04"].ToString();
                        lbl05.Text = dt.Rows[0]["mes05"].ToString();
                        lbl06.Text = dt.Rows[0]["mes06"].ToString();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                CargarDatos();
            }
        }
 void data_cbo_temporadaid()
 {
     try
     {
         tb_pt_temporadaBL BL = new tb_pt_temporadaBL();
         tb_pt_temporada BE = new tb_pt_temporada();
         temporadaid.DataSource = BL.GetAll(EmpresaID, BE).Tables[0];
         temporadaid.ValueMember = "temporadaid";
         temporadaid.DisplayMember = "temporadaname";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 void CargarCmbTemporada()
 {
     tb_pt_temporadaBL BL = new tb_pt_temporadaBL();
     tb_pt_temporada BE = new tb_pt_temporada();
     DataTable dt = new DataTable();
     dt = BL.GetAll(EmpresaID, BE).Tables[0];
     if (dt.Rows.Count > 0)
     {
         cmb_temporadaid.DataSource = dt;
         cmb_temporadaid.ValueMember = "temporadaid";
         cmb_temporadaid.DisplayMember = "temporadaname";
     }
 }
 public bool Insert(string empresaid, tb_pt_temporada BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
 public bool Update(string empresaid, tb_pt_temporada BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
 public bool Delete(string empresaid, tb_pt_temporada BE)
 {
     return tablaDA.Delete(empresaid, BE);
 }
 public DataSet GetAll_paginacion(string empresaid, tb_pt_temporada BE)
 {
     return tablaDA.GetAll_paginacion(empresaid, BE);
 }
        private void Update()
        {
            try
            {
                if (temporadaid.Text.Trim().Length != 1)
                {
                    MessageBox.Show("Falta Codigo temporada !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    if (temporadaname.Text.Trim().Length == 0)
                    {
                        MessageBox.Show("Ingrese Nombre de temporada", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        var BL = new tb_pt_temporadaBL();
                        var BE = new tb_pt_temporada();

                        BE.temporadaid = temporadaid.Text.Trim().PadLeft(1, '0');
                        BE.temporadaname = temporadaname.Text.ToUpper();
                        BE.usuar = VariablesPublicas.Usuar.Trim();

                        if (BL.Update(EmpresaID, BE))
                        {
                            SEGURIDAD_LOG("M");
                            MessageBox.Show("Datos modificado correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            procesado = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void form_cargar_datos(String posicion)
        {
            try
            {
                var BL = new tb_pt_temporadaBL();
                var BE = new tb_pt_temporada();
                var dt = new DataTable();

                if (temporadaid.Text.Trim().Length > 0)
                {
                    BE.temporadaid = temporadaid.Text.Trim().PadLeft(1, '0');
                }
                BE.posicion = posicion.Trim();

                dt = BL.GetAll_paginacion(EmpresaID, BE).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    limpiar_documento();
                    ssModo = "EDIT";

                    temporadaid.Text = dt.Rows[0]["temporadaid"].ToString().Trim();
                    temporadaname.Text = dt.Rows[0]["temporadaname"].ToString().Trim();

                    btn_editar.Enabled = true;
                    btn_eliminar.Enabled = true;
                    btn_imprimir.Enabled = true;

                    btn_primero.Enabled = true;
                    btn_anterior.Enabled = true;
                    btn_siguiente.Enabled = true;
                    btn_ultimo.Enabled = true;

                    btn_buscar.Enabled = true;
                    btn_salir.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Delete()
        {
            try
            {
                if (temporadaid.Text.Trim().Length != 1)
                {
                    MessageBox.Show("Falta Codigo temporada !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    var BL = new tb_pt_temporadaBL();
                    var BE = new tb_pt_temporada();

                    BE.temporadaid = temporadaid.Text.Trim().PadLeft(1, '0');
                    BE.temporadaname = temporadaname.Text.ToUpper();
                    BE.usuar = VariablesPublicas.Usuar.Trim();

                    if (BL.Delete(EmpresaID, BE))
                    {
                        SEGURIDAD_LOG("E");
                        MessageBox.Show("Datos eliminados correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        NIVEL_FORMS();
                        limpiar_documento();
                        data_Tablatemporada();
                        form_bloqueado(false);
                        btn_nuevo.Enabled = true;

                        btn_primero.Enabled = true;
                        btn_anterior.Enabled = true;
                        btn_siguiente.Enabled = true;
                        btn_ultimo.Enabled = true;

                        btn_buscar.Enabled = true;
                        btn_salir.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void data_Tablatemporada()
        {
            try
            {
                if (Tablatemporada.Rows.Count > 0)
                {
                    Tablatemporada.Rows.Clear();
                }
                var BL = new tb_pt_temporadaBL();
                var BE = new tb_pt_temporada();

                BE.temporadaname = txt_criterio.Text.Trim().ToUpper();

                Tablatemporada = BL.GetAll(EmpresaID, BE).Tables[0];
                if (Tablatemporada.Rows.Count > 0)
                {
                    btn_imprimir.Enabled = true;
                    gridtemporada.DataSource = Tablatemporada;
                    gridtemporada.Rows[0].Selected = false;
                    gridtemporada.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void data_cbo_temporadaid()
 {
     try
     {
         var BL = new tb_pt_temporadaBL();
         var BE = new tb_pt_temporada();
         var dt = new DataTable();
         dt = BL.GetAll(EmpresaID, BE).Tables[0];
         if (dt.Rows.Count > 0 )
         {
             temporadaid.DataSource = dt;
             temporadaid.ValueMember = "temporadaid";
             temporadaid.DisplayMember = "temporadaname";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }