Esempio n. 1
0
        public static int GetViewIndexByID (MultiView mview, string viewName)
        {
            for (var i = 0; i < mview.Views.Count; i++)
                if (mview.Views [i].ID == viewName)
                    return i;

            return -1;
        }
        protected override void CreateChildControls()
        {
            Controls.Clear();

            pairingMultiView = new MultiView() { ActiveViewIndex = 0 };

            View notUsingLatchView = new View() { ID = "notUsingLatchView" };
            notUsingLatchView.Controls.Add(new Literal() { Text = "You are not using the Latch Membership Provider." });
            pairingMultiView.Views.Add(notUsingLatchView);

            View anonymousView = new View() { ID = "AnonymousView" };
            anonymousView.Controls.Add(new Literal() { Text = "You are not logged in. Please login to manage your account pairing." });
            pairingMultiView.Views.Add(anonymousView);

            View pairedView = new View() { ID = "PairedView" };
            pairedView.Controls.Add(new Literal() { Text = "Account ID: " });
            accountIdLabel = new Label() { ID = "AccountIdLabel" };
            accountIdLabel.Font.Bold = true;
            pairedView.Controls.Add(accountIdLabel);
            Button unpairButton = new Button() { ID = "UnpairButton", Text = "Unpair" };
            unpairButton.Click += new EventHandler(UnpairButton_Click);
            pairedView.Controls.Add(new Literal() { Text = " " });
            pairedView.Controls.Add(unpairButton);
            pairingMultiView.Views.Add(pairedView);

            View unpairedView = new View() { ID = "UnpairedView" };
            unpairedView.Controls.Add(new Literal() { Text = "Pairing token: " });
            pairingTokenTextBox = new TextBox() { ID = "PairingTokenTextBox" };
            unpairedView.Controls.Add(pairingTokenTextBox);
            Button pairButton = new Button() { ID = "PairButton", Text = "Pair" };
            pairButton.Click += new EventHandler(PairButton_Click);
            unpairedView.Controls.Add(new Literal() { Text = " " });
            unpairedView.Controls.Add(pairButton);
            pairingMultiView.Views.Add(unpairedView);

            //this.Controls.Add(new Literal() { Text = "<h3>Pairing with Latch</h3>" });
            this.Controls.Add(pairingMultiView);
        }
Esempio n. 3
0
		public static void EventsTest_4 (Page p)
		{
			MultiView MultiView1 = new MultiView ();
			MultiView1.ID = "MultiView1";
			View view_1 = new View ();
			view_1.ID = "view_1";
			View view_2 = new View ();
			view_2.ID = "view_2";
			Button bt = new Button ();
			bt.ID = "bt";
			bt.CommandName = "SwitchViewByIndex";
			bt.CommandArgument = "1";
			view_1.Controls.Add (bt);
			view_1.Controls.Add (new LiteralControl ("View_1_is_active"));
			view_2.Controls.Add (new LiteralControl ("View_2_is_active"));
			MultiView1.Views.Add (view_1);
			MultiView1.Views.Add (view_2);
			MultiView1.ActiveViewIndex = 0;
			MultiView1.ActiveViewChanged += new EventHandler (MultiView1_ActiveViewChanged);
			p.Controls.Add (MultiView1);
		}
Esempio n. 4
0
		public static void EventsTest (Page p)
		{

			MultiView MultiView1 = new MultiView ();
			MultiView1.ID = "MultiView1";
			View view_1 = new View ();
			view_1.ID = "view_1";
			View view_2 = new View ();
			view_2.ID = "view_2";
			Button bt = new Button ();
			bt.ID = "bt";
			

			view_1.Controls.Add (bt);
			view_1.Controls.Add (new LiteralControl ("View_1_is_active"));
			view_2.Controls.Add (new LiteralControl ("View_2_is_active"));
			MultiView1.Views.Add (view_1);
			MultiView1.Views.Add (view_2);
			MultiView1.ActiveViewIndex = 0;
			MultiView1.ActiveViewChanged += new EventHandler (MultiView1_ActiveViewChanged);
			p.Controls.Add (MultiView1);

			if (p.IsPostBack) {
				MultiView1.ActiveViewIndex = 1;
			}
		}
Esempio n. 5
0
		public static void EventsTest (Page p)
		{
			MultiView MultiView1 = new MultiView ();
			MultiView1.ID = "MultiView1";
			View view_1 = new View ();
			view_1.ID = "view_1";
			View view_2 = new View ();
			view_2.ID = "view_2";
			Button bt = new Button ();
			bt.ID = "bt";
			bt.CommandName = "NextView";

			view_1.Controls.Add (bt);
			view_1.Controls.Add (new LiteralControl ("View_1_is_active"));
			view_2.Controls.Add (new LiteralControl ("View_2_is_active"));

			view_1.Activate += new EventHandler (view_1_Activate);
			view_1.Deactivate += new EventHandler (view_1_Deactivate);
			MultiView1.Views.Add (view_1);
			MultiView1.Views.Add (view_2);
			p.Controls.Add (MultiView1);
			MultiView1.ActiveViewIndex = 0;
		}
