public FormEditor()
        {
            InitializeComponent();

            renderEngine = new FormRenderEngine(this);

            return;
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            Client.Core.Forms.Form entityForm = null;

            renderEngine = new FormRenderEngine(this, MercuryApplication, Session, SessionCachePrefix);

            if (!IsPostBack)
            {
                Int64 entityFormId = 0;

                if (Request.QueryString["EntityFormId"] != null)
                {
                    if (Int64.TryParse((String)Request.QueryString["EntityFormId"], out entityFormId))
                    {
                        entityForm = MercuryApplication.FormGetByEntityFormId(entityFormId);

                        if (entityForm == null)
                        {
                            entityFormId = 0;
                        }
                    }
                }

                else if (Request.QueryString["EntityFormSessionKey"] != null)
                {
                    entityForm = (Client.Core.Forms.Form)Session[((String)Request.QueryString["EntityFormSessionKey"])];

                    if (Request.QueryString["ForPrint"] != null)
                    {
                        Boolean forPrint = Convert.ToBoolean((String)Request.QueryString["ForPrint"]);

                        if (forPrint)
                        {
                            TelerikAjaxManager.ResponseScripts.Add("window.print (); window.close ();");
                        }
                    }
                }

                if (entityForm == null)
                {
                    Server.Transfer("/PermissionDenied.aspx"); return;
                }

                Page.Title = entityForm.Name;

                RenderForm(entityForm);
            }

            return;
        }