protected override void OnPreRender(EventArgs e) { if (dbContentRatingID != 0 & loadFlag) { editDbContentRating = new DbContentRating(dbContentRatingID); // // Set Field Entries // ltCreateDate.Text = editDbContentRating.CreateDate.ToString(); ltModifyDate.Text = editDbContentRating.ModifyDate.ToString(); tbName.Text = editDbContentRating.Name; tbDescription.Text = editDbContentRating.Description; tbIconUrl.Text = editDbContentRating.IconUrl; // // Set Children Selections // if (editDbContentRating.RequiredRole != null) { foreach (ListItem item in msRequiredRole.Items) { item.Selected = editDbContentRating.RequiredRole.ID.ToString() == item.Value; } } text = "Edit Rating - " + editDbContentRating.ToString(); } else { text = "Add Rating"; } }
protected void btOk_Click(object sender, EventArgs e) { DbContentRating dbContentRating = new DbContentRating(dbContentRatingID); dbContentRating.Delete(); dbContentRatingID = 0; OnDeleted(EventArgs.Empty); }
protected override void OnPreRender(EventArgs e) { if (dbContentRatingID != 0) { dbContentRating = new DbContentRating(dbContentRatingID); #region Bind _system Folder // // Set Field Entries // ltCreateDate.Text = dbContentRating.CreateDate.ToString(); ltModifyDate.Text = dbContentRating.ModifyDate.ToString(); // // Set Children Selections // #endregion #region Bind General Folder // // Set Field Entries // ltName.Text = dbContentRating.Name.ToString(); ltDescription.Text = dbContentRating.Description.ToString(); ltIconUrl.Text = dbContentRating.IconUrl.ToString(); // // Set Children Selections // // RequiredRole if (dbContentRating.RequiredRole != null) { ltRequiredRole.Text = dbContentRating.RequiredRole.ToString(); } else { ltRequiredRole.Text = string.Empty; } #endregion text = "View Rating - " + dbContentRating.ToString(); } }
protected override void OnPreRender(EventArgs e) { if (dbContentRatingID != 0) { dbContentRating = new DbContentRating(dbContentRatingID); text = "Delete - " + dbContentRating.ToString(); } else { text = "Delete Rating"; } EnsureWindowScripts(); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (dbContentRatingID != 0) { dbContentRating = new DbContentRating(dbContentRatingID); text = "Delete - " + dbContentRating.ToString(); } else { text = "Delete Rating"; } }
protected void ok_Click(object sender, EventArgs e) { if (dbContentRatingID == 0) { obj = new DbContentRating(); } else { obj = new DbContentRating(dbContentRatingID); } obj.Name = tbName.Text; obj.Description = tbDescription.Text; obj.IconUrl = tbIconUrl.Text; if (msRequiredRole.SelectedItem != null && msRequiredRole.SelectedItem.Value != "Null") { obj.RequiredRole = GreyFoxRole.NewPlaceHolder( int.Parse(msRequiredRole.SelectedItem.Value)); } else { obj.RequiredRole = null; } if (editOnAdd) { dbContentRatingID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { tbName.Text = string.Empty; tbDescription.Text = string.Empty; tbIconUrl.Text = string.Empty; msRequiredRole.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
protected override void OnPreRender(EventArgs e) { if (loadFlag) { if (dbContentRatingID > 0) { obj = new DbContentRating(dbContentRatingID); text = "Edit Rating - " + obj.ToString(); } else if (dbContentRatingID <= 0) { obj = new DbContentRating(); text = "Add Rating"; } // // Set Field Entries // ltCreateDate.Text = obj.CreateDate.ToString(); ltModifyDate.Text = obj.ModifyDate.ToString(); tbName.Text = obj.Name; tbDescription.Text = obj.Description; tbIconUrl.Text = obj.IconUrl; // // Set Children Selections // if (obj.RequiredRole != null) { foreach (ListItem item in msRequiredRole.Items) { item.Selected = obj.RequiredRole.ID.ToString() == item.Value; } } else { msRequiredRole.SelectedIndex = 0; } } }
protected void ok_Click(object sender, EventArgs e) { if (dbContentClipID == 0) { obj = new DbContentClip(); } else { obj = new DbContentClip(dbContentClipID); } obj.Title = tbTitle.Text; obj.Description = tbDescription.Text; obj.Keywords = tbKeywords.Text; obj.Icon = tbIcon.Text; obj.Body = ftbBody.Text; obj.PublishDate = dePublishDate.Date; obj.ExpirationDate = deExpirationDate.Date; obj.ArchiveDate = deArchiveDate.Date; obj.Priority = int.Parse(tbPriority.Text); obj.SortOrder = int.Parse(tbSortOrder.Text); obj.CommentsEnabled = cbCommentsEnabled.Checked; obj.NotifyOnComments = cbNotifyOnComments.Checked; obj.OverrideUrl = tbOverrideUrl.Text; obj.MenuLabel = tbMenuLabel.Text; obj.MenuTooltip = tbMenuTooltip.Text; obj.MenuEnabled = cbMenuEnabled.Checked; obj.MenuOrder = int.Parse(tbMenuOrder.Text); obj.MenuLeftIcon = tbMenuLeftIcon.Text; obj.MenuLeftIconOver = tbMenuLeftIconOver.Text; obj.MenuRightIcon = tbMenuRightIcon.Text; obj.MenuRightIconOver = tbMenuRightIconOver.Text; obj.MenuBreak = cbMenuBreak.Checked; if (msStatus.SelectedItem != null && msStatus.SelectedItem.Value != "Null") { obj.Status = DbContentStatus.NewPlaceHolder( int.Parse(msStatus.SelectedItem.Value)); } else { obj.Status = null; } if (msParentCatalog.SelectedItem != null && msParentCatalog.SelectedItem.Value != "Null") { obj.ParentCatalog = DbContentCatalog.NewPlaceHolder( int.Parse(msParentCatalog.SelectedItem.Value)); } else { obj.ParentCatalog = null; } if (msRating.SelectedItem != null && msRating.SelectedItem.Value != "Null") { obj.Rating = DbContentRating.NewPlaceHolder( int.Parse(msRating.SelectedItem.Value)); } else { obj.Rating = null; } if (msReferences.IsChanged) { obj.References = new DbContentClipCollection(); foreach (ListItem i in msReferences.Items) { if (i.Selected) { obj.References.Add(DbContentClip.NewPlaceHolder(int.Parse(i.Value))); } } } if (msAuthors.IsChanged) { obj.Authors = new GreyFoxUserCollection(); foreach (ListItem i in msAuthors.Items) { if (i.Selected) { obj.Authors.Add(GreyFoxUser.NewPlaceHolder(int.Parse(i.Value))); } } } if (msEditors.IsChanged) { obj.Editors = new GreyFoxUserCollection(); foreach (ListItem i in msEditors.Items) { if (i.Selected) { obj.Editors.Add(GreyFoxUser.NewPlaceHolder(int.Parse(i.Value))); } } } if (editOnAdd) { dbContentClipID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { tbTitle.Text = string.Empty; tbDescription.Text = string.Empty; tbKeywords.Text = string.Empty; tbIcon.Text = string.Empty; ftbBody.Text = string.Empty; dePublishDate.Date = DateTime.Now; deExpirationDate.Date = DateTime.Now; deArchiveDate.Date = DateTime.Now; tbPriority.Text = string.Empty; tbSortOrder.Text = string.Empty; cbCommentsEnabled.Checked = false; cbNotifyOnComments.Checked = false; tbOverrideUrl.Text = string.Empty; tbMenuLabel.Text = string.Empty; tbMenuTooltip.Text = string.Empty; cbMenuEnabled.Checked = false; tbMenuOrder.Text = string.Empty; tbMenuLeftIcon.Text = string.Empty; tbMenuLeftIconOver.Text = string.Empty; tbMenuRightIcon.Text = string.Empty; tbMenuRightIconOver.Text = string.Empty; cbMenuBreak.Checked = false; msStatus.SelectedIndex = 0; msParentCatalog.SelectedIndex = 0; msRating.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
protected void ok_Click(object sender, EventArgs e) { if (dbContentClipID == 0) { editDbContentClip = new DbContentClip(); } else { editDbContentClip = new DbContentClip(dbContentClipID); } editDbContentClip.Title = tbTitle.Text; editDbContentClip.Description = tbDescription.Text; editDbContentClip.Keywords = tbKeywords.Text; editDbContentClip.OverrideUrl = tbOverrideUrl.Text; editDbContentClip.Icon = tbIcon.Text; editDbContentClip.Body = tbBody.Text; editDbContentClip.PublishDate = calPublishDateP.SelectedDate; editDbContentClip.ExpirationDate = calExpirationDateP.SelectedDate; editDbContentClip.ArchiveDate = calArchiveDateP.SelectedDate; editDbContentClip.Priority = int.Parse(tbPriority.Text); editDbContentClip.SortOrder = int.Parse(tbSortOrder.Text); editDbContentClip.CommentsEnabled = cbCommentsEnabled.Checked; editDbContentClip.NotifyOnComments = cbNotifyOnComments.Checked; editDbContentClip.MenuLabel = tbMenuLabel.Text; editDbContentClip.MenuTooltip = tbMenuTooltip.Text; editDbContentClip.MenuEnabled = cbMenuEnabled.Checked; editDbContentClip.MenuOrder = int.Parse(tbMenuOrder.Text); editDbContentClip.MenuLeftIcon = tbMenuLeftIcon.Text; editDbContentClip.MenuLeftIconOver = tbMenuLeftIconOver.Text; editDbContentClip.MenuRightIcon = tbMenuRightIcon.Text; editDbContentClip.MenuRightIconOver = tbMenuRightIconOver.Text; editDbContentClip.MenuBreak = cbMenuBreak.Checked; DbContentClipManager clipManager = new DbContentClipManager(); editDbContentClip.References = clipManager.EncodeClips(tbReferences.Text); if (msParentCatalog.SelectedItem != null) { editDbContentClip.ParentCatalog = DbContentCatalog.NewPlaceHolder( int.Parse(msParentCatalog.SelectedItem.Value)); } else { editDbContentClip.ParentCatalog = null; } if (ratingComboBox.SelectedItem != null) { editDbContentClip.Rating = DbContentRating.NewPlaceHolder( int.Parse(ratingComboBox.SelectedItem.Value)); } else { editDbContentClip.Rating = null; } if (msStatus.SelectedItem != null) { editDbContentClip.Status = DbContentStatus.NewPlaceHolder( int.Parse(msStatus.SelectedItem.Value)); } else { editDbContentClip.Status = null; } GreyFoxUserManager userManager = new GreyFoxUserManager(); editDbContentClip.Authors = userManager.DecodeString(tbAuthors.Text, ","); editDbContentClip.Editors = userManager.DecodeString(tbEditors.Text, ","); if (editOnAdd) { dbContentClipID = editDbContentClip.Save(); } else { editDbContentClip.Save(); } if (resetOnAdd) { tbTitle.Text = string.Empty; tbDescription.Text = string.Empty; tbKeywords.Text = string.Empty; tbOverrideUrl.Text = string.Empty; tbIcon.Text = string.Empty; tbBody.Text = string.Empty; calPublishDateP.SelectedDate = DateTime.Now; calExpirationDateP.SelectedDate = DateTime.Now; calArchiveDateP.SelectedDate = DateTime.Now; tbPriority.Text = string.Empty; tbSortOrder.Text = string.Empty; cbCommentsEnabled.Checked = false; cbNotifyOnComments.Checked = false; tbMenuLabel.Text = string.Empty; tbMenuTooltip.Text = string.Empty; cbMenuEnabled.Checked = false; tbMenuOrder.Text = string.Empty; tbMenuLeftIcon.Text = string.Empty; tbMenuLeftIconOver.Text = string.Empty; tbMenuRightIcon.Text = string.Empty; tbMenuRightIconOver.Text = string.Empty; cbMenuBreak.Checked = false; tbReferences.Text = string.Empty; msParentCatalog.SelectedIndex = 0; ratingComboBox.SelectedIndex = 0; msStatus.SelectedIndex = 0; } // Clear Caches Amns.GreyFox.Content.Caching.SiteMapCacheControl.ClearSiteMaps(); Amns.GreyFox.Content.Caching.MenuCacheControl.ClearMenus(); OnUpdated(EventArgs.Empty); }