private void RenderSoul() { this.SoulLink.NavigateUrl = PageUrlAttribute.Get <Soul>(); Models.SuccessLog soul = Models.SuccessLog.FindLatest(this.Session.GetCurrentUser()); if (soul != null) { this.SoulLabel.Text = soul.Text; } }
protected void SaveButton_Click(Object sender, EventArgs e) { try { Models.SuccessLog newEntry = new Models.SuccessLog(this.Session.GetCurrentUser()); newEntry.Date = DateTime.Parse(this.DateTextBox.Text); newEntry.Type = (Models.SuccessLogTypes) this.EntryTypeRadioButton.SelectedValue.ToInt32(); newEntry.Text = this.NoteTextBox.Text; Models.MyDataContext.Default.SuccessLogs.AddObject(newEntry); Models.MyDataContext.Default.SaveChanges(); this.ResponseAddOn.Redirect <Default>(); } catch (Exception ex) { this.Master.ShowError(ex); } }