Example #1
0
	    public void Insert(int Formid,int? Personid,bool? Deleted,DateTime? Createdon,DateTime? Modifiedon,string Createdby,string Modifiedby)
	    {
		    Formfile item = new Formfile();
		    
            item.Formid = Formid;
            
            item.Personid = Personid;
            
            item.Deleted = Deleted;
            
            item.Createdon = Createdon;
            
            item.Modifiedon = Modifiedon;
            
            item.Createdby = Createdby;
            
            item.Modifiedby = Modifiedby;
            
	    
		    item.Save(UserName);
	    }
Example #2
0
        public EditableFile(Formfile formFile)
            :base(formFile)
        {
            //pre-populate all the fields, along with any existing records
            FormfieldCollection allFields = new FormfieldCollection().Where(Formfield.Columns.Formid, this.SymanticForm.Form.Id).Load();

            this.relatedFields = new List<EditableField>();
            for (int i = 0; i < allFields.Count; i++)
			{                
                Formrecord candidateRecord = this.FormFile.Formrecords().FirstOrDefault<Formrecord>(record => record.Fieldid == allFields[i].Id);
                EditableField field;
                if (candidateRecord != null)
                    field = new EditableField(candidateRecord);
                else
                    field = new EditableField(allFields[i]);
                field.FieldStoringCallback += new EventHandler<EditableFieldStoringCallbackArgs>(HandleEditableFieldStoring);
                this.relatedFields.Add(field);
			}

            /// Sort the fields in field order
            this.relatedFields = this.relatedFields.OrderBy(field => field.Metadata.FieldOrder).ToList();
        }
Example #3
0
	    public void Update(int Id,int Formid,int? Personid,bool? Deleted,DateTime? Createdon,DateTime? Modifiedon,string Createdby,string Modifiedby)
	    {
		    Formfile item = new Formfile();
	        item.MarkOld();
	        item.IsLoaded = true;
		    
			item.Id = Id;
				
			item.Formid = Formid;
				
			item.Personid = Personid;
				
			item.Deleted = Deleted;
				
			item.Createdon = Createdon;
				
			item.Modifiedon = Modifiedon;
				
			item.Createdby = Createdby;
				
			item.Modifiedby = Modifiedby;
				
	        item.Save(UserName);
	    }
Example #4
0
        public SymanticFile(Formfile formFile)
            : this(formFile, new SymanticForm(formFile.Form))
        {

        }
Example #5
0
 public SymanticFile(Formfile formFile, SymanticForm form)
 {
     this.SymanticForm = form;
     this.FormFile = formFile;
 }
Example #6
0
 public ViewableFile(Formfile encapsulatedFormFile)
     :base(encapsulatedFormFile)
 {
     
 }
Example #7
0
 internal void EncapsulateFormFile(Formfile encapsulatedFormFile)
 {
     this.FormFile = encapsulatedFormFile;
     this.SymanticForm = new SymanticForm(encapsulatedFormFile.Form);
 }
Example #8
0
 public bool Destroy(object Id)
 {
     return (Formfile.Destroy(Id) == 1);
 }
Example #9
0
 public bool Delete(object Id)
 {
     return (Formfile.Delete(Id) == 1);
 }
Example #10
0
 /// <summary>
 /// Creates a new file frecords for this form without a specified person.
 /// </summary>
 public Formfile CreateFile()
 {
     Formfile file = new Formfile();
     file.Form = this.Form;
     file.Save(Utility.GetActiveUsername());
     this.LoadFile(file.Id);
     return file;
 }
Example #11
0
 /// <summary>
 /// Creates a file record for the specified person.
 /// </summary>
 public Formfile CreateFile(Person person)
 {
     if (this.HasFile(person))
         throw new NotSupportedException("A file already exists for the person");
     Formfile file = new Formfile();
     file.Form = this.Form;
     file.Person = person;
     file.Save(Utility.GetActiveUsername());
     this.LoadFile(file.Id);
     return file;
 }