コード例 #1
0
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Lib.RichTextMgr myRichTextMgr = new Lib.RichTextMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("RichTextID",        _itemid),
                    new e2Data("CategoryID",        CategoryTree_Menu.Selected_CategoryID),
                    new e2Data("Display_Name",      tbx_DisplayName.Text),
                    new e2Data("RichText_Content",  RadEditor_TextContent.Content),
                    new e2Data("LastUpdate_Date",   DateTime.Now.ToString()),
                    new e2Data("LastUpdate_UserID", Security.Users.UserStatus.Current_UserID(this.Page))
                };

                myRichTextMgr.Edit_RichText_Content(UpdateData);

                // Switch Category
                CategoryMgr myCategoryMgr = new CategoryMgr();
                myCategoryMgr.Move_ComponentInCategory_Item(_source_categoryid, CategoryTree_Menu.Selected_CategoryID, "A2E21E10-FF09-4D3F-9D70-DF9376FCF8B7");

                // Finish Update Close Window
                string _finishupdate_script = string.Format("CloseAndRebind({0});", DataEval.QuoteText("Module_ControlPanel"));
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "myScript", _finishupdate_script, true);
            }
        }
コード例 #2
0
        protected void btn_Move_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                for (int i = 0; i < ListView_ItemList.Items.Count; i++)
                {
                    CheckBox chk_Selected = (CheckBox)ListView_ItemList.Items[i].FindControl("chk_Selected");
                    if (chk_Selected.Checked)
                    {
                        HiddenField hidden_ItemID = (HiddenField)ListView_ItemList.Items[i].FindControl("Hidden_ItemID");

                        Lib.RichTextMgr myRichTextMgr = new Lib.RichTextMgr();
                        Lib.RichText    myRichText    = myRichTextMgr.Get_RichText_Content(hidden_ItemID.Value);

                        if (myRichText.CategoryID != CategoryTree_MoveTo.Selected_CategoryID)
                        {
                            e2Data[] UpdateData =
                            {
                                new e2Data("RichTextID", myRichText.RichTextID),
                                new e2Data("CategoryID", CategoryTree_MoveTo.Selected_CategoryID)
                            };

                            myRichTextMgr.Edit_RichText_Content(UpdateData);

                            // Switch Category
                            CategoryMgr myCategoryMgr = new CategoryMgr();
                            myCategoryMgr.Move_ComponentInCategory_Item(myRichText.CategoryID, CategoryTree_MoveTo.Selected_CategoryID, "A2E21E10-FF09-4D3F-9D70-DF9376FCF8B7");
                        }
                    }
                }

                Control_Init();
            }
        }
コード例 #3
0
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            Lib.RichTextMgr myRichTextMgr = new Lib.RichTextMgr();

            DateTime nowTime = DateTime.Now;

            // Create New
            string RichTextID = Nexus.Core.Tools.IDGenerator.Get_New_GUID();

            Control_Property[] Update_Properties = { };


            #region Update for Control Data

            // Update Extra Database
            if (_isshared)
            {
                e2Data[] UpdateData =
                {
                    new e2Data("RichTextID",        _contentid),
                    new e2Data("RichText_Content",  RadEditor_TextContent.Content),
                    new e2Data("LastUpdate_Date",   nowTime.ToString()),
                    new e2Data("LastUpdate_UserID", Security.Users.UserStatus.Current_UserID(this.Page))
                };

                myRichTextMgr.Edit_RichText_Content(UpdateData);
            }

            // Check Control is New
            if (DataEval.IsEmptyQuery(_richtextid))
            {
                // Create Control Property
                Control_Property[] PropertieData =
                {
                    new Control_Property(_page_controlid, "RichTextID",       RichTextID),
                    new Control_Property(_page_controlid, "RichText_Content", RadEditor_TextContent.Content),
                    new Control_Property(_page_controlid, "IsShared",         _isshared.ToString()),
                    new Control_Property(_page_controlid, "ContentID",        _contentid)
                };
                Update_Properties = PropertieData;
            }
            else
            {
                // Update Control Property
                Control_Property[] PropertieData =
                {
                    new Control_Property(_page_controlid, "RichTextID",       _richtextid),
                    new Control_Property(_page_controlid, "RichText_Content", RadEditor_TextContent.Content),
                    new Control_Property(_page_controlid, "IsShared",         _isshared.ToString()),
                    new Control_Property(_page_controlid, "ContentID",        _contentid)
                };
                Update_Properties = PropertieData;
            }

            #endregion

            #region Update for Control Properties

            ControlMgr myControlMgr = new ControlMgr();
            myControlMgr.Update_Control_Properties(_editmode, _richtextid, _page_controlid, Update_Properties);

            #endregion

            // Finish Update Close Window
            //OnFinishUpdate(this, EventArgs.Empty);
            string _finishupdate_script = string.Format("CloseAndRebind({0});", _page_controlid);
            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "myScript", _finishupdate_script, true);
        }