Ejemplo n.º 1
0
        public static ServerResponse getUserWidget(long widgetID)
        {
            WidgetModel widget = SqliteHandler.getWidget(widgetID);

            if (widget == null)
            {
                return(new ServerResponse(false, "widget not found", null));
            }

            return(new ServerResponse(true, "widget loaded succesfully", widget));
        }
Ejemplo n.º 2
0
        public static ServerResponse updateUserWidget(long widgetID, WidgetModel widget)
        {
            WidgetModel oldWidget = SqliteHandler.getWidget(widgetID);

            if (oldWidget == null)
            {
                return(new ServerResponse(false, "widget not found", null));
            }

            SqliteHandler.updateWidget(widgetID, widget);

            oldWidget = SqliteHandler.getWidget(widgetID);

            return(new ServerResponse(true, "widget updated successfully", oldWidget));
        }
Ejemplo n.º 3
0
        public static ServerResponse deleteUserWidget(long widgetID)
        {
            WidgetModel widget = SqliteHandler.getWidget(widgetID);

            //find user, set = to existing

            if (widget == null)
            {
                return(new ServerResponse(false, "widget not found", null));
            }

            SqliteHandler.deleteWidget(widgetID);

            return(new ServerResponse(true, "widget deleted succesfully", null));
        }