Beispiel #1
0
        /// <summary>
        /// Loads a specific File. Returns null if the file doesn't exist
        /// </summary>
        public static ViewableFile GetFile(int id)
        {
            Formfile     formFile = Formfile.FetchByID(id);
            ViewableFile file     = null;

            if (formFile != null)
            {
                file = new ViewableFile(formFile);
            }
            else
            {
                throw new Exception("File doesn't exist");
            }
            return(file);
        }
 /// <summary>
 /// Loads a particular file for this form by it's ID
 /// </summary>
 /// <param name="id"></param>
 public void LoadFile(int id)
 {
     this.file = Formfile.FetchByID(id);
     if (this.file.IsNew)
     {
         this.file = null;
     }
     if (this.file.Formid != this.Form.Id)
     {
         this.file = null;
     }
     if (this.file != null)
     {
         this.FileLoaded = true;
     }
 }