コード例 #1
0
        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();
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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";
     }
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
 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);
     }
 }