public void Update(int CatLinkID,int CategoryID,int LinkID)
        {
            CatLink item = new CatLink();
            item.MarkOld();
            item.IsLoaded = true;

            item.CatLinkID = CatLinkID;

            item.CategoryID = CategoryID;

            item.LinkID = LinkID;

            item.Save(UserName);
        }
        public void Insert(int CategoryID,int LinkID)
        {
            CatLink item = new CatLink();

            item.CategoryID = CategoryID;

            item.LinkID = LinkID;

            item.Save(UserName);
        }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Current.checkLogin();
        // Get the link out from the query string
        if (Request["linkurl"] != null)
        {
            _thisLink = new Link(Link.Columns.URLRewrite, Request["linkurl"]);
        }
        if (Request["linkid"] != null && _thisLink == null)
        {
            _thisLink = new Link(ubConvert.ToInt(Request["linkid"], 0));
        }
        // If, no link? Return to the root
        // See if user own this link or not
        // If user's an admin, he has all power
        if ((_thisLink == null) || (_thisLink.Poster != VL.Current.User.UserID && VL.Current.User.SecurityLevel < 5))
        {
            Response.Redirect(Config.GetConfigPath("Root"), true);
        }

        // We have to keep the form value
        if (!this.IsPostBack)
        {

            // If found link, insert the information here
            txtInputTitle.Text = _thisLink.Title;
            TxtInputDescription.Text = _thisLink.Description;
            // Need to get the category out
            CatLink catLink = new CatLink(CatLink.Columns.LinkID, _thisLink.LinkID);
            CategoryCollection listCat = new CategoryCollection();
            listCat.Add(Category.Get(catLink.CategoryID));
            UcCategorySelectionList1.SelectedCategory = listCat;
        }

        UcCategorySelectionList1.GenerateList();
    }