コード例 #1
0
        /// <summary>
        /// 更新绑定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (Display.ToLower() == "list")
                {
                    //设置全局选项
                    SetGlobal();
                    //更新附加图片集
                    String AlbumIDs = WebHelper.GetStringParam(Request, hfPictures.UniqueID, "");
                    DNNGo_ThemePlugin_Relationships.Update(TabItem.TabID, PortalId, AlbumIDs, FileType);
                    mTips.LoadMessage("SavePictureSuccess", EnumTips.Success, this, new String[] { TabItem.TabName });
                }
                else
                {
                    SetSortList();
                    mTips.LoadMessage("SortPictureSuccess", EnumTips.Success, this, new String[] { "" });
                }



                Response.Redirect(xUrl("EditTabID", EditTabID.ToString(), Token, "Display=" + Display, "FileType=" + FileType.ToString()), false);
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
コード例 #2
0
        /// <summary>
        /// 设置数据项
        /// </summary>
        private void SetSortList()
        {
            //查询出当前字段的列表
            String jsonFields = WebHelper.GetStringParam(Request, nestable_output.UniqueID, "");

            if (!String.IsNullOrEmpty(jsonFields))
            {
                JavaScriptSerializer json = new JavaScriptSerializer();
                List <DNNGo_ThemePlugin_Relationships> json_fields = json.Deserialize <List <DNNGo_ThemePlugin_Relationships> >(jsonFields);
                if (json_fields != null && json_fields.Count > 0)
                {
                    List <DNNGo_ThemePlugin_Relationships> FieldLists = DNNGo_ThemePlugin_Relationships.FindAllByID(EditTabID, PortalId, FileType);

                    for (int i = 0; i < json_fields.Count; i++)
                    {
                        DNNGo_ThemePlugin_Relationships DBField = FieldLists.Find(r => r.ID == json_fields[i].ID);
                        if (DBField != null && DBField.ID > 0 && DBField.Sort != i)
                        {
                            DBField.Sort = i;
                            DBField.Update();
                        }
                    }
                }
            }
        }