Ejemplo n.º 1
0
        private OFormResultRecord SaveFormToDB(OFormPart form, Dictionary<string, string> postData, HttpFileCollectionBase files, string ipSubmiter)
        {
            var xdoc = ConvertToXDocument(postData);
            var resultRecord = new OFormResultRecord
            {
                Xml = xdoc.ToString(),
                CreatedDate = DateTime.UtcNow,
                Ip = ipSubmiter,
                CreatedBy = postData[OFormGlobals.CreatedByKey]
            };

            if (form.CanUploadFiles && files.Count > 0)
            {
                foreach (string key in files.Keys)
                {
                    if (files[key].ContentLength == 0) { continue; }

                    CheckFileSize(form, files[key]);
                    CheckFileType(form, files[key]);

                    var formFile = SaveFile(key, files[key]);
                    resultRecord.AddFile(formFile);
                }
            }

            this._resultRepo.Create(resultRecord);
            form.Record.AddFormResult(resultRecord);
            _contentManager.Flush();

            return resultRecord;
        }
Ejemplo n.º 2
0
 public virtual void AddFormResult(OFormResultRecord resultRecord)
 {
     resultRecord.OFormPartRecord = this;
     FormResults.Add(resultRecord);
 }