Esempio n. 1
0
        protected void carga_excel(string sp_informe, string titulo)
        {
            string desde = string.Format("{0:yyyyMMdd}", DateTime.Now);
            string hasta = string.Format("{0:yyyyMMdd}", DateTime.Now);

            if (this.txt_desde.Text.Trim() != "")
            {
                desde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_desde.Text.Trim()));
            }
            if (this.txt_hasta.Text.Trim() != "")
            {
                hasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim()));
            }

            int id_familia = 0;


            string add = "";

            add = new MatrizExcelBC().getmatrizinforme_Excel((string)(Session["usrname"]), desde, hasta, sp_informe, id_familia, titulo);

            string strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + add.ToString().Trim() + "');";

            //ScriptManager.RegisterStartupScript(Page,Page.GetType(), "", strAlerta, true);
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "", strAlerta, true);


            return;
        }
Esempio n. 2
0
        protected void ibExcel_Click(object sender, ImageClickEventArgs e)
        {
            var dt = GetOperaciones(Convert.ToInt32(hdnBusqueda.Value));

            if (dt == null)
            {
                FuncionGlobal.alerta_updatepanel("Debe hacer una busqueda anteriormente para exportar.", Page, udp);
                return;
            }
            //creo el informe y obtengo su nombre
            var informe = new MatrizExcelBC().GetReporteHipotecario(Session["usrname"].ToString(), dt);

            //llamo al informe para ser abierto o guardado.
            var strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + informe.Trim() + "');";

            ScriptManager.RegisterStartupScript(this.UpdatePanel1, UpdatePanel1.GetType(), "", strAlerta, true);
        }
Esempio n. 3
0
        protected void ib_exportar_Click(object sender, ImageClickEventArgs e)
        {
            string desde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_desde.Text.Trim()));
            string hasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim()));


            string add = "";

            if (this.dl_familia.SelectedValue != "19")
            {
                if (this.dpl_nomina.SelectedValue == "0" || this.txt_nomina.Text.Trim() == "")
                {
                    return;
                }

                string titulo = "";

                titulo = "NOMINA AREA: " + this.dl_familia.SelectedItem.Text.Trim() + " - TIPO :  " +
                         this.dpl_nomina.SelectedItem.Text.Trim() + "  NUMERO:  " + this.txt_nomina.Text.Trim();


                add = new MatrizExcelBC().getnominamatrizgasto(Convert.ToInt16(this.dpl_nomina.SelectedValue),
                                                               Convert.ToInt32(this.txt_nomina.Text),
                                                               Convert.ToInt16(this.dl_familia.SelectedValue), titulo);


                FuncionGlobal.alerta_updatepanel("Nomina con detalle de gastos, generada con exito", this.Page, this.up_movimiento);
            }

            else
            {
                add = new MatrizExcelBC().getMatrizRetiroCarpeta(desde, hasta, Session["usrname"].ToString());
            }

            string strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + add.ToString().Trim() + "');";

            //ScriptManager.RegisterStartupScript(up, pPagina.GetType(), "", strAlerta, true);
            ScriptManager.RegisterStartupScript(this.up_movimiento, this.up_movimiento.GetType(), "", strAlerta, true);


            return;
        }
Esempio n. 4
0
        protected void ib_exportar_Click(object sender, ImageClickEventArgs e)
        {
            string desde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_desde.Text.Trim()));
            string hasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim()));


            string add = "";

            if (this.dl_familia.SelectedValue == "19")
            {
                add = new MatrizExcelBC().getMatrizRetiroCarpeta(desde, hasta, Session["usrname"].ToString());

                string strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + add.ToString().Trim() + "');";
                //ScriptManager.RegisterStartupScript(up, pPagina.GetType(), "", strAlerta, true);
                ScriptManager.RegisterStartupScript(this.up_arriba, this.up_arriba.GetType(), "", strAlerta, true);
            }



            return;
        }
Esempio n. 5
0
        protected void ibExcel_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                var usuario = dlUsuario.SelectedValue;
                var dt      = GetOperacion(usuario);

                if (dt == null)
                {
                    FuncionGlobal.alerta_updatepanel("Ups! Debes hacer una busqueda anteriormente para exportar.", Page, udp);
                    return;
                }
                //creo el informe y obtengo su nombre
                var informe = new MatrizExcelBC().GetReporteCertificados(Session["usrname"].ToString(), dt);

                //llamo al informe para ser abierto o guardado.
                var strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + informe.Trim() + "');";
                ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", strAlerta, true);
            }
            catch (Exception ex)
            {
                Mensajes("Rayos! Se generó el siguiente error: " + ex.Message, Enums.TiposMensajes.Error);
            }
        }
Esempio n. 6
0
        protected void carga_excel(string sp_informe, string titulo)
        {
            string desde = string.Format("{0:yyyyMMdd}", DateTime.Now);
            string hasta = string.Format("{0:yyyyMMdd}", DateTime.Now);

            if (this.txt_desde.Text.Trim() != "")
            {
                desde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_desde.Text.Trim()));
            }
            if (this.txt_hasta.Text.Trim() != "")
            {
                hasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim()));
            }
            int    sucursal     = 0;
            int    ciudad       = 0;
            int    id_solicitud = 0;
            int    id_familia   = 0;
            string id_codigo    = "0";

            int id_cliente = 0;

            if (this.dl_sucursal.SelectedValue.ToString() != "")
            {
                sucursal = Convert.ToInt16(this.dl_sucursal.SelectedValue);
            }
            if (this.dl_ciudad.SelectedValue.ToString() != "")
            {
                ciudad = Convert.ToInt16(this.dl_ciudad.SelectedValue);
            }
            if (this.dl_cliente.SelectedValue.ToString() != "")
            {
                id_cliente = Convert.ToInt32(this.dl_cliente.SelectedValue.ToString());
            }

            if (this.txt_operacion.Text.Trim() != "")
            {
                id_solicitud = Convert.ToInt32(this.txt_operacion.Text);
            }

            if (this.dl_familia.SelectedValue.ToString() != "")
            {
                id_familia = Convert.ToInt16(this.dl_familia.SelectedValue.ToString());
            }

            if (this.dl_producto.SelectedValue.ToString() != "")
            {
                id_codigo = this.dl_producto.SelectedValue.ToString();
            }

            string add = "";

            add = new MatrizExcelBC().getmatrizinforme(desde, hasta, Session["usrname"].ToString(), sp_informe, this.dl_producto.SelectedValue, 0, sucursal, id_cliente,
                                                       id_solicitud, 0, 0, this.txt_cliente.Text.Trim(), this.txt_patente.Text.Trim(), 0, 0, 0, ciudad, id_familia, titulo);

            string strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + add.ToString().Trim() + "');";

            //ScriptManager.RegisterStartupScript(Page,Page.GetType(), "", strAlerta, true);
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "", strAlerta, true);


            return;
        }