Esempio n. 6
0
		protected virtual void CreateControlHierarchy ()
		{
			ITemplate layoutTemplate = LayoutTemplate;
			if (layoutTemplate != null) {
				CreateControlHierarchy_LayoutTemplate (layoutTemplate);
				return;
			}
			styles.Clear ();

			wizardTable = new ContainedTable (this);

			Table contentTable = wizardTable;

			if (DisplaySideBar) {
				contentTable = new Table ();
				contentTable.CellPadding = 0;
				contentTable.CellSpacing = 0;
				contentTable.Height = new Unit ("100%");
				contentTable.Width = new Unit ("100%");

				TableRow row = new TableRow ();

				TableCellNamingContainer sideBarCell = new TableCellNamingContainer (SkipLinkText, ClientID);
				sideBarCell.ID = "SideBarContainer";
				sideBarCell.ControlStyle.Height = Unit.Percentage (100);
				CreateSideBar (sideBarCell);
				row.Cells.Add (sideBarCell);

				TableCell contentCell = new TableCell ();
				contentCell.Controls.Add (contentTable);
				contentCell.Height = new Unit ("100%");
				row.Cells.Add (contentCell);

				wizardTable.Rows.Add (row);
			}

			AddHeaderRow (contentTable);

			TableRow viewRow = new TableRow ();
			TableCell viewCell = new TableCell ();

			customNavigation = null;
			multiView = new MultiView ();
			foreach (View v in WizardSteps) {
				if (v is TemplatedWizardStep)
					InstantiateTemplateStep ((TemplatedWizardStep) v);
				multiView.Views.Add (v);
			}
			multiView.ActiveViewIndex = ActiveStepIndex;

			RegisterApplyStyle (viewCell, StepStyle);
			viewCell.Controls.Add (multiView);
			viewRow.Cells.Add (viewCell);
			viewRow.Height = new Unit ("100%");
			contentTable.Rows.Add (viewRow);

			TableRow buttonRow = new TableRow ();
			_navigationCell = new TableCell ();
			_navigationCell.HorizontalAlign = HorizontalAlign.Right;
			RegisterApplyStyle (_navigationCell, NavigationStyle);
			CreateButtonBar (_navigationCell);
			buttonRow.Cells.Add (_navigationCell);
			contentTable.Rows.Add (buttonRow);

			Controls.SetReadonly (false);
			Controls.Add (wizardTable);
			Controls.SetReadonly (true);
		}
Esempio n. 7
0
		void CreateControlHierarchy_LayoutTemplate (ITemplate layoutTemplate)
		{
			var layoutContainer = new WizardLayoutContainer ();
			ControlCollection controls = Controls;

			controls.SetReadonly (false);			
			controls.Add (layoutContainer);
			controls.SetReadonly (true);
			
			layoutTemplate.InstantiateIn (layoutContainer);

			WizardStepCollection steps = WizardSteps;
			bool doRender = steps != null && steps.Count > 0;
			Control container, placeHolder;
			
			if (DisplaySideBar) {
				placeHolder = layoutContainer.FindControl (SideBarPlaceholderId);
				if (placeHolder == null)
					throw MakeLayoutException ("sidebar", SideBarPlaceholderId, " when DisplaySideBar is set to true");

				container = new Control ();
				CreateSideBar (container);
				ReplacePlaceHolder (layoutContainer, placeHolder, container);
			}

			ITemplate headerTemplate = HeaderTemplate;
			if (headerTemplate != null) {
				placeHolder = layoutContainer.FindControl (HeaderPlaceholderId);
				if (placeHolder == null)
					throw MakeLayoutException ("header", HeaderPlaceholderId, " when HeaderTemplate is set");
				
				container = new Control ();
				headerTemplate.InstantiateIn (container);
				ReplacePlaceHolder (layoutContainer, placeHolder, container);
			}

			placeHolder = layoutContainer.FindControl (WizardStepPlaceholderId);
			if (placeHolder == null)
				throw MakeLayoutException ("step", WizardStepPlaceholderId);
			
			customNavigation = null;
			multiView = new MultiView ();
			foreach (View v in steps) {
				if (v is TemplatedWizardStep)
					InstantiateTemplateStep ((TemplatedWizardStep) v);
				multiView.Views.Add (v);
			}
			multiView.ActiveViewIndex = ActiveStepIndex;
			ReplacePlaceHolder (layoutContainer, placeHolder, multiView);

			placeHolder = layoutContainer.FindControl (NavigationPlaceholderId);
			if (placeHolder == null)
				throw MakeLayoutException ("navigation", NavigationPlaceholderId);

			
			var contentTable = new Table ();
			contentTable.CellSpacing = 5;
			contentTable.CellPadding = 5;
			var row = new TableRow ();
			var cell = new TableCell ();
			cell.HorizontalAlign = HorizontalAlign.Right;

			container = new Control ();
			CreateButtonBar (container);
			
			row.Cells.Add (cell);
			contentTable.Rows.Add (row);
			ReplacePlaceHolder (layoutContainer, placeHolder, container);

			layoutContainer.Visible = doRender;
		}
Esempio n. 8
0
 /// <summary>
 /// 加载用户控件
 /// </summary>
 private void LoadWebControl()
 {
     MultiViewMonthlyBulletin = (MultiView)this.FindControl("MultiViewMonthlyBulletin");
     reptList = (Repeater)this.FindControl("reptList");
     litPager = (Literal)this.FindControl("litPager");
     litAdminName = (Literal)this.FindControl("litAdminName");
 }
