public void copyLandingPageItem(string RoleId, LandingPageData.LandingPageItem ItemToCopy) { CswNbtLandingPageItem NewItem = CswNbtLandingPageItemFactory.makeLandingPageItem(_CswNbtResources, ItemToCopy.LinkType); NewItem.setDBValuesFromExistingLandingPageItem(RoleId, ItemToCopy); NewItem.saveToDB(); }
public override void setDBValuesFromExistingLandingPageItem(string RoleId, LandingPageData.LandingPageItem Item) { CswEnumNbtViewType ViewType = (CswEnumNbtViewType)Item.Type; if (ViewType == CswEnumNbtViewType.View) { _ItemRow["to_nodeviewid"] = new CswNbtViewId(Item.ViewId).get(); } else if (ViewType == CswEnumNbtViewType.Action) { _ItemRow["to_actionid"] = Item.ActionId; } else if (ViewType == CswEnumNbtViewType.Report) { _ItemRow["to_reportid"] = Item.ReportId; } else if (ViewType == CswEnumNbtViewType.Search) { ; _ItemRow["to_searchid"] = Item.ReportId; } else { throw new CswDniException(CswEnumErrorType.Warning, "You must select a view", "No view was selected for new Link LandingPage Item"); } _setCommonDBValuesFromExistingLandingPageItem(RoleId, Item); }
public override void setDBValuesFromExistingLandingPageItem(string RoleId, LandingPageData.LandingPageItem Item) { _ItemRow["to_nodetypeid"] = Item.NodeTypeId; if (false == string.IsNullOrEmpty(Item.ActionId)) { _ItemRow["to_actionid"] = Item.ActionId; } _setCommonDBValuesFromExistingLandingPageItem(RoleId, Item); }
/// <summary> /// Grabs a LandingPage Item with the given Name for the given RoleId and/or Action Id /// </summary> /// <param name="Name">Label Text of the LandingPage Item to grab</param> /// <param name="ActionId">Action ID (for Action-specific Landing Pages)</param> /// <param name="RoleId">RoleId (for Welcome Page)</param> /// <returns></returns> public LandingPageData.LandingPageItem getLandingPageItem(String Name, Int32 ActionId, CswPrimaryKey RoleId) { LandingPageData.LandingPageItem LandingPageItem = null; LandingPageData Items = _LandingPageTable.getLandingPageItems(new LandingPageData.Request { ActionId = ActionId.ToString(), RoleId = RoleId.ToString() }); foreach (LandingPageData.LandingPageItem Item in Items.LandingPageItems) { if (Item.Text == Name) { LandingPageItem = Item; } } return(LandingPageItem); }
public override void setDBValuesFromExistingLandingPageItem(string RoleId, LandingPageData.LandingPageItem Item) { _setCommonDBValuesFromExistingLandingPageItem(RoleId, Item); }
public override void setDBValuesFromExistingLandingPageItem(string RoleId, LandingPageData.LandingPageItem Item) { _ItemRow["to_tabid"] = Item.TabId; _ItemRow["to_nodetypeid"] = Item.NodeTypeId; _setCommonDBValuesFromExistingLandingPageItem(RoleId, Item); }
protected virtual void _setCommonDBValuesFromExistingLandingPageItem(string RoleId, LandingPageData.LandingPageItem Item) { //when we receive the string, it has the full path already calculated, but we just want the icon name string buttonIcon = Item.ButtonIcon; if (Item.ButtonIcon.LastIndexOf('/') > -1) { buttonIcon = Item.ButtonIcon.Substring(Item.ButtonIcon.LastIndexOf('/')); } _setCommonItemDataForDBImpl(RoleId, Item.ActionId, Item.LinkType, CswConvert.ToInt32(Item.DisplayCol), CswConvert.ToInt32(Item.DisplayRow), Item.Text, buttonIcon); }
public abstract void setDBValuesFromExistingLandingPageItem(string RoleId, LandingPageData.LandingPageItem Item);
protected CswNbtLandingPageItem(CswNbtResources CswNbtResources) { _CswNbtResources = CswNbtResources; _ItemData = new LandingPageData.LandingPageItem(); initEmptyLandingPageTable(); }
public override void setDBValuesFromExistingLandingPageItem(string RoleId, LandingPageData.LandingPageItem Item) { //really circituous route of getting the OCP, but we are not exposing the OCP any more direct way _ItemRow["to_objectclasspropid"] = _CswNbtResources.MetaData.getNodeTypeProp(CswConvert.ToInt32(Item.NodeTypePropId.Split('_')[1])).ObjectClassPropId; _setCommonDBValuesFromExistingLandingPageItem(RoleId, Item); }
/// <summary> /// Add a LandingPage Item using an existing Item as a template /// </summary> /// <param name="ItemToCopy">LandingPage Item</param> public void copyLandingPageItem(string RoleId, LandingPageData.LandingPageItem ItemToCopy) { _LandingPageTable.copyLandingPageItem(RoleId, ItemToCopy); }