Пример #1
0
    public void Page_Load()
    {
        if (!IsPostBack)
        {
            int id = RequestId;

            if (id > 0)
            {
                TransitAccountPicture tw = SessionManager.AccountService.GetAccountPictureById(SessionManager.Ticket, id);
                this.Title = inputName.Text = Renderer.Render(tw.Name);
                inputDescription.Text = tw.Description;
                inputPictureThumbnail.Src = string.Format("AccountPictureThumbnail.aspx?id={0}&CacheDuration=0", tw.Id);
                inputHidden.Checked = tw.Hidden;

                discussionComments.DiscussionId = SessionManager.GetCount<TransitDiscussion, string, int>(
                    typeof(AccountPicture).Name, id, SessionManager.DiscussionService.GetOrCreateDiscussionId);
                discussionComments.DataBind();

                SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
                sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
                sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request, "AccountPicturesManage.aspx"));
                sitemapdata.Add(new SiteMapDataAttributeNode(tw.Name, Request.Url));
                StackSiteMap(sitemapdata);
            }
        }

        SetDefaultButton(manageAdd);
    }
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Flag Types", Request, "SystemAccountFlagTypesManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("AccountFlagType");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;

            if (RequestId > 0)
            {
                TransitAccountFlagType t = SessionManager.AccountService.GetAccountFlagTypeById(
                    SessionManager.Ticket, RequestId);
                inputName.Text = t.Name;
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Type", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
    public void Page_Load(object sender, EventArgs e)
    {
        if (!SessionManager.IsAdministrator)
        {
            throw new ManagedAccount.AccessDeniedException();
        }

        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Settings", Request, "SystemConfigurationsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Outgoing E-Mail", Request.Url));
            StackSiteMap(sitemapdata);

            DomainClass cs = SessionManager.GetDomainClass("Configuration");
            int len = cs["OptionName"].MaxLengthInChars;
            inputServer.MaxLength = len;
            inputUsername.MaxLength = len;
            inputPassword.MaxLength = len;
            inputPort.MaxLength = len;
            inputPickupDirectoryLocation.MaxLength = len;
            inputDelivery.DataSource = smtpdeliverymethods;
            inputDelivery.DataBind();

            ListItemManager.TrySelect(inputDelivery, SessionManager.GetCachedConfiguration("SnCore.Mail.Delivery", SmtpDeliveryMethod.Network.ToString()));

            inputServer.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.Server", "localhost");
            inputUsername.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.Username", string.Empty);
            inputPort.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.Port", "25");
            inputPickupDirectoryLocation.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.PickupDirectoryLocation", string.Empty);
        }

        SetDefaultButton(save);
    }
