예제 #1
0
        private static void deleteRowPrivate(ContentApp app, int rowId)
        {
            if (rowId <= 0)
            {
                return;
            }

            int           appId = app.Id;
            List <string> list  = new List <string>();

            string[] rowList = app.RowList;

            if (rowId <= rowList.Length)
            {
                if (rowId < rowList.Length)
                {
                    ContentSection.updateBatch("RowId=RowId-1", "RowId>" + rowId + " and AppId=" + appId);
                }
                for (int i = 1; i <= rowList.Length; i++)
                {
                    if (rowId != i)
                    {
                        list.Add(rowList[i - 1]);
                    }
                }
                String strLayout = string.Empty;
                foreach (String str in list)
                {
                    strLayout = strLayout + str + "/";
                }
                strLayout  = strLayout.TrimEnd('/');
                app.Layout = strLayout;
                app.update("Layout");
            }
        }
예제 #2
0
        public void UpdateRow(ContentApp app, MoveRowInfo mr)
        {
            app.Layout    = mr.RowString;
            app.Style     = updateStyle(app.Style, mr);
            app.SkinStyle = updateStyle(app.SkinStyle, mr);
            app.update();

            int tempId = 9999;

            ContentSection.updateBatch("RowId=" + tempId, "AppId=" + app.Id + " and RowId=" + mr.Row1);
            ContentSection.updateBatch("RowId=" + mr.Row1, "AppId=" + app.Id + " and RowId=" + mr.Row2);
            ContentSection.updateBatch("RowId=" + mr.Row2, "AppId=" + app.Id + " and RowId=" + tempId);

            List <ContentSection> list = new ContentSectionService().GetByApp(app.Id);
        }