Exemple #1
0
        public void Execute(BasePage Context)
        {
            //JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            //Dictionary<String, Object> jsonPaneFields = new Dictionary<string, Object>();
            Int32 PaneID = WebHelper.GetIntParam(Context.Request, "PaneID", 0);

            DNNGo_ThemePlugin_MenuPane MenuPane = DNNGo_ThemePlugin_MenuPane.FindByKeyForEdit(PaneID);

            MenuPane.PaneName  = WebHelper.GetStringParam(Context.Request, "PaneName", MenuPane.PaneName);
            MenuPane.TagPane   = WebHelper.GetStringParam(Context.Request, "TagPane", MenuPane.TagPane);
            MenuPane.PaneWidth = WebHelper.GetStringParam(Context.Request, "PaneWidth", MenuPane.PaneWidth);
            MenuPane.Sort      = WebHelper.GetIntParam(Context.Request, "Sort", MenuPane.Sort);
            MenuPane.TabID     = WebHelper.GetIntParam(Context.Request, "EditTabID", MenuPane.TabID);

            //MenuPane.Options = WebHelper.GetStringParam(Context.Request, "Options", MenuPane.Options);

            List <KeyValueEntity> Options = MenuPane.SettingItems;

            Options = Context.UpdateSettings(Options, "PaneTopSpacing", WebHelper.GetStringParam(Context.Request, "PaneTopSpacing", "0"));
            Options = Context.UpdateSettings(Options, "PaneRightSpacing", WebHelper.GetStringParam(Context.Request, "PaneRightSpacing", "0"));
            Options = Context.UpdateSettings(Options, "PaneBottomSpacing", WebHelper.GetStringParam(Context.Request, "PaneBottomSpacing", "0"));
            Options = Context.UpdateSettings(Options, "PaneLeftSpacing", WebHelper.GetStringParam(Context.Request, "PaneLeftSpacing", "0"));
            Options = Context.UpdateSettings(Options, "PaneTopLine", WebHelper.GetStringParam(Context.Request, "PaneTopLine", "false"));
            Options = Context.UpdateSettings(Options, "PaneRightLine", WebHelper.GetStringParam(Context.Request, "PaneRightLine", "false"));
            Options = Context.UpdateSettings(Options, "PaneBottomLine", WebHelper.GetStringParam(Context.Request, "PaneBottomLine", "false"));
            Options = Context.UpdateSettings(Options, "PaneLeftLine", WebHelper.GetStringParam(Context.Request, "PaneLeftLine", "false"));

            MenuPane.Options = Options.ToJson();


            if (MenuPane.ID > 0)
            {
                MenuPane = UpdatePane(Context, MenuPane);
            }
            else
            {
                MenuPane = CreateNewPane(Context, MenuPane);
            }


            //foreach (var Field in DNNGo_ThemePlugin_MenuPane.Meta.Fields)
            //{
            //    jsonPaneFields.Add(Field.ColumnName, MenuPane[Field.ColumnName]);
            //}

            //转换数据为json
            //ResponseString = jsSerializer.Serialize(jsonPaneFields);

            ResponseString = MenuPane.ToJson();
        }
Exemple #2
0
        public void Execute(BasePage Context)
        {
            Int32   DeleteRow  = 0;
            Int32   DeletePane = 0;
            Boolean Success    = false;

            Int32 PaneID = WebHelper.GetIntParam(Context.Request, "PaneID", 0);

            if (PaneID > 0)
            {
                DNNGo_ThemePlugin_MenuPane MenuPane = DNNGo_ThemePlugin_MenuPane.FindByKeyForEdit(PaneID);
                if (MenuPane != null && MenuPane.ID > 0)
                {
                    List <DNNGo_ThemePlugin_MenuRowItem> RowItems = DNNGo_ThemePlugin_MenuRowItem.FindAll(DNNGo_ThemePlugin_MenuRowItem._.PaneID, PaneID);
                    foreach (var RowItem in RowItems)
                    {
                        if (RowItem.Delete() > 0)
                        {
                            DeleteRow++;
                        }
                    }


                    if (MenuPane.Delete() > 0)
                    {
                        DeleteRow = 1;
                        Success   = true;
                    }
                }
                else
                {
                    Success = false;
                }
            }
            else
            {
                Success = false;
            }

            //转换数据为json
            ResponseString = new  { DeletePane = DeletePane, DeleteRow = DeleteRow, Success = Success }.ToJson();
        }