public static ReturnObject RemoveItem( HttpContext context, long id )
        {
            var item = new Lib.Data.DSQ.Link( id );

            if( item.ID != id )
                return new ReturnObject() {
                    Error = true,
                    Message = "Invalid item."
                };

            var list = Lib.Systems.Lists.GetMyFormsAndDocumentsList();

            list.RemoveItem( id );

            return new ReturnObject() {
                Error = false,
                Growl = new ReturnGrowlObject() {
                    Type = "default",
                    Vars = new ReturnGrowlVarsObject() {
                        text = "You have successfully removed \"" + item.Label + "\" from your list.",
                        title = "Item Removes"
                    }
                }
            };
        }
Beispiel #2
0
        public static ReturnObject Delete( HttpContext context, long id )
        {
            if( id <= 0 || id == 1 ) // id == 1 is to protect the General info section which is special
                return new ReturnObject() { Error = true, Message = "Invalid Section." };

            var item = new Lib.Data.DSQ.Link( id );
            var question_id = item.QuestionID;
            item.Delete();

            return new ReturnObject() {
                Growl = new ReturnGrowlObject() {
                    Type = "default",
                    Vars = new ReturnGrowlVarsObject() {
                        text = "You have successfully deleted a link.",
                        title = "Link Deleted"
                    }
                },
                Actions = new List<ReturnActionObject>()
                {
                    new ReturnActionObject() {
                        Ele = "#form-q-"+question_id+" tr[data-id=\""+id.ToString()+"\"]",
                        Type = "remove"
                    }
                }
            };
        }