Ejemplo n.º 1
0
        protected void buttonGuardar_Click(object sender, EventArgs e)
        {
            string path = Server.MapPath("~/parametros.xml");
            Reportes_parametros oReportes_parametros = new Reportes_parametros();

            oReportes_parametros.Id_reporte  = Convert.ToInt32(this.Session["Reporte"]);
            oReportes_parametros.Id_user     = this.Session["sUser"].ToString();
            oReportes_parametros.Id_compañia = Convert.ToInt32(this.Session["companyid"]);
            oReportes_parametros.Id_servicio = Convert.ToInt32(this.Session["Service"]);
            oReportes_parametros.Id_canal    = this.Session["Canal"].ToString().Trim();

            oReportes_parametros.Id_año      = cmb_año.SelectedValue;
            oReportes_parametros.Id_mes      = cmb_mes.SelectedValue;
            oReportes_parametros.Id_periodo  = Convert.ToInt32(cmb_periodo.SelectedValue);
            oReportes_parametros.Descripcion = txt_descripcion_parametros.Text.Trim();

            Reportes_parametrosToXml oReportes_parametrosToXml = new Reportes_parametrosToXml();

            if (!System.IO.File.Exists(path))
            {
                oReportes_parametrosToXml.createXml(oReportes_parametros, path);
            }
            else
            {
                oReportes_parametrosToXml.addToXml(oReportes_parametros, path);
            }

            cargarParametrosdeXml();
            txt_descripcion_parametros.Text     = "";
            TabContainer_filtros.ActiveTabIndex = 0;
        }
Ejemplo n.º 2
0
        protected void buttonGuardar_Click(object sender, EventArgs e)
        {
            string path = Server.MapPath("~/parametros.xml");
            Reportes_parametros oReportes_parametros = new Reportes_parametros();


            oReportes_parametros.Id_reporte  = Convert.ToInt32(this.Session["Reporte"]);
            oReportes_parametros.Id_user     = this.Session["sUser"].ToString();
            oReportes_parametros.Id_compañia = Convert.ToInt32(this.Session["companyid"]);
            oReportes_parametros.Id_servicio = Convert.ToInt32(this.Session["Service"]);
            oReportes_parametros.Id_canal    = this.Session["Canal"].ToString().Trim();

            oReportes_parametros.Id_oficina            = Convert.ToInt32(cmb_ciudad.SelectedValue);
            oReportes_parametros.Id_punto_venta        = cmb_punto_de_venta.SelectedValue;
            oReportes_parametros.Id_producto_categoria = cmb_categoria.SelectedValue;
            oReportes_parametros.Id_subCategoria       = cmb_subCategoria.SelectedValue;
            string sidmarca = cmb_marca.SelectedValue;

            if (sidmarca == "")
            {
                sidmarca = "0";
            }
            oReportes_parametros.Id_producto_marca = sidmarca;
            oReportes_parametros.Id_subMarca       = cmb_subMarca.SelectedValue;
            oReportes_parametros.SkuProducto       = cmb_skuProducto.SelectedValue;
            oReportes_parametros.Id_año            = cmb_año.SelectedValue;
            oReportes_parametros.Id_mes            = cmb_mes.SelectedValue;


            //string descripcion = cmb_año.SelectedItem  + "-" + cmb_periodo.SelectedItem + "-" +
            //   cmb_oficina.SelectedItem + "-" + cmb_punto_de_venta.SelectedItem + "-" + cmb_categoria.SelectedItem + "-" +
            // cmb_marca.SelectedItem + "-" + cmb_familia.SelectedItem;

            oReportes_parametros.Descripcion = txt_descripcion_parametros.Text.Trim();

            Reportes_parametrosToXml oReportes_parametrosToXml = new Reportes_parametrosToXml();

            if (!System.IO.File.Exists(path))
            {
                oReportes_parametrosToXml.createXml(oReportes_parametros, path);
            }
            else
            {
                oReportes_parametrosToXml.addToXml(oReportes_parametros, path);
            }


            cargarParametrosdeXml();
            txt_descripcion_parametros.Text     = "";
            TabContainer_filtros.ActiveTabIndex = 0;
        }
        protected void buttonGuardar_Click(object sender, EventArgs e)
        {
            RadComboBox        cmb_periodo   = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_periodo") as RadComboBox;
            RadComboBox        cmb_año       = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_año") as RadComboBox;
            RadComboBox        cmb_mes       = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_mes") as RadComboBox;
            RadComboBox        cmb_cadena    = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cadena") as RadComboBox;
            RadComboBox        cmb_ciudad    = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_ciudad") as RadComboBox;
            RadComboBox        cmb_cobertura = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cobertura") as RadComboBox;
            TextBox            txt_descripcion_parametros = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("txt_descripcion_parametros") as TextBox;
            ModalPopupExtender mpe_ver = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("mpe_ver") as ModalPopupExtender;

            string path = Server.MapPath("~/parametros.xml");
            Reportes_parametros oReportes_parametros = new Reportes_parametros();

            oReportes_parametros.Id_reporte     = Convert.ToInt32(this.Session["Reporte"]);
            oReportes_parametros.Id_user        = this.Session["sUser"].ToString();
            oReportes_parametros.Id_compañia    = Convert.ToInt32(this.Session["companyid"]);
            oReportes_parametros.Id_servicio    = Convert.ToInt32(this.Session["Service"]);
            oReportes_parametros.Id_canal       = this.Session["Canal"].ToString().Trim();
            oReportes_parametros.Id_TipoCiudad  = Convert.ToInt32(cmb_cobertura.SelectedValue);
            oReportes_parametros.Id_oficina     = Convert.ToInt32(cmb_ciudad.SelectedValue);
            oReportes_parametros.Icadena        = (cmb_cadena.SelectedValue == "") ? 0 : Convert.ToInt32(cmb_cadena.SelectedValue);
            oReportes_parametros.Id_año         = cmb_año.SelectedValue;
            oReportes_parametros.Id_mes         = cmb_mes.SelectedValue;
            oReportes_parametros.Id_periodo     = Convert.ToInt32(cmb_periodo.SelectedValue);
            oReportes_parametros.Descripcion    = txt_descripcion_parametros.Text.Trim();
            oReportes_parametros.Id_tipoReporte = this.Request.Path;

            Reportes_parametrosToXml oReportes_parametrosToXml = new Reportes_parametrosToXml();

            if (!System.IO.File.Exists(path))
            {
                oReportes_parametrosToXml.createXml(oReportes_parametros, path);
            }
            else
            {
                oReportes_parametrosToXml.addToXml(oReportes_parametros, path);
            }


            cargarParametrosdeXml();
            mpe_ver.Show();
        }