Exemple #1
0
        public void copyLandingPageItem(string RoleId, LandingPageData.LandingPageItem ItemToCopy)
        {
            CswNbtLandingPageItem NewItem = CswNbtLandingPageItemFactory.makeLandingPageItem(_CswNbtResources, ItemToCopy.LinkType);

            NewItem.setDBValuesFromExistingLandingPageItem(RoleId, ItemToCopy);
            NewItem.saveToDB();
        }
Exemple #2
0
        public void addLandingPageItem(LandingPageData.Request Request)
        {
            CswNbtLandingPageItem Item = CswNbtLandingPageItemFactory.makeLandingPageItem(_CswNbtResources, Request.Type);

            Item.setDBValuesFromRequest(Request);
            Item.saveToDB();
        }
Exemple #3
0
        public LandingPageData getLandingPageItems(LandingPageData.Request Request)
        {
            LandingPageData Items            = new LandingPageData();
            DataTable       LandingPageTable = _getLandingPageTable(Request.RoleId, Request.ActionId);

            foreach (DataRow LandingPageRow in LandingPageTable.Rows)
            {
                CswNbtLandingPageItem Item = CswNbtLandingPageItemFactory.makeLandingPageItem(_CswNbtResources, LandingPageRow["componenttype"].ToString());
                Item.setItemDataForUI(LandingPageRow, Request);
                if (false == String.IsNullOrEmpty(Item.ItemData.LandingPageId))
                {
                    Items.LandingPageItems.Add(Item.ItemData);
                }
            }
            return(Items);
        }
Exemple #4
0
        public void updateLandingPageItem(LandingPageData.Request Request)
        {
            Request.NewRow = _getNextAvailableRow(Request.LandingPageId, Request.NewRow, Request.NewColumn);
            if (Request.LandingPageId != Int32.MinValue)
            {
                CswNbtLandingPageItem Item = CswNbtLandingPageItemFactory.makeLandingPageItem(_CswNbtResources, Request.Type);
                Item.setDBValuesFromRequest(Request);

                CswTableUpdate LandingPageUpdate = _CswNbtResources.makeCswTableUpdate("MoveLandingPageItem", "landingpage");
                DataTable      LandingPageTable  = LandingPageUpdate.getTable("landingpageid", Request.LandingPageId);
                if (LandingPageTable.Rows.Count > 0)
                {
                    LandingPageTable.Rows[0].Delete();
                    LandingPageTable.Rows.Add(Item.ItemRow);
                    LandingPageUpdate.update(LandingPageTable);
                }
            }
        }