Exemplo n.º 1
0
        public static ReturnObject Delete( HttpContext context, long id )
        {
            if( id <= 0 )
                return new ReturnObject() { Error = true, Message = "Invalid Filter." };

            var item = new Lib.Data.ReportFilter( id );
            item.Delete();

            return new ReturnObject() {
                Growl = new ReturnGrowlObject() {
                    Type = "default",
                    Vars = new ReturnGrowlVarsObject() {
                        text = "You have successfully deleted this filter.",
                        title = "Filter deleted"
                    }
                },
                Actions = new List<ReturnActionObject>()
                {
                    new ReturnActionObject() {
                        Ele = "#filters-table tr[data-id=\""+id.ToString()+"\"]",
                        Type = "remove"
                    }
                }
            };
        }