Exemplo n.º 1
0
    public void feature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature groups.");
        }

        TransitFeature t_feature = new TransitFeature();

        t_feature.DataObjectName = "AccountGroup";
        t_feature.DataRowId      = RequestId;
        SessionManager.CreateOrUpdate <TransitFeature>(
            t_feature, SessionManager.ObjectService.CreateOrUpdateFeature);
        Redirect(Request.Url.PathAndQuery);
    }
Exemplo n.º 2
0
    public void deletefeature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature blogs.");
        }

        TransitFeature t_feature = new TransitFeature();

        t_feature.DataObjectName = "AccountBlog";
        t_feature.DataRowId      = RequestId;
        SessionManager.ObjectService.DeleteAllFeatures(SessionManager.Ticket, t_feature);
        SessionManager.InvalidateCache <TransitFeature>();
        Redirect(Request.Url.PathAndQuery);
    }
Exemplo n.º 3
0
    public void deletefeature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature feed items.");
        }

        TransitFeature t_feature = new TransitFeature();

        t_feature.DataObjectName = "AccountFeedItem";
        t_feature.DataRowId      = RequestId;
        SessionManager.ObjectService.DeleteAllFeatures(SessionManager.Ticket, t_feature);
        SessionManager.InvalidateCache <TransitFeature>();
        GetDataFeature(sender, e);
        panelAdmin.Update();
    }
Exemplo n.º 4
0
    public void feature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature feeds.");
        }

        TransitFeature t_feature = new TransitFeature();

        t_feature.DataObjectName = "AccountFeed";
        t_feature.DataRowId      = RequestId;
        SessionManager.CreateOrUpdate <TransitFeature>(
            t_feature, SessionManager.ObjectService.CreateOrUpdateFeature);
        GetDataFeature(sender, e);
        panelAdminUpdate.Update();
    }
Exemplo n.º 5
0
    public void deletefeature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature events.");
        }

        TransitFeature t_feature = new TransitFeature();
        t_feature.DataObjectName = "AccountEvent";
        t_feature.DataRowId = RequestId;
        SessionManager.ObjectService.DeleteAllFeatures(SessionManager.Ticket, t_feature);
        SessionManager.InvalidateCache<TransitFeature>();
        Redirect(Request.Url.PathAndQuery);
    }
Exemplo n.º 6
0
    public void feature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature AccountEvents.");
        }

        TransitFeature t_feature = new TransitFeature();
        t_feature.DataObjectName = "AccountEvent";
        t_feature.DataRowId = RequestId;
        SessionManager.CreateOrUpdate<TransitFeature>(
            t_feature, SessionManager.ObjectService.CreateOrUpdateFeature);
        Redirect(Request.Url.PathAndQuery);
    }
Exemplo n.º 7
0
 public int CreateOrUpdateFeature(string ticket, TransitFeature feature)
 {
     return(WebServiceImpl <TransitFeature, ManagedFeature, Feature> .CreateOrUpdate(
                ticket, feature));
 }
Exemplo n.º 8
0
    public void deletefeature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature feed items.");
        }

        TransitFeature t_feature = new TransitFeature();
        t_feature.DataObjectName = "AccountFeedItem";
        t_feature.DataRowId = RequestId;
        SessionManager.ObjectService.DeleteAllFeatures(SessionManager.Ticket, t_feature);
        SessionManager.InvalidateCache<TransitFeature>();
        GetDataFeature(sender, e);
        panelAdmin.Update();
    }
Exemplo n.º 9
0
 public int CreateOrUpdateFeature(string ticket, TransitFeature feature)
 {
     return WebServiceImpl<TransitFeature, ManagedFeature, Feature>.CreateOrUpdate(
         ticket, feature);
 }
Exemplo n.º 10
0
        public void DeleteAllFeatures(string ticket, TransitFeature token)
        {
            using (SnCore.Data.Hibernate.Session.OpenConnection())
            {
                ISession session = SnCore.Data.Hibernate.Session.Current;
                ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket);

                if (!sec.IsAdministrator())
                {
                    throw new ManagedAccount.AccessDeniedException();
                }

                ManagedFeature.Delete(session, token.DataObjectName, token.DataRowId);
                SnCore.Data.Hibernate.Session.Flush();
            }
        }
Exemplo n.º 11
0
    public void feature_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            // avoid round-trip
            throw new Exception("You must be an administrator to feature feeds.");
        }

        TransitFeature t_feature = new TransitFeature();
        t_feature.DataObjectName = "AccountFeed";
        t_feature.DataRowId = RequestId;
        SessionManager.CreateOrUpdate<TransitFeature>(
            t_feature, SessionManager.ObjectService.CreateOrUpdateFeature);
        GetDataFeature(sender, e);
        panelAdminUpdate.Update();
    }