Пример #4
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Statuses", Request, "BugStatusesManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("BugStatu");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;

            if (RequestId > 0)
            {
                TransitBugStatus t = SessionManager.BugService.GetBugStatusById(
                    SessionManager.Ticket, RequestId);
                inputName.Text = t.Name;
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Status", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
    public void Page_Load(object sender, EventArgs e)
    {
        this.addFile.Attributes["onclick"] = this.files.GetAddFileScriptReference() + "return false;";
        if (!IsPostBack)
        {
            TransitAccountStory ts = SessionManager.StoryService.GetAccountStoryById(
                SessionManager.Ticket, RequestId);

            linkBack.NavigateUrl = string.Format("AccountStoryEdit.aspx?id={0}", ts.Id);

            GetData(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Stories", Request, "AccountStoriesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(ts.Name, Request, string.Format("AccountStoryEdit.aspx?id={0}", ts.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            StackSiteMap(sitemapdata);
        }

        if (!SessionManager.HasVerified())
        {
            ReportWarning("You don't have any verified e-mail addresses and/or profile photos.\n" +
                "You must add/confirm a valid e-mail address and upload a profile photo before uploading story pictures.");

            picturesAdd.Enabled = false;
        }

        SetDefaultButton(picturesAdd);
    }
Пример #6
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Attributes", Request, "SystemAttributesManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("Attribute");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;
            inputDefaultUrl.MaxLength = cs["DefaultUrl"].MaxLengthInChars;

            if (RequestId > 0)
            {
                TransitAttribute t = SessionManager.ObjectService.GetAttributeById(
                    SessionManager.Ticket, RequestId);
                inputName.Text = t.Name;
                inputDescription.Text = t.Description;
                inputDefaultUrl.Text = t.DefaultUrl;
                inputDefaultValue.Text = t.DefaultValue;
                imageBitmap.ImageUrl = string.Format("SystemAttribute.aspx?id={0}&CacheDuration=0", t.Id);
                imageBitmap.Visible = t.HasBitmap;
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                imageBitmap.Visible = false;
                sitemapdata.Add(new SiteMapDataAttributeNode("New Attribute", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #7
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            TransitAccountGroup p = SessionManager.GroupService.GetAccountGroupById(
                SessionManager.Ticket, AccountGroupId);
            linkBack.NavigateUrl = string.Format("AccountGroupPicturesManage.aspx?id={0}", p.Id);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Groups", Request, "AccountGroupsView.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(p.Name, Request, string.Format("AccountGroupView.aspx?id={0}", p.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request, string.Format("AccountGroupPicturesManage.aspx?id={0}", p.Id)));

            if (RequestId > 0)
            {
                TransitAccountGroupPicture t = SessionManager.GroupService.GetAccountGroupPictureById(SessionManager.Ticket, RequestId);
                inputName.Text = t.Name;
                inputDescription.Text = t.Description;
                imageFull.ImageUrl = string.Format("AccountGroupPicture.aspx?id={0}&CacheDuration=0", t.Id);
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Picture", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
        sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
        sitemapdata.Add(new SiteMapDataAttributeNode("Security", "AccountPreferencesManage.aspx#security"));
        sitemapdata.Add(new SiteMapDataAttributeNode("Change Password", Request.Url));
        StackSiteMap(sitemapdata);

        if (!string.IsNullOrEmpty(PasswordHash))
        {
            int account_id = (RequestId > 0) ? RequestId : SessionManager.Account.Id;

            if (!SessionManager.AccountService.IsPasswordValidMd5(
                SessionManager.Ticket,
                account_id,
                PasswordHash))
            {
                Redirect(string.Format("AccountChangePassword.aspx?ReturnUrl={0}", 
                    Renderer.UrlEncode(ReturnUrl)));
                return;
            }

            panelOldPassword.Visible = false;
        }

        if (SessionManager.Account.IsPasswordExpired)
        {
            ReportInfo("Your password has expired. Please change your password.");
        }

        SetDefaultButton(manageAccountChangePassword);
    }
Пример #9
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Syndication", Request, "AccountFeedsManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("MadLib");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;

            if (RequestId > 0)
            {
                TransitMadLib t = SessionManager.MadLibService.GetMadLibById(
                    SessionManager.Ticket, RequestId);
                inputTemplate.Text = t.Template;
                inputName.Text = t.Name;
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New MadLib", Request.Url));
            }
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(save);
    }
Пример #10
0
    public void Page_Load()
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();

            if (RequestId > 0)
            {
                TransitDiscussion td = SessionManager.GetInstance<TransitDiscussion, int>(
                    RequestId, SessionManager.DiscussionService.GetDiscussionById);

                if (td.Personal)
                {
                    sitemapdata.Add(new SiteMapDataAttributeNode(td.ParentObjectName,
                        string.Format("{0}&ReturnUrl={1}", td.ParentObjectUri, Renderer.UrlEncode(Request.Url.PathAndQuery))));
                }
                else
                {
                    sitemapdata.Add(new SiteMapDataAttributeNode("Discussions", Request, "DiscussionsView.aspx"));
                }

                sitemapdata.Add(new SiteMapDataAttributeNode(td.Name, Request,
                    string.Format("DiscussionView.aspx?id={0}", td.Id)));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("Discussions", Request, "DiscussionsView.aspx"));
            }

            sitemapdata.Add(new SiteMapDataAttributeNode("Search", Request.Url));
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(search);
    }
Пример #11
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Surveys", Request, "SystemSurveysManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(Survey.Name, Request, string.Format("SystemSurveyEdit.aspx?id={0}", SurveyId)));

            DomainClass cs = SessionManager.GetDomainClass("SurveyQuestion");
            inputQuestion.MaxLength = cs["Question"].MaxLengthInChars;

            linkBack.NavigateUrl = "SystemSurveyEdit.aspx?id=" + SurveyId.ToString();
            if (RequestId > 0)
            {
                TransitSurveyQuestion tw = SessionManager.ObjectService.GetSurveyQuestionById(
                    SessionManager.Ticket, RequestId);
                inputQuestion.Text = Renderer.Render(tw.Question);
                sitemapdata.Add(new SiteMapDataAttributeNode(tw.Question, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Question", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #12
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));

            if (RequestId > 0)
            {
                TransitAccountPropertyGroup tag = SessionManager.AccountService.GetAccountPropertyGroupById(
                    SessionManager.Ticket, RequestId);
                labelName.Text = Render(tag.Name);
                labelDescription.Text = Render(tag.Description);
                sitemapdata.Add(new SiteMapDataAttributeNode(tag.Name, Request.Url));
            }
            else
            {
                labelName.Text = "All Property Groups";
                sitemapdata.Add(new SiteMapDataAttributeNode("Properties", Request.Url));
            }

            StackSiteMap(sitemapdata);

            gridManage.DataSource = SessionManager.AccountService.GetAllAccountPropertyValues(
                SessionManager.Ticket, SessionManager.AccountId, RequestId);
            gridManage.DataBind();
        }

        SetDefaultButton(save);
    }
    public void Page_Load(object sender, EventArgs e)
    {
        gridFriends.OnGetDataSource += new EventHandler(gridFriends_OnGetDataSource);
       
        if (!IsPostBack)
        {
            if (RequestId == 0)
            {
                RedirectToLogin();
                return;
            }

            TransitAccount ta = SessionManager.GetInstance<TransitAccount, int>(
                RequestAccountId, SessionManager.AccountService.GetAccountById);

            labelName.Text = string.Format("{0}'s Friends Activity", Render(ta.Name));

            GetData();

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Friends Activity", Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Пример #14
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Redirects", Request, "AccountRedirectsManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("AccountRedirect");
            inputSourceUri.MaxLength = cs["SourceUri"].MaxLengthInChars;
            inputTargetUri.MaxLength = cs["TargetUri"].MaxLengthInChars;

            int id = RequestId;

            if (id > 0)
            {
                TransitAccountRedirect tr = SessionManager.AccountService.GetAccountRedirectById(SessionManager.Ticket, id);
                inputSourceUri.Text = tr.SourceUri;
                inputTargetUri.Text = tr.TargetUri;
                sitemapdata.Add(new SiteMapDataAttributeNode(tr.SourceUri, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Redirect", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
    public void Page_Load(object sender, EventArgs e)
    {
        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);

        LocationSelector.CountryChanged += new EventHandler(LocationSelector_CountryChanged);
        LocationSelector.StateChanged += new EventHandler(LocationSelector_StateChanged);
        LocationSelector.CityChanged += new EventHandler(LocationSelector_CityChanged);

        if (!IsPostBack)
        {
            TransitCampaign tc = SessionManager.MarketingService.GetCampaignById(SessionManager.Ticket, RequestId);
            campaignName.Text = string.Format("{0}: {1}", Render(tc.Name), campaignName.Text);
            GetData(sender, e);

            inputAccountPropertyGroup.DataSource = SessionManager.AccountService.GetAccountPropertyGroups(
                SessionManager.Ticket, null);
            inputAccountPropertyGroup.DataBind();
            inputAccountPropertyGroup_SelectedIndexChanged(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Marketing Campaigns", Request, "MarketingCampaignsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(tc.Name, Request, string.Format("MarketingCampaignEdit.aspx?id={0}", tc.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Recepients", Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Пример #16
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request, "SystemPicturesManage.aspx"));

            inputType.DataSource = SessionManager.ObjectService.GetPictureTypes(
                SessionManager.Ticket, null);

            inputType.DataBind();

            if (RequestId > 0)
            {
                TransitPicture t = SessionManager.ObjectService.GetPictureById(
                    SessionManager.Ticket, RequestId);
                inputName.Text = t.Name;
                inputDescription.Text = t.Description;
                ListItemManager.TrySelect(inputType, t.Type);
                imageThumbnail.ImageUrl = string.Format("SystemPictureThumbnail.aspx?id={0}&CacheDuration=0", t.Id);
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Picture", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #17
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int id = RequestId;

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Messages", Request, "AccountMessageFoldersManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("AccountMessageFolder");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;

            if (id > 0)
            {
                TransitAccountMessageFolder tw = SessionManager.AccountService.GetAccountMessageFolderById(SessionManager.Ticket, id);
                inputName.Text = Renderer.Render(tw.Name);
                sitemapdata.Add(new SiteMapDataAttributeNode(tw.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Folder", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #18
0
    public void Page_Load(object sender, EventArgs e)
    {
        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);
        if (!IsPostBack)
        {
            string openidmode = Request["openid.mode"];
            if (!string.IsNullOrEmpty(openidmode))
            {
                NameValueCollectionSerializer serializer = new NameValueCollectionSerializer(Request.Params);
                SessionManager.AccountService.CreateAccountOpenId(
                    SessionManager.Ticket, SessionManager.OpenIdToken, serializer.Names, serializer.Values);
                Redirect(Request.Path);
                return;
            }

            gridManage_OnGetDataSource(sender, e);
            gridManage.DataBind();

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Open-ID", Request.Url));
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #19
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DomainClass cs = SessionManager.GetDomainClass("Bug");
            inputSubject.MaxLength = cs["Subject"].MaxLengthInChars;

            selectPriority.DataSource = SessionManager.BugService.GetBugPriorities(
                SessionManager.Ticket, null);
            selectPriority.DataBind();
            selectSeverity.DataSource = SessionManager.BugService.GetBugSeverities(
                SessionManager.Ticket, null);
            selectSeverity.DataBind();
            selectType.DataSource = SessionManager.BugService.GetBugTypes(
                SessionManager.Ticket, null);
            selectType.DataBind();

            TransitBugProject project = SessionManager.BugService.GetBugProjectById(
                SessionManager.Ticket, ProjectId);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(project.Name, Request, string.Format("BugProjectBugsManage.aspx?id={0}", project.Id)));

            if (RequestId > 0)
            {
                TransitBug bug = SessionManager.BugService.GetBugById(
                    SessionManager.Ticket, RequestId);
                inputSubject.Text = bug.Subject;
                inputDetails.Text = bug.Details;

                ListItemManager.TrySelect(selectPriority, bug.Priority);
                ListItemManager.TrySelect(selectSeverity, bug.Severity);
                ListItemManager.TrySelect(selectType, bug.Type);

                linkBack.NavigateUrl = string.Format("BugView.aspx?id={0}", bug.Id);

                sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("#{0}: {1}", bug.Id, bug.Subject), Request.Url));
            }
            else
            {
                string type = Request.QueryString["type"];
                ListItemManager.TrySelect(selectType, type);

                linkBack.NavigateUrl = string.Format("BugProjectBugsManage.aspx?id={0}", ProjectId);

                if (Request.QueryString["url"] != null)
                    inputSubject.Text = Request.QueryString["url"];

                if (Request.QueryString["message"] != null)
                    inputDetails.Text = Request.QueryString["message"];

                sitemapdata.Add(new SiteMapDataAttributeNode("New Bug", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
    public void Page_Load(object sender, EventArgs e)
    {
        gridProperties.OnGetDataSource += new EventHandler(gridProperties_OnGetDataSource);
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Place Property Groups", Request, "SystemPlacePropertyGroupsManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("PlacePropertyGroup");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;

            if (RequestId > 0)
            {
                TransitPlacePropertyGroup t = SessionManager.PlaceService.GetPlacePropertyGroupById(
                    SessionManager.Ticket, RequestId);
                inputName.Text = t.Name;
                inputDescription.Text = t.Description;
                gridProperties_OnGetDataSource(this, null);
                gridProperties.DataBind();
                linkNewProperty.NavigateUrl = string.Format("SystemPlacePropertyEdit.aspx?pid={0}", RequestId);
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                panelProperties.Visible = false;
                sitemapdata.Add(new SiteMapDataAttributeNode("New Property Group", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #21
0
    public void Page_Load(object sender, EventArgs e)
    {
        this.addFile.Attributes["onclick"] = this.files.GetAddFileScriptReference() + "return false;";
        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);

        if (!IsPostBack)
        {
            TransitPlace place = SessionManager.PlaceService.GetPlaceById(SessionManager.Ticket, RequestId);

            GetData(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(place.Name, Request, string.Format("PlaceView.aspx?id={0}", place.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            StackSiteMap(sitemapdata);
        }

        if (!SessionManager.HasVerified())
        {
            ReportWarning("You don't have any verified e-mail addresses and/or profile photos.\n" +
                "You must add/confirm a valid e-mail address and upload a profile photo before uploading place pictures.");

            addFile.Enabled = false;
            save.Enabled = false;
        }
    }
Пример #22
0
    public void Page_Load(object sender, EventArgs e)
    {
        accountSurveyAnswers.OnGetDataSource += new EventHandler(accountSurveyAnswers_OnGetDataSource);
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            TransitSurvey s = Survey;

            if (AccountId > 0)
            {
                TransitAccount a = Account;
                accountName.Text = Renderer.Render(a.Name);
                accountImage.Src = string.Format("AccountPictureThumbnail.aspx?id={0}", a.PictureId);
                accountLink.HRef = string.Format("AccountView.aspx?id={0}", a.Id);
                this.Title = string.Format("{0}'s {1}", Renderer.Render(a.Name), Renderer.Render(s.Name));

                sitemapdata.Add(new SiteMapDataAttributeNode("People", Request, "AccountsView.aspx"));
                sitemapdata.Add(new SiteMapDataAttributeNode(a.Name, Request, string.Format("AccountView.aspx?id={0}", a.Id)));
            }
            else
            {
                accountcolumn.Visible = false;
                this.Title = string.Format("{0}", Renderer.Render(s.Name));
            }

            sitemapdata.Add(new SiteMapDataAttributeNode(s.Name, Request.Url));
            StackSiteMap(sitemapdata);

            surveyName.Text = Renderer.Render(s.Name);
            accountSurveyAnswers_OnGetDataSource(sender, e);
            accountSurveyAnswers.DataBind();
        }
    }
Пример #23
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (RequestId == 0)
        {
            throw new Exception("Missing place.");
        }

        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);

        if (!IsPostBack)
        {
            TransitPlace p = SessionManager.GetInstance<TransitPlace, PlaceService.ServiceQueryOptions, int>(
                RequestId, SessionManager.PlaceService.GetPlaceById);

            this.Title = string.Format("{0}'s Pictures", Renderer.Render(p.Name));

            GetData(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(p.Name, Request, string.Format("PlaceView.aspx?id={0}", p.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Пример #24
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Settings", Request, "SystemConfigurationsManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("Configuration");
            inputName.MaxLength = cs["OptionName"].MaxLengthInChars;

            int id = RequestId;

            if (id > 0)
            {
                TransitConfiguration tw = SessionManager.SystemService.GetConfigurationById(
                    SessionManager.Ticket, id);
                inputName.Text = Renderer.Render(tw.Name);
                inputValue.Text = Renderer.Render(tw.Value);
                inputPassword.Checked = tw.Password;
                sitemapdata.Add(new SiteMapDataAttributeNode(tw.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Setting", Request.Url));
                inputName.Text = Request["name"];
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #25
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (RequestId == 0)
        {
            throw new Exception("Missing account.");
        }

        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);

        if (!IsPostBack)
        {
            TransitAccount a = SessionManager.GetInstance<TransitAccount, int>(
                RequestId, SessionManager.AccountService.GetAccountById);

            this.Title = string.Format("{0}'s Pictures", Renderer.Render(a.Name));

            GetData(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("People", Request, "AccountsView.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(a.Name, Request, string.Format("AccountView.aspx?id={0}", a.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Пример #26
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Events", Request, "AccountEventsToday.aspx"));

            if (RequestId > 0)
            {
                TransitAccountEvent evt = SessionManager.EventService.GetAccountEventById(
                    SessionManager.Ticket, RequestId, SessionManager.UtcOffset.Ticks);

                this.Title = string.Format("{0} Pictures", Renderer.Render(evt.Name));
                listView.DataSource = SessionManager.EventService.GetAccountEventPictures(
                    SessionManager.Ticket, RequestId, null);
                listView.DataBind();

                sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "AccountEventsToday.aspx", evt.PlaceCountry, evt.PlaceState, evt.PlaceCity, evt.PlaceNeighborhood, evt.AccountEventType));
                sitemapdata.Add(new SiteMapDataAttributeNode(evt.Name, Request, string.Format("AccountEventView.aspx?id={0}", evt.Id)));
                sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }
    }
Пример #27
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            linkCancel.NavigateUrl = ReturnUrl;

            TransitAccountFlag flag = Flag;

            flagAccountImageLink.HRef = linkAccount.NavigateUrl = string.Format("AccountView.aspx?id={0}", flag.AccountId);
            linkAccount.Text = Renderer.Render(flag.AccountName);
            flagAccountImage.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}&width=75&height=75", flag.AccountPictureId);
            linkFlaggedAccount.NavigateUrl = string.Format("AccountView.aspx?id={0}", flag.FlaggedAccountId);
            linkFlaggedAccount.Text = Renderer.Render(flag.FlaggedAccountName);
            flagCreated.Text = SessionManager.ToAdjustedString(flag.Created);
            flagDescription.Text = Renderer.Render(flag.Description);
            flagType.Text = Renderer.Render(flag.AccountFlagType);

            linkReply.NavigateUrl = string.Format("AccountMessageEdit.aspx?id={0}&ReturnUrl={1}",
                flag.AccountId, UrlEncode(Request.Url.PathAndQuery));

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Reported Abuse", Request, "AccountFlagsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(flag.FlaggedAccountName, Request, string.Format("AccountView.aspx?id={0}", flag.FlaggedAccountId)));
            sitemapdata.Add(new SiteMapDataAttributeNode(flag.AccountFlagType, Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Пример #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        linkBack.NavigateUrl = string.Format("BugView.aspx?id={0}", RequestId);

        if (!IsPostBack)
        {
            selectResolution.DataSource = SessionManager.BugService.GetBugResolutions(
                SessionManager.Ticket, null);
            selectResolution.DataBind();

            TransitBug bug = SessionManager.BugService.GetBugById(
                SessionManager.Ticket, RequestId);
            TransitBugProject project = SessionManager.BugService.GetBugProjectById(
                SessionManager.Ticket, bug.ProjectId);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(project.Name, Request, string.Format("BugProjectBugsManage.aspx?id={0}", project.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("#{0}: {1}", bug.Id, bug.Subject), Request, string.Format("BugView.aspx?id={0}", bug.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Resolve", Request.Url));
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #29
0
    public void Page_Load(object sender, EventArgs e)
    {
        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);
        if (!IsPostBack)
        {
            string facebookConnect = Request["connect"];
            if (!string.IsNullOrEmpty(facebookConnect))
            {
                FacebookPageManager facebook = new FacebookPageManager(SessionManager);
                SortedList<string, string> facebookCookies = facebook.GetFacebookCookies(HttpContext.Current.Request.Cookies);
                List<String> keys = new List<String>(facebookCookies.Keys);
                List<String> values = new List<String>(facebookCookies.Values);
                SessionManager.AccountService.CreateAccountFacebook(SessionManager.Ticket,
                    HttpContext.Current.Request.Cookies[facebook.FacebookAPIKey].Value, keys.ToArray(), values.ToArray());
                Redirect(Request.Path);
            }

            gridManage_OnGetDataSource(sender, e);
            gridManage.DataBind();

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Facebook", Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Пример #30
0
    public void Page_Load(object sender, EventArgs e)
    {
        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);

        if (!IsPostBack)
        {
            GetData(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            if (IsObjectBound)
            {
                int discussion_id = SessionManager.GetCount<DiscussionService.TransitDiscussion, DiscussionService.ServiceQueryOptions, string, int>(
                    Type, ObjectId, SessionManager.DiscussionService.GetOrCreateDiscussionId);

                DiscussionService.TransitDiscussion td = SessionManager.GetInstance<DiscussionService.TransitDiscussion, DiscussionService.ServiceQueryOptions, int>(
                    discussion_id, SessionManager.DiscussionService.GetDiscussionById);

                sitemapdata.Add(new SiteMapDataAttributeNode(td.ParentObjectName, string.Format("{0}&ReturnUrl={1}", 
                    td.ParentObjectUri, Renderer.UrlEncode(Request.Url.PathAndQuery))));
                sitemapdata.Add(new SiteMapDataAttributeNode("Discussions", Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("Discussions"));
            }
            StackSiteMap(sitemapdata);
        }
    }