protected void btSave_Click(object sender, System.EventArgs e) { clip.Title = tbTitle.Text; clip.Description = tbDescription.Text; clip.Body = caEditor.ContentHTML; //clip.Body = ftbEditor.Text; clip.Save(); userEditor.Visible = false; //caEditor.Visible = false; //ftbEditor.Visible = false; btSave.Visible = false; btCancel.Visible = false; }
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 override void itemCommand(object sender, ToolBarItemEventArgs e) { base.itemCommand(sender, e); switch (e.Item.Value) { case "Up": if (IsCatalogSelected) { DbContentCatalogManager.PeerMove(new DbContentCatalog(this.SelectedID), -1, true, false); } else { DbContentClipManager.PeerMove(new DbContentClip(this.SelectedClipID), -1, true, false); } break; case "Down": if (IsCatalogSelected) { DbContentCatalogManager.PeerMove(new DbContentCatalog(this.SelectedID), -1, true, false); } else { DbContentClipManager.PeerMove(new DbContentClip(this.SelectedClipID), 1, true, false); } break; case "Copy": if (isCatalogSelected) { copyCatalogID = selectedID; copyClipID = -1; } else { copyCatalogID = -1; copyClipID = selectedClipID; } break; case "Paste": if (copyCatalogID != -1) { DbContentCatalog srcCatalog; DbContentCatalog destCatalog; srcCatalog = new DbContentCatalog(copyCatalogID); if (isCatalogSelected) { destCatalog = DbContentCatalog.NewPlaceHolder(selectedID); } else { destCatalog = new DbContentClip(selectedClipID).ParentCatalog; } pasteCatalog(srcCatalog, destCatalog, false, false); } else if (copyClipID != -1) { DbContentClip copyClip = new DbContentClip(selectedClipID); DbContentClip newClip = new DbContentClip(); newClip.ArchiveDate = copyClip.ArchiveDate; newClip.Authors = copyClip.Authors; newClip.Body = copyClip.Body; newClip.CommentsEnabled = copyClip.CommentsEnabled; newClip.CreateDate = DateTime.Now; newClip.Description = copyClip.Description; newClip.Editors = copyClip.Editors; newClip.ExpirationDate = copyClip.ExpirationDate; newClip.Icon = copyClip.Icon; newClip.Keywords = copyClip.Keywords; newClip.MenuBreak = copyClip.MenuBreak; newClip.MenuEnabled = copyClip.MenuEnabled; newClip.MenuLabel = copyClip.MenuLabel; newClip.MenuLeftIcon = copyClip.MenuLeftIcon; newClip.MenuLeftIconOver = copyClip.MenuLeftIconOver; newClip.MenuRightIcon = copyClip.MenuRightIcon; newClip.MenuRightIconOver = copyClip.MenuRightIconOver; newClip.MenuTooltip = copyClip.MenuTooltip; newClip.ModifyDate = DateTime.Now; newClip.NotifyOnComments = copyClip.NotifyOnComments; newClip.OverrideUrl = copyClip.OverrideUrl; if (isCatalogSelected) { newClip.ParentCatalog = DbContentCatalog.NewPlaceHolder(selectedID); } else { newClip.ParentCatalog = new DbContentClip(selectedClipID).ParentCatalog; } newClip.Priority = copyClip.Priority; newClip.PublishDate = copyClip.PublishDate; newClip.Rating = copyClip.Rating; newClip.References = copyClip.References; newClip.SortOrder = copyClip.SortOrder; newClip.Status = copyClip.Status; newClip.Title = copyClip.Title; newClip.WorkingDraft = copyClip.WorkingDraft; newClip.Save(); } break; case "rPaste": if (copyCatalogID != -1) { DbContentCatalog srcCatalog; DbContentCatalog destCatalog; srcCatalog = new DbContentCatalog(copyCatalogID); if (isCatalogSelected) { destCatalog = DbContentCatalog.NewPlaceHolder(selectedID); } else { destCatalog = new DbContentClip(selectedClipID).ParentCatalog; } pasteCatalog(srcCatalog, destCatalog, true, true); } break; } }
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); }