Exemple #1
0
    public void linkAddToQueue_Click(object sender, EventArgs e)
    {
        if (!SessionManager.IsLoggedIn)
        {
            RedirectToLogin();
        }

        TransitPlaceQueue tpq = SessionManager.PlaceService.GetOrCreatePlaceQueueByName(
            SessionManager.Ticket, SessionManager.AccountId, "My Queue");
        TransitPlaceQueueItem tpqi = new TransitPlaceQueueItem();

        tpqi.PlaceQueueId = tpq.Id;
        tpqi.PlaceId      = RequestId;
        SessionManager.CreateOrUpdate <TransitPlaceQueueItem>(
            tpqi, SessionManager.PlaceService.CreateOrUpdatePlaceQueueItem);
        ReportInfo(string.Format("Added {0} to <a href='AccountPlaceQueueManage.aspx'>your queue</a>.", Renderer.Render(Place.Name)));
    }
Exemple #2
0
    public void Page_Load(object sender, EventArgs e)
    {
        queue.OnGetDataSource += new EventHandler(queue_OnGetDataSource);

        if (!IsPostBack)
        {
            if (RequestId == 0)
            {
                TransitPlaceQueue q = SessionManager.PlaceService.GetOrCreatePlaceQueueByName(
                    SessionManager.Ticket, SessionManager.AccountId, "My Queue");

                Response.Redirect(string.Format("AccountPlaceQueueManage.aspx?id={0}", q.Id));
                return;
            }

            GetData(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "AccountPlacesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Queue", Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Exemple #3
0
        public TransitPlaceQueue GetOrCreatePlaceQueueByName(string ticket, int user_id, string name)
        {
            TransitPlaceQueue t_queue = GetPlaceQueueByName(ticket, user_id, name);

            if (t_queue == null)
            {
                t_queue = new TransitPlaceQueue();
                t_queue.AccountId = user_id;
                t_queue.Name = name;
                t_queue.PublishAll = false;
                t_queue.PublishFriends = true;
                t_queue.Id = CreateOrUpdatePlaceQueue(ticket, t_queue);
            }

            return t_queue;
        }
Exemple #4
0
 public int CreateOrUpdatePlaceQueue(string ticket, TransitPlaceQueue queue)
 {
     return WebServiceImpl<TransitPlaceQueue, ManagedPlaceQueue, PlaceQueue>.CreateOrUpdate(
         ticket, queue);
 }