Esempio n. 9
0
		protected virtual void CreateControlHierarchy ()
		{
			styles.Clear ();

			wizardTable = new Table ();
			wizardTable.CellPadding = CellPadding; 
			wizardTable.CellSpacing = CellSpacing; 
			
			AddHeaderRow (wizardTable);
			
			TableRow viewRow = new TableRow ();
			TableCell viewCell = new TableCell ();
			
			if (multiView == null) {
				multiView = new MultiView ();
				foreach (View v in WizardSteps)
					multiView.Views.Add (v);
			}
			
			multiView.ActiveViewIndex = activeStepIndex;
			
			RegisterApplyStyle (viewCell, StepStyle);
			viewCell.Controls.Add (multiView);
			
			viewCell.Height = new Unit ("100%");
			viewRow.Cells.Add (viewCell);
			wizardTable.Rows.Add (viewRow);
			
			TableRow buttonRow = new TableRow ();
			TableCell buttonCell = new TableCell ();
			CreateButtonBar (buttonCell);
			buttonRow.Cells.Add (buttonCell);
			wizardTable.Rows.Add (buttonRow);
			
			if (DisplaySideBar && ActiveStep.StepType != WizardStepType.Complete) {
				Table contentTable = wizardTable;
				contentTable.Height = new Unit ("100%");
				
				wizardTable = new Table ();
				wizardTable.CellPadding = CellPadding; 
				wizardTable.CellSpacing = CellSpacing;
				TableRow row = new TableRow ();
				
				TableCell sideBarCell = new TableCell ();
				CreateSideBar (sideBarCell);
				row.Cells.Add (sideBarCell);
				
				TableCell contentCell = new TableCell ();
				contentCell.Controls.Add (contentTable);
				row.Cells.Add (contentCell);
				
				wizardTable.Rows.Add (row);
			}
			
			Controls.SetReadonly (false);
			Controls.Add (wizardTable);
			Controls.SetReadonly (true);
		}
Esempio n. 10
0
		internal void UpdateViews ()
		{
			multiView = null;
			UpdateControls ();
		}
        private void CreateFieldsInTabs(Control container)
        {
            Fields = new System.Collections.Hashtable();

            // create a tabstrip with the categories
            _TabStrip = new SCSWeb.TabStrip();

            #if VERSION4
            _TabStrip.ViewStateMode = ViewStateMode.Enabled;
            #endif

            _TabStrip.TabItemClicked += new SCSWeb.TabStrip.ItemClickedHandler(TabStrip_TabItemClicked);
            container.Controls.Add(_TabStrip);

            // create a multiview to store the tab contents
            _TabMultiView = new MultiView();
            container.Controls.Add(_TabMultiView);

            // collect list of categories from the columns
            ListOfTabs = "Main";
            foreach (DataColumn dc in _dccol)
                if (ListOfTabs.IndexOf(dc.Namespace) < 0)
                    ListOfTabs = string.Format("{0},{1}", ListOfTabs, dc.Namespace);

            // create menu items as tabs
            string[] strTabs = ListOfTabs.Split(',');
            //_Tabs = new List<View>(strTabs.Length);

            foreach (string strCategory in strTabs)
            {
                // add tab to tabstrip
                SCSWeb.TabItem objTab = new SCSWeb.TabItem();
                objTab.Text = strCategory;
                objTab.Tag = strCategory;
                _TabStrip.Items.Add(objTab);

                // add corresponding view
                View objTabView = new View();
                objTabView.ID = strCategory;
                //_Tabs.Add(objTabView);
                _TabMultiView.Controls.Add(objTabView);

                // create a table within the view
                Table tbl = new Table();
                tbl.CssClass = CssClassTable;
                TableRow tr = null;
                TableCell td = null;

                objTabView.Controls.Add(tbl);

                int iColNbr = 0;
                foreach (DataColumn dc in _dccol)
                {
                    if (dc.ColumnName != null && dc.Namespace == strCategory )
                    {
                        iColNbr++;
                        // if there are more than the given nbr of rows, start adding columns instead of rows
                        // making the formview grow sideways instead of downward
                        if (iColNbr > NbrRows)
                            // add columns starting from first row on
                            tr = tbl.Rows[ ( iColNbr - 1 ) % NbrRows ];
                        else
                        {
                            tr = new TableRow();
                            tr.BorderWidth = Unit.Pixel(0);
                            tr.VerticalAlign = VerticalAlign.Top;
                            tbl.Rows.Add(tr);
                        }

                        // for each DataColum create a TableRow with 2 cells
                        td = new TableCell();
                        td.Wrap = false;
                        tr.Cells.Add(td);

                        td.Text = FormatColumnName(dc.ColumnName) + ":";
                        td.CssClass = CssClassTableCell;

                        td = new TableCell();
                        td.Wrap = false;
                        tr.Cells.Add(td);

                        CreateColumnControl(td, dc);
                    }
                }
            }

            // make the first tab selected
            _TabStrip.Items[0].Selected = true;
            _TabMultiView.SetActiveView(_TabMultiView.Views[0]);

            if (_type == ListItemType.Item)
            {
                LinkButton lnkEdit = new LinkButton();
                lnkEdit.Text = "Edit";
                lnkEdit.ToolTip = "Click here to turn on the EditItemTemplate of the FormView";
                lnkEdit.CommandName = "Edit";
                container.Controls.Add(lnkEdit);
            }
            else
            {
                // create a table to hold the link buttons
                Table tbl = new Table();
                tbl.CssClass = CssClassTable;
                TableRow tr = new TableRow();
                TableCell td = new TableCell();

                LinkButton lnkButton = new LinkButton();
                lnkButton.Text = "Cancel";
                lnkButton.ToolTip = "Click here to cancel the Edit process";
                lnkButton.CommandName = "Cancel";
                lnkButton.CausesValidation = false;
                td.Controls.Add(lnkButton);
                tr.Controls.Add(td);

                td = new TableCell();
                lnkButton = new LinkButton();
                lnkButton.Text = "Update";
                lnkButton.ToolTip = "Click here to update the record";
                lnkButton.CommandName = "Update";
                lnkButton.CausesValidation = false;
                td.Controls.Add(lnkButton);
                tr.Controls.Add(td);

                tbl.Controls.Add(tr);
                container.Controls.Add(tbl);
            }
        }
