private void btn_excel_Click(object sender, EventArgs e)
        {
            var BL = new tb_60movimientosdetBL();
            var BE = new tb_60movimientosdet();
            var TablaMov_ordprod = new DataTable();
            BE.moduloid = modulo.Trim();
            BE.local = local.Trim();
            BE.fechdocini = Convert.ToDateTime(fechdocini.Text.Trim().Substring(0, 10));
            BE.fechdocfin = Convert.ToDateTime(fechdocfin.Text.Trim().Substring(0, 10));
            BE.ser_opi = serop_ini.Text.Trim();
            BE.num_opi = numop_ini.Text.Trim();
            BE.ser_opf = serop_fin.Text.Trim();
            BE.num_opf = numop_fin.Text.Trim();
            if (almacaccionid.SelectedIndex != -1 && almacaccionid.SelectedItem.ToString().Trim().Length > 0)
            {
                BE.almacaccionid = almacaccionid.SelectedValue.ToString();
            }
            BE.filtro = "1";

            TablaMov_ordprod = BL.GetAll_ConsumoxOP(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            if (TablaMov_ordprod.Rows.Count > 0)
            {
                ExportarExcel(TablaMov_ordprod);
            }
        }
Ejemplo n.º 2
0
        private DataTable Movimiento_mov_ordprod()
        {
            DtReporte = new DataTable("Productostock");
            try
            {
                var BL = new tb_60movimientosdetBL();
                var BE = new tb_60movimientosdet();

                BE.moduloid = moduloid.Trim();
                BE.local = local.Trim();

                BE.fechdocini = Convert.ToDateTime(fechdocini.Trim().Substring(0, 10));
                BE.fechdocfin = Convert.ToDateTime(fechdocfin.Trim().Substring(0, 10));
                if (serop_ini.Trim().Length > 0)
                {
                    BE.ser_opi = serop_ini.Trim().PadLeft(4, '0');
                }
                if (numop_ini.Trim().Length > 0)
                {
                    BE.num_opi = numop_ini.Trim().PadLeft(10, '0');
                }
                if (serop_fin.Trim().Length > 0)
                {
                    BE.ser_opf = serop_fin.Trim().PadLeft(4, '0');
                }
                if (numop_fin.Trim().Length > 0)
                {
                    BE.num_opf = numop_fin.Trim().PadLeft(10, '0');
                }
                if (almacaccionid.Trim().Length > 0)
                {
                    BE.almacaccionid = almacaccionid;
                }

                DtReporte = BL.GetAll_ConsumoxOP(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
                if (DtReporte != null)
                {
                    return DtReporte;
                }
                else
                {
                    return DtReporte;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }