예제 #1
0
 /// <summary>
 /// Handles the Command event of the DeleteVerseWritten control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="CommandEventArgs"/> instance containing the event data.</param>
 protected void DeleteVerseWritten_Command([NotNull] object sender, [NotNull] CommandEventArgs e)
 {
     var verse = new RapWrittenVerses(this.UserId);
     verse.DeleteVerse(Convert.ToInt32(e.CommandArgument.ToString()));
     this.AddLoadMessageSession(this.Text("VERSES", "DELETE_SUCCESS"));
     this.GetService<UrlProvider>().RefreshPage();
 }
 /// <summary>
 ///     Handles the Click event of the WrittenVerse control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="eventArgs">The <see cref="EventArgs" /> instance containing the event data.</param>
 protected void WrittenVerse_Click([NotNull] object sender, EventArgs eventArgs)
 {
     if (this.VerseTitle.Value.IsNotSet())
     {
         this.PageContext.AddLoadMessage(this.Text("VERSES", "NO_TITLE"));
         return;
     }
     if (this.VerseContent.Value.IsNotSet())
     {
         this.PageContext.AddLoadMessage(this.Text("VERSES", "NO_CONTENT"));
         return;
     }
     var v = new RapWrittenVerses(this.PageContext.PageUserID);
     v.AddVerse(this.VerseTitle.Value, this.VerseContent.Value);
     this.AddLoadMessageSession(this.Text("VERSES", "SUCCESS"));
     this.GetService<UrlProvider>().RefreshPage();
 }
예제 #3
0
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
 {
     if (this.UserId == this.PageContext.PageUserID)
     {
         this.GetService<ClientProviders>()
             .RegisterClientScriptBlock(this, "editableverses", "~/js/WrittenVerses.js", true);
     }
     this.WrittenVersesPager.PerPage = 6;
     this.WrittenVersesPager.GridView = this.WrittenVersesGV;
     var usersVerses = new RapWrittenVerses().GetVerses(this.UserId);
     this.WrittenVersesPager.ListDs = usersVerses.Cast<object>().ToList();
     this.WrittenVersesCount = usersVerses.Count;
     if (this.WrittenVersesCount <= 0)
     {
         var noVerses = this.GetCore<CalloutBox>()
             .Create(BootstrapElementType.Info, this.Text("VERSES", "NO_WRITTEN"));
         this.NoWrittenVerses.Controls.Add(noVerses);
     }
 }