Esempio n. 12
0
        public void CreateChildControls()
        {
            #region Create Child Controls
            WebMultiViewCaptions webMultiViewCaptions = new WebMultiViewCaptions();
            webMultiViewCaptions.ID = "webMultiViewCaptions";
            webMultiViewCaptions.MultiViewID = MULTIVIEW;
            webMultiViewCaptions.TableStyle = WebMultiViewCaptionStyle.Style3;
            webMultiViewCaptions.CssClass = "eReport_multiViewCaption";
            string[] caption = new string[] { "Header", "Field", "Footer", "Setting" };
            foreach (string str in caption)
            {
                WebMultiViewCaption viewcaption = new WebMultiViewCaption();
                viewcaption.Caption = str;
                webMultiViewCaptions.Captions.Add(viewcaption);
            }
            this.report.Controls.Add(webMultiViewCaptions);

            MultiView multiview = new MultiView();
            multiview.ID = MULTIVIEW;
            //multiview
            multiview.Views.Add(CreateItemView(HEADER));
            multiview.Views.Add(CreateFieldView());
            multiview.Views.Add(CreateItemView(FOOTER));
            multiview.Views.Add(CreateSettingView());
            this.report.Controls.Add(multiview);
            multiview.ActiveViewIndex = ViewNum.HeaderItemView;

            Table tableButtons = CreateTable(1, 4, null, null);

            Button buttonLoad = new Button();
            buttonLoad.CssClass = "eReport_button eReport_normal_button";
            buttonLoad.Text = ERptMultiLanguage.GetLanValue("MenuReadTemplate");
            buttonLoad.ID = BUTTON_TEMPLATE_LOAD;
            buttonLoad.Click += new EventHandler(buttonLoad_Click);
            //this.report.Controls.Add(buttonLoad);
            tableButtons.Rows[0].Cells[0].Controls.Add(buttonLoad);

            Button buttonSave = new Button();
            buttonSave.CssClass = "eReport_button eReport_normal_button";
            buttonSave.Text = ERptMultiLanguage.GetLanValue("MenuSaveTemplate");
            buttonSave.Click += new EventHandler(buttonSave_Click);
            //this.report.Controls.Add(buttonSave);
            tableButtons.Rows[0].Cells[1].Controls.Add(buttonSave);

            //Button buttonSaveAs = new Button();
            //buttonSaveAs.CssClass = "eReport_button eReport_normal_button";
            //buttonSaveAs.Text = ERptMultiLanguage.GetLanValue("MenuSaveAsTemplate");
            //buttonSaveAs.Click += new EventHandler(buttonSaveAs_Click);
            //buttonSaveAs.Visible = false;
            //this.report.Controls.Add(buttonSaveAs);

            Button buttonExport = new Button();
            buttonExport.ID = "buttonExport";
            buttonExport.CssClass = "eReport_button eReport_normal_button";
            buttonExport.Text = ERptMultiLanguage.GetLanValue("btExport");
            buttonExport.Click += new EventHandler(buttonExport_Click);
            //this.report.Controls.Add(buttonExport);
            tableButtons.Rows[0].Cells[2].Controls.Add(buttonExport);

            Button buttonClose = new Button();
            buttonClose.ID = "buttonClose";
            buttonClose.CssClass = "eReport_button eReport_normal_button";
            buttonClose.Text = ERptMultiLanguage.GetLanValue("btClose");
            buttonClose.Click += new EventHandler(buttonClose_Click);
            //this.report.Controls.Add(buttonClose);
            tableButtons.Rows[0].Cells[3].Controls.Add(buttonClose);
            this.report.Controls.Add(tableButtons);

            UpdatePanel panel = AspNetScriptsProvider.GetUpdatePanel(this.report) as UpdatePanel;
            if (panel != null)
            {
                string buttonID = GetUpdatePanelControlID(buttonExport);
                PostBackTrigger triger = null;
                foreach (UpdatePanelTrigger trig in panel.Triggers)
                {
                    if (trig is PostBackTrigger && (trig as PostBackTrigger).ControlID == buttonID)
                    {
                        triger = trig as PostBackTrigger;
                        break;
                    }
                }
                if (triger == null)
                {
                    triger = new PostBackTrigger();
                    triger.ControlID = buttonID;
                    panel.Triggers.Add(triger);
                }
            }
            #endregion

            #region Template View
            Panel templatePanel = new Panel();
            templatePanel.ID = PANEL_DATABASE;
            templatePanel.Style.Add(HtmlTextWriterStyle.Display, "none");
            templatePanel.Controls.Add(CreateDataBaseView());

            Button popupButton = new Button();
            popupButton.ID = BUTTON_POPUP_TEMPLATE;
            popupButton.Style.Add(HtmlTextWriterStyle.Display, "none");
            this.report.Controls.Add(popupButton);
            this.report.Controls.Add(templatePanel);
            ModalPopupExtender modelPopupExtender = new ModalPopupExtender();
            modelPopupExtender.ID = MODEL_POPUP_EXTENDER_TEMPLATE_LOAD;
            modelPopupExtender.TargetControlID = BUTTON_POPUP_TEMPLATE;
            modelPopupExtender.PopupControlID = templatePanel.ID;
            modelPopupExtender.CancelControlID = BUTTON_TEMPLATE_CANCEL;
            //modelPopupExtender.OkControlID = BUTTON_TEMPLATE_OK;
            modelPopupExtender.BackgroundCssClass = WebEasilyReportCSS.ModelBackground;
            //  modelPopupExtender.Drag = WebEasilyReportConfig.ModelPanelDrag;
            //modelPopupExtender.Hide();
            this.report.Controls.Add(modelPopupExtender);
            #endregion

            #region Font View
            Panel fontPanel = new Panel();
            fontPanel.ID = PANEL_FONT;
            fontPanel.Style.Add(HtmlTextWriterStyle.Display, "none");
            fontPanel.Controls.Add(CreateFontView());

            Button popupFontButton = new Button();
            popupFontButton.ID = BUTTON_POPUP_FONTVIEW;
            popupFontButton.Style.Add(HtmlTextWriterStyle.Display, "none");
            this.report.Controls.Add(popupFontButton);
            this.report.Controls.Add(fontPanel);
            ModalPopupExtender modelPopupExtenderFontView = new ModalPopupExtender();
            modelPopupExtenderFontView.ID = MODEL_POPUP_EXTENDER_FONTVIEW;
            modelPopupExtenderFontView.TargetControlID = BUTTON_POPUP_FONTVIEW;
            modelPopupExtenderFontView.PopupControlID = fontPanel.ID;
            modelPopupExtenderFontView.CancelControlID = BUTTON_FONT_CANCEL;
            modelPopupExtenderFontView.BackgroundCssClass = WebEasilyReportCSS.ModelBackground;
            //  modelPopupExtenderFontView.Drag = WebEasilyReportConfig.ModelPanelDrag;
            this.report.Controls.Add(modelPopupExtenderFontView);
            #endregion

            #region Save As View
            Panel saveAsPanel = new Panel();
            saveAsPanel.ID = PANEL_SAVE_AS;
            saveAsPanel.Style.Add(HtmlTextWriterStyle.Display, "none");
            saveAsPanel.Controls.Add(CreateSaveAsView());

            Button popupSaveAsButton = new Button();
            popupSaveAsButton.ID = BUTTON_POPUP_SAVEASVIEW;
            popupSaveAsButton.Style.Add(HtmlTextWriterStyle.Display, "none");
            this.report.Controls.Add(popupSaveAsButton);
            this.report.Controls.Add(saveAsPanel);
            ModalPopupExtender modelPopupExtenderSaveAsView = new ModalPopupExtender();
            modelPopupExtenderSaveAsView.ID = MODEL_POPUP_EXTENDER_SAVEASVIEW;
            modelPopupExtenderSaveAsView.TargetControlID = BUTTON_POPUP_SAVEASVIEW;
            modelPopupExtenderSaveAsView.PopupControlID = saveAsPanel.ID;
            modelPopupExtenderSaveAsView.CancelControlID = BUTTON_SAVEAS_TEMPLATE_CANCEL;
            modelPopupExtenderSaveAsView.BackgroundCssClass = WebEasilyReportCSS.ModelBackground;
            //  modelPopupExtenderSaveAsView.Drag = WebEasilyReportConfig.ModelPanelDrag;
            this.report.Controls.Add(modelPopupExtenderSaveAsView);
            #endregion

            #region Picture View
            Panel picturePanel = new Panel();

            picturePanel.ID = PANEL_PICTURE_VIEW;
            picturePanel.Style.Add(HtmlTextWriterStyle.Display, "none");
            picturePanel.Controls.Add(CreatePicutreView());

            Button popupPictureButton = new Button();
            popupPictureButton.ID = BUTTON_POPUP_PICTUREVIEW;
            popupPictureButton.Style.Add(HtmlTextWriterStyle.Display, "none");

            this.report.Controls.Add(popupPictureButton);
            this.report.Controls.Add(picturePanel);
            ModalPopupExtender modelPopupExtenderPictureView = new ModalPopupExtender();
            modelPopupExtenderPictureView.ID = MODEL_POPUP_EXTENDER_PICTUREVIEW;
            modelPopupExtenderPictureView.TargetControlID = BUTTON_POPUP_PICTUREVIEW;
            modelPopupExtenderPictureView.PopupControlID = picturePanel.ID;
            modelPopupExtenderPictureView.CancelControlID = BUTTON_PICTURE_CANCEL;
            modelPopupExtenderPictureView.BackgroundCssClass = WebEasilyReportCSS.ModelBackground;
            // modelPopupExtenderPictureView.Drag = WebEasilyReportConfig.ModelPanelDrag;
            this.report.Controls.Add(modelPopupExtenderPictureView);
            #endregion

            #region Download View
            Panel downloadPanel = new Panel();

            downloadPanel.ID = PANEL_DOWNLOAD_VIEW;
            downloadPanel.Style.Add(HtmlTextWriterStyle.Display, "none");
            downloadPanel.Controls.Add(CreateOutputView());

            Button popupDownloadButton = new Button();
            popupDownloadButton.ID = BUTTON_POPUP_DOWNLOADVIEW;
            popupDownloadButton.Style.Add(HtmlTextWriterStyle.Display, "none");

            this.report.Controls.Add(popupDownloadButton);
            this.report.Controls.Add(downloadPanel);
            ModalPopupExtender modelPopupExtenderDownloadView = new ModalPopupExtender();
            modelPopupExtenderDownloadView.ID = MODEL_POPUP_EXTENDER_DOWNLOADVIEW;
            modelPopupExtenderDownloadView.TargetControlID = BUTTON_POPUP_DOWNLOADVIEW;
            modelPopupExtenderDownloadView.PopupControlID = downloadPanel.ID;
            //modelPopupExtenderDownloadView.CancelControlID = BUTTON_CLOSE_DOWNLOADVIEW;
            modelPopupExtenderDownloadView.BackgroundCssClass = WebEasilyReportCSS.ModelBackground;
            //  modelPopupExtenderDownloadView.Drag = WebEasilyReportConfig.ModelPanelDrag;
            this.report.Controls.Add(modelPopupExtenderDownloadView);
            #endregion
        }
