Ejemplo n.º 1
0
        private void Update()
        {
            try
            {
                if (lineaid.Text.Trim().Length != 3)
                {
                    MessageBox.Show("Falta Codigo linea !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (lineaname.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Ingrese nombre de línea", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    tb_me_lineaBL BL = new tb_me_lineaBL();
                    tb_me_linea BE = new tb_me_linea();
                    BE.moduloid = modulo;
                    BE.lineaid = lineaid.Text.Trim().PadLeft(3, '0');
                    BE.lineaname = lineaname.Text.ToUpper();
                    BE.nostock = Convert.ToBoolean(nostock.SelectedIndex);
                    if (estructuraid.SelectedValue != null && estructuraid.Text.Trim().Length > 0)
                        BE.estructuraid = estructuraid.SelectedValue.ToString();
                    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);
            }
        }
Ejemplo n.º 2
0
        private DataTable Movimiento_linea()
        {
            try
            {
                var TablaLinea = new DataTable("Linea");

                var BL = new tb_me_lineaBL();
                var BE = new tb_me_linea();

                BE.moduloid = moduloid.Trim();

                TablaLinea = BL.GetReport(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
                if (TablaLinea != null)
                {
                    return TablaLinea;
                }
                else
                {
                    return null;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Ejemplo n.º 3
0
        private void form_cargar_datos(String posicion)
        {
            try
            {
                tb_me_lineaBL BL = new tb_me_lineaBL();
                tb_me_linea BE = new tb_me_linea();
                DataTable dt = new DataTable();

                BE.moduloid = modulo;
                if (lineaid.Text.Trim().Length > 0)
                {
                    BE.lineaid = lineaid.Text.Trim().PadLeft(3, '0');
                }
                BE.posicion = posicion.Trim();

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

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

                    lineaid.Text = dt.Rows[0]["lineaid"].ToString().Trim();
                    lineaname.Text = dt.Rows[0]["lineaname"].ToString().Trim();
                    nostock.SelectedIndex = Convert.ToInt16(dt.Rows[0]["nostock"].ToString());

                    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_log.Enabled = true;
                    btn_salir.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        private void Delete()
        {
            try
            {
                if (lineaid.Text.Trim().Length != 3)
                {
                    MessageBox.Show("Falta Codigo linea !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    tb_me_lineaBL BL = new tb_me_lineaBL();
                    tb_me_linea BE = new tb_me_linea();
                    BE.moduloid = modulo;
                    BE.lineaid = lineaid.Text.Trim().PadLeft(3, '0');
                    BE.lineaname = lineaname.Text.ToUpper();
                    if (estructuraid.SelectedValue != null && estructuraid.Text.Trim().Length > 0)
                        BE.estructuraid = estructuraid.SelectedValue.ToString();
                    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();
                        form_bloqueado(false);
                        data_Tablalinea();
                        btn_nuevo.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 5
0
        private void data_Tablalinea()
        {
            try
            {
                if (Tablalinea.Rows.Count > 0)
                    Tablalinea.Rows.Clear();
                tb_me_lineaBL BL = new tb_me_lineaBL();
                tb_me_linea BE = new tb_me_linea();

                BE.moduloid = modulo;
                BE.lineaname = txt_criterio.Text.Trim().ToUpper();

                Tablalinea = BL.GetAll(EmpresaID, BE).Tables[0];
                if (Tablalinea.Rows.Count > 0)
                {
                    btn_imprimir.Enabled = true;
                    gridlinea.DataSource = Tablalinea;
                    gridlinea.Rows[0].Selected = false;
                    gridlinea.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 6
0
        private void ValidaLinea()
        {
            if (lineaid.Text.Trim().Length > 0 && ssModo == "NEW")
            {
                var BL = new tb_me_lineaBL();
                var BE = new tb_me_linea();
                var dt = new DataTable();

                BE.moduloid = modulo;
                BE.lineaid = lineaid.Text.Trim().PadLeft(3, '0');

                dt = BL.GetAll(EmpresaID, BE).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    lineaid.Text = dt.Rows[0]["lineaid"].ToString().Trim();
                    lineaname.Text = dt.Rows[0]["lineaname"].ToString().Trim();
                    generar_denominacion();
                }
                else
                {
                    lineaid.Text = string.Empty;
                    lineaname.Text = string.Empty;
                    generar_denominacion();
                }
            }
            if (lineaid.Text.Trim().Length == 0 && ssModo == "NEW")
            {
                lineaid.Text = string.Empty;
                lineaname.Text = string.Empty;
                generar_denominacion();
            }
        }
        private void ValidaLinea()
        {
            if (lineaid.Text.Trim().Length > 0)
            {
                tb_me_lineaBL BL = new tb_me_lineaBL();
                tb_me_linea BE = new tb_me_linea();
                DataTable dt = new DataTable();

                BE.moduloid = modulo;
                BE.lineaid = lineaid.Text.Trim().PadLeft(3, '0');

                dt = BL.GetAll(EmpresaID, BE).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    lineaid.Text = dt.Rows[0]["lineaid"].ToString().Trim();
                    lineaname.Text = dt.Rows[0]["lineaname"].ToString().Trim();
                }
                else
                {
                    lineaid.Text = "";
                    lineaname.Text = "";
                }
            }
            else
            {
                lineaid.Text = "";
                lineaname.Text = "";
            }
        }