Example #1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            mesesAmostrar = (bool[])Session["MesesAmostrar"];
            meses         = (Hashtable)Session["Meses"];
            IVentas ventas = VentasFactory.GetVentas();

            ventas.FechaDesde = (DateTime)Session["FechaDesde"];
            ventas.FechaHasta = (DateTime)Session["FechaHasta"];

            if (Session["DsVentasDetalle"] == null)
            {
                int categoriaUVentaID = Utiles.Validaciones.obtieneEntero(Session["categoriaUVentaID"].ToString());
                dsVentasDetalle            = ventas.GetVentasClientesDetalle(categoriaUVentaID, false);
                Session["DsVentasDetalle"] = dsVentasDetalle;
            }
            else
            {
                dsVentasDetalle = (DsVentasDetalle)Session["DsVentasDetalle"];
            }


            //ventas = VentasFactory.GetVentas();
            //ventas.ClienteID = Convert.ToInt32(Convert.ToString(dr["EntidadID"]));
            dsVentasDetalleUVenta = (DsVentasDetalle)Session["DsVentasDetalleUVenta"];
            //System.Data.DataRow[] drImportes = ventas.GetImportesByClienteUVenta(Convert.ToInt32(Convert.ToString(dr["UnidadVentaID"])), i).Datos.Select("");
        }
Example #2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            #region IsAuthenticated

            if (Session["Usuario"] != null)
            {
                usuario = (IUsuarios)Session["Usuario"];
            }

            if (User.Identity.IsAuthenticated)
            {
                string sOpcion = "ReporteAlertaOperativaAgenciaUV";
                Menu   oMenu   = (Menu)this.FindControl("Menu1");
                this.ValidarSeguridad(oMenu, sOpcion);
            }

            agenciaID = usuario.AgenciaID; //Paso la agencia a una variable para después consultar de esa agencia especificamente

            IVentas ventas = VentasFactory.GetVentas();

            /*validar cuando entra un vendedor*/
            if (usuario.VendedorID != 0)
            {
                #region Vendedor
                IVendedor vendedor = VendedorFactory.GetVendedor();
                vendedor.VendedorID = usuario.VendedorID;
                vendedor.Consultar();
                #endregion
            }
            else if (usuario.AgenciaID != 0 && usuario.AgenciaID != ventas.EsAdministracion(UnidadNegocioID))
            {
                IAgencia agencia = AgenciaFactory.GetAgencia();
                agencia.AgenciaID = usuario.AgenciaID;
                agencia.ConsultarBasicoByAgenciaID();
                busqAgencia.AgenciaID   = agencia.AgenciaID.ToString();
                busqAgencia.Sucursal    = agencia.SucursalDGI;
                busqAgencia.RazonSocial = agencia.RazonSocial;
                ((TextBox)((Control)busqAgencia).FindControl("txtSucursal")).Enabled    = false;
                ((TextBox)((Control)busqAgencia).FindControl("txtRazonSocial")).Enabled = false;
            }

            #endregion

            if (!IsPostBack)
            {
                Session["dsResultado"] = null;
                this.BindGrid(0, false);
            }
        }