Esempio n. 13
0
 private Control CreateOutputView()
 {
     MultiView multiViewOutput = new MultiView();
     multiViewOutput.ID = MULTIVIEW_OUTPUTVIEW;
     multiViewOutput.Controls.Add((View)CreateProgressView());
     multiViewOutput.Controls.Add((View)CreateDownLoadView());
     multiViewOutput.Controls.Add((View)CreateSendMailView());
     return multiViewOutput;
 }
Esempio n. 14
0
        private View CreateFieldView()
        {
            View view = new View();
            Table table1 = CreateTable(1, 2, "eReportBase_table",
                new CellCssClass[] {
                    new CellCssClass(0, 1, "eReport_topleft")
                });//1��2��
            Table table2 = CreateTable(6, 1, "", null);//4��1��
            Table table3 = CreateTable(26, 1, "eReportPart_table eReportFullWidth_table", null);//21��1��
            Table table4 = CreateTable(9, 1, "eReportPart_table eReportFullWidth_table", null);//9��1��
            Table table5 = CreateTable(1, 4, "eReportPart_table eReportFullWidth_table", null);//1��3��

            #region table1
            view.Controls.Add(table1);
            table1.Rows[0].Cells[0].Controls.Add(table2);
            table1.Rows[0].Cells[0].VerticalAlign = VerticalAlign.Top;
            MultiView multiviewColumnsContent = new MultiView();
            multiviewColumnsContent.ID = MULTIVIEW_FIELD_CONTENT;
            View view1 = new View();
            view1.Controls.Add(table3);
            multiviewColumnsContent.Views.Add(view1);
            View view2 = new View();
            view2.Controls.Add(table4);
            multiviewColumnsContent.Views.Add(view2);
            table1.Rows[0].Cells[1].Controls.Add(multiviewColumnsContent);

            #endregion

            #region table2

            Label labelStyleSetting = new Label();
            labelStyleSetting.Text = ERptMultiLanguage.GetLanValue("gbStyleSetting");
            table2.Rows[0].Cells[0].Controls.Add(labelStyleSetting);
            table2.Rows[0].Cells[0].VerticalAlign = VerticalAlign.Top;
            table2.Rows[1].Cells[0].Controls.Add(table5);

            //WebMultiViewCaptions webMultiViewCaptions = new WebMultiViewCaptions();
            //webMultiViewCaptions.CssClass = "eReport_multiViewCaption";
            //webMultiViewCaptions.MultiViewID = MULTIVIEW_FIELD;
            //webMultiViewCaptions.TableStyle = WebMultiViewCaptionStyle.Style3;
            //string[] caption = new string[] { "Columns" };
            //foreach (string str in caption)
            //{
            //    WebMultiViewCaption viewcaption = new WebMultiViewCaption();
            //    viewcaption.Caption = str;
            //    webMultiViewCaptions.Captions.Add(viewcaption);
            //}
            //webMultiViewCaptions.TabChanged += new TabChangedEventHandler(webMultiViewCaptions_TabChanged);
            //table2.Rows[2].Cells[0].Controls.Add(webMultiViewCaptions);

            DropDownList dropdownlistField = new DropDownList();
            dropdownlistField.ID = DROPDOWNLIST_FIELD;
            dropdownlistField.SelectedIndexChanged += new EventHandler(dropdownlistField_SelectedIndexChanged);
            dropdownlistField.Width = new Unit(125);
            table2.Rows[2].Cells[0].Controls.Add(dropdownlistField);

            MultiView multiviewColumns = new MultiView();
            multiviewColumns.ID = MULTIVIEW_FIELD;
            multiviewColumns.Views.Add(CreateColumnView(string.Empty));
            multiviewColumns.ActiveViewIndex = 0;
            // multiviewColumns.Views.Add(CreateColumnView(GROUP));
            table2.Rows[2].Cells[0].Controls.Add(multiviewColumns);

            //add group total
            Label labelFieldCaptionStyle = new Label();
            labelFieldCaptionStyle.Text = ERptMultiLanguage.GetLanValue("lbCaptionStyle");
            table2.Rows[3].Cells[0].Controls.Add(labelFieldCaptionStyle);

            DropDownList dropdownlistFieldCaptionStyle = new DropDownList();
            dropdownlistFieldCaptionStyle.ID = DROPDOWNLIST_CAPTION_STYLE;
            dropdownlistFieldCaptionStyle.Width = new Unit(125);
            foreach (object item in Enum.GetValues(typeof(DataSourceItem.CaptionStyleType)))
            {
                dropdownlistFieldCaptionStyle.Items.Add(item.ToString());
            }
            table2.Rows[3].Cells[0].Controls.Add(dropdownlistFieldCaptionStyle);

            CheckBox checkboxFieldGroupTotal = new CheckBox();
            checkboxFieldGroupTotal.ID = CHECKBOX_FIELD_GROUP_TOTAL;
            checkboxFieldGroupTotal.Text = ERptMultiLanguage.GetLanValue("cbGroupTotal");
            table2.Rows[4].Cells[0].Controls.Add(checkboxFieldGroupTotal);

            Label labelFieldGroupGap = new Label();
            labelFieldGroupGap.Text = ERptMultiLanguage.GetLanValue("lbGroupGap");
            table2.Rows[5].Cells[0].Controls.Add(labelFieldGroupGap);
            DropDownList dropdownlistFieldGroupGap = new DropDownList();
            dropdownlistFieldGroupGap.Width = new Unit(125);
            dropdownlistFieldGroupGap.ID = DROPDOWNLIST_FIELD_GROUP_GAP;
            foreach (object item in Enum.GetValues(typeof(DataSourceItem.GroupGapType)))
            {
                dropdownlistFieldGroupGap.Items.Add(item.ToString());
            }
            table2.Rows[5].Cells[0].Controls.Add(dropdownlistFieldGroupGap);

            #endregion

            #region table3
            Label labelFieldCaption = new Label();
            labelFieldCaption.Text = ERptMultiLanguage.GetLanValue("lbColumnCaption");
            table3.Rows[0].Cells[0].Controls.Add(labelFieldCaption);
            TextBox textboxFieldCaption = new TextBox();
            textboxFieldCaption.Width = new Unit(120);
            textboxFieldCaption.TextMode = TextBoxMode.MultiLine;
            textboxFieldCaption.ID = "textboxFieldCaption";
            table3.Rows[1].Cells[0].Controls.Add(textboxFieldCaption);
            Label labelFieldCaptionAlignment = new Label();
            labelFieldCaptionAlignment.Text = ERptMultiLanguage.GetLanValue("lbCaptionAlignment");
            table3.Rows[2].Cells[0].Controls.Add(labelFieldCaptionAlignment);
            DropDownList dropdownlistFieldCaptionAligment = new DropDownList();
            dropdownlistFieldCaptionAligment.Width = new Unit(125);
            dropdownlistFieldCaptionAligment.ID = DROPDOWNLIST_FIELD_CAPTION_ALIGNMENT;
            foreach (object item in Enum.GetValues(typeof(System.Windows.Forms.HorizontalAlignment)))
            {
                dropdownlistFieldCaptionAligment.Items.Add(item.ToString());
            }
            table3.Rows[3].Cells[0].Controls.Add(dropdownlistFieldCaptionAligment);
            Label labelFieldColumnAlignment = new Label();
            labelFieldColumnAlignment.Text = ERptMultiLanguage.GetLanValue("lbColumnAlignment");
            table3.Rows[4].Cells[0].Controls.Add(labelFieldColumnAlignment);
            DropDownList dropdownlistFieldColumnAligment = new DropDownList();
            dropdownlistFieldColumnAligment.Width = new Unit(125);
            dropdownlistFieldColumnAligment.ID = DROPDOWNLIST_FIELD_COLUMN_ALIGNMENT;
            foreach (object item in Enum.GetValues(typeof(System.Windows.Forms.HorizontalAlignment)))
            {
                dropdownlistFieldColumnAligment.Items.Add(item.ToString());
            }
            table3.Rows[5].Cells[0].Controls.Add(dropdownlistFieldColumnAligment);
            Label labelFieldWidth = new Label();
            labelFieldWidth.Text = ERptMultiLanguage.GetLanValue("lbWidth");
            table3.Rows[6].Cells[0].Controls.Add(labelFieldWidth);
            TextBox textboxFieldWidth = new TextBox();
            textboxFieldWidth.Width = new Unit(120);
            textboxFieldWidth.ID = TEXTBOX_FIELD_WIDTH;
            table3.Rows[7].Cells[0].Controls.Add(textboxFieldWidth);

            //Format
            Label labelFieldFormat = new Label();
            labelFieldFormat.Text = ERptMultiLanguage.GetLanValue("lbFormat");
            table3.Rows[8].Cells[0].Controls.Add(labelFieldFormat);
            TextBox textboxFieldFormat = new TextBox();
            textboxFieldFormat.Width = new Unit(120);
            textboxFieldFormat.ID = TEXTBOX_FIELD_FORMAT;
            table3.Rows[9].Cells[0].Controls.Add(textboxFieldFormat);

            CheckBox checkFieldNewLine = new CheckBox();
            checkFieldNewLine.ID = CHECKBOX_FIELD_NEWLINE;
            checkFieldNewLine.Text = ERptMultiLanguage.GetLanValue("cbNewLine");
            table3.Rows[10].Cells[0].Controls.Add(checkFieldNewLine);
            Label labelFieldNewlinePosition = new Label();
            labelFieldNewlinePosition.Text = ERptMultiLanguage.GetLanValue("lbNewLinePosition");
            table3.Rows[11].Cells[0].Controls.Add(labelFieldNewlinePosition);
            TextBox textboxFieldNewlinePosition = new TextBox();
            textboxFieldNewlinePosition.Width = new Unit(120);
            textboxFieldNewlinePosition.ID = TEXTBOX_FIELD_NEWLINE_POSITION;
            table3.Rows[12].Cells[0].Controls.Add(textboxFieldNewlinePosition);

            Label labelFieldCells = new Label();
            labelFieldCells.Text = ERptMultiLanguage.GetLanValue("lbCells");
            table3.Rows[13].Cells[0].Controls.Add(labelFieldCells);
            TextBox textBoxFieldCells = new TextBox();
            textBoxFieldCells.Width = new Unit(120);
            textBoxFieldCells.ID = TEXTBOX_FIELD_CELLS;
            table3.Rows[14].Cells[0].Controls.Add(textBoxFieldCells);

            Label labelFieldOrderby = new Label();
            labelFieldOrderby.Text = ERptMultiLanguage.GetLanValue("lbOrderType");
            //set text
            table3.Rows[15].Cells[0].Controls.Add(labelFieldOrderby);
            DropDownList dropdownlistFieldOrderby = new DropDownList();
            dropdownlistFieldOrderby.Width = new Unit(125);
            dropdownlistFieldOrderby.ID = DROPDOWNLIST_FIELD_ORDERBY;
            foreach (object item in Enum.GetValues(typeof(FieldItem.OrderType)))
            {
                dropdownlistFieldOrderby.Items.Add(item.ToString());
            }
            table3.Rows[16].Cells[0].Controls.Add(dropdownlistFieldOrderby);

            CheckBox checkboxFieldSuppressIfDuplicated = new CheckBox();
            checkboxFieldSuppressIfDuplicated.ID = CHECKBOX_FIELD_SUPPRESSIFDUPLICATED;
            checkboxFieldSuppressIfDuplicated.Text = ERptMultiLanguage.GetLanValue("cbSuppressIfDuplicated");
            table3.Rows[17].Cells[0].Controls.Add(checkboxFieldSuppressIfDuplicated);

            Label labelFieldGroupType = new Label();
            labelFieldGroupType.Text = ERptMultiLanguage.GetLanValue("lbGroupType");
            table3.Rows[18].Cells[0].Controls.Add(labelFieldGroupType);
            DropDownList dropdownlistFieldGroupType = new DropDownList();
            dropdownlistFieldGroupType.Width = new Unit(125);
            dropdownlistFieldGroupType.ID = DROPDOWNLIST_FIELD_GROUP_TYPE;
            foreach (object item in Enum.GetValues(typeof(FieldItem.GroupType)))
            {
                dropdownlistFieldGroupType.Items.Add(item.ToString());
            }
            table3.Rows[19].Cells[0].Controls.Add(dropdownlistFieldGroupType);

            Label labelFieldGroupTotalCaption = new Label();
            labelFieldGroupTotalCaption.Text = ERptMultiLanguage.GetLanValue("lbGroupTotalCaption");
            table3.Rows[20].Cells[0].Controls.Add(labelFieldGroupTotalCaption);
            TextBox textboxFieldGroupTotalCaption = new TextBox();
            textboxFieldGroupTotalCaption.Width = new Unit(120);
            textboxFieldGroupTotalCaption.ID = TEXTBOX_FIELD_GROUP_TOTAL_CAPTION;
            table3.Rows[21].Cells[0].Controls.Add(textboxFieldGroupTotalCaption);

            Label labelFieldSumType = new Label();
            labelFieldSumType.Text = ERptMultiLanguage.GetLanValue("lbSumType");
            table3.Rows[22].Cells[0].Controls.Add(labelFieldSumType);
            DropDownList dropdownlistFieldSumType = new DropDownList();
            dropdownlistFieldSumType.Width = new Unit(125);
            dropdownlistFieldSumType.ID = DROPDOWNLIST_FIELD_SUM_TYPE;
            foreach (object item in Enum.GetValues(typeof(FieldItem.SumType)))
            {
                dropdownlistFieldSumType.Items.Add(item.ToString());
            }
            table3.Rows[23].Cells[0].Controls.Add(dropdownlistFieldSumType);
            Label labelFieldTotalCaption = new Label();
            labelFieldTotalCaption.Text = ERptMultiLanguage.GetLanValue("lbTotalCaption");
            table3.Rows[24].Cells[0].Controls.Add(labelFieldTotalCaption);
            TextBox textboxFieldTotalCaption = new TextBox();
            textboxFieldTotalCaption.Width = new Unit(120);
            textboxFieldTotalCaption.ID = TEXTBOX_FIELD_TOTAL_CAPTION;
            table3.Rows[25].Cells[0].Controls.Add(textboxFieldTotalCaption);

            #endregion

            #region table4

            #endregion

            #region table5
            Button buttonItemFont = new Button();
            buttonItemFont.CssClass = WebEasilyReportCSS.Button;
            buttonItemFont.ID = BUTTON_FIELD_FONT;
            buttonItemFont.Text = ERptMultiLanguage.GetLanValue("btFont");
            buttonItemFont.Click += new EventHandler(buttonFont_Click);
            table5.Rows[0].Cells[0].Controls.Add(buttonItemFont);

            Label labelSample = new Label();
            labelSample.ID = LABEL_FIELD_FONT_SAMPLE;
            labelSample.Text = EasilyReportConfig.FontSample;
            table5.Rows[0].Cells[0].Controls.Add(labelSample);

            CheckBox cbxColumnGrid = new CheckBox();
            cbxColumnGrid.ID = CHECKBOX_COLUMNGRID;
            cbxColumnGrid.Text = ERptMultiLanguage.GetLanValue("cbColumnGridLine");
            table5.Rows[0].Cells[1].Controls.Add(cbxColumnGrid);

            CheckBox cbxInnerColumnGrid = new CheckBox();
            cbxInnerColumnGrid.ID = CHECKBOX_INNER_COLUMNGRID;
            cbxInnerColumnGrid.Text = ERptMultiLanguage.GetLanValue("cbColumnInsideLine");
            table5.Rows[0].Cells[2].Controls.Add(cbxInnerColumnGrid);

            CheckBox cbxRowGrid = new CheckBox();
            cbxRowGrid.ID = CHECKBOX_ROWGRID;
            cbxRowGrid.Text = ERptMultiLanguage.GetLanValue("cbRowGridLine");
            table5.Rows[0].Cells[3].Controls.Add(cbxRowGrid);

            #endregion

            return view;
        }