Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            fileType = this.Request.Params["filetype"];

            bool newfile = !(int.TryParse(this.Request.Params["file"], out _fileid));

            if (!bool.TryParse(this.Request.Params["newFile"], out _isNewFileRequestParam))
                _isNewFileRequestParam = false;

            int formid = int.Parse(this.Request.Params["form"]);

            this.controller = new FormFileController(formid);

            if (newfile)
            {
                Formfile file = this.controller.CreateFile();
                // redirect to the correct page
                Response.Redirect(string.Format("Editor.aspx?file={0}&form={1}&fileType={2}&newFile=true", file.Id, formid, fileType));
            }
            else
                this.controller.LoadFile(_fileid);

            if (!this.IsPostBack)
                this.EditForm.EditableForm = this.controller.EditableForm;
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TFS.OpCenter.Data.Form form = TFS.OpCenter.Data.Form.FetchByID(103);
            if (form == null)
                throw new Exception("Form is null");
            Person person = Utility.GetActivePerson();
            controller = new FormFileController(form);
            if (!controller.HasFile(person))
                controller.CreateFile(person);
            controller.LoadFile(person);
            
            if (!this.IsPostBack)
                this.EditForm.EditableForm = this.controller.EditableForm;

        }