public void Execute(BasePage Context) { //JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); //Dictionary<String, Object> jsonPaneFields = new Dictionary<string, Object>(); DNNGo_ThemePlugin_MenuRowItem MenuRow = new DNNGo_ThemePlugin_MenuRowItem(); MenuRow.ID = WebHelper.GetIntParam(Context.Request, "RowID", 0); if (MenuRow.ID > 0) { MenuRow = DNNGo_ThemePlugin_MenuRowItem.FindByKeyForEdit(MenuRow.ID); MenuRow = UpdatePane(Context, MenuRow); } else { MenuRow = CreateNewPane(Context); } //foreach (var Field in DNNGo_ThemePlugin_MenuRowItem.Meta.Fields) //{ // jsonPaneFields.Add(Field.ColumnName, MenuRow[Field.ColumnName]); //} //转换数据为json //ResponseString = jsSerializer.Serialize(jsonPaneFields); ResponseString = MenuRow.ToJson(); }
public void Execute(BasePage Context) { //JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); //Dictionary<String, Object> jsonPaneFields = new Dictionary<string, Object>(); Int32 RowID = WebHelper.GetIntParam(Context.Request, "RowID", 0); Int32 DeleteRow = 0; Boolean Success = false; DNNGo_ThemePlugin_MenuRowItem MenuRow = DNNGo_ThemePlugin_MenuRowItem.FindByKeyForEdit(RowID); if (MenuRow != null && MenuRow.ID > 0) { if (MenuRow.Delete() > 0) { DeleteRow = 1; Success = true; } } //jsonPaneFields.Add("DeleteRow", DeleteRow); //jsonPaneFields.Add("Success", Success); //转换数据为json //ResponseString = jsSerializer.Serialize(jsonPaneFields); ResponseString = new { DeleteRow = DeleteRow, Success = Success }.ToJson(); }