public void Insert(ID formId, AdaptedResultList fields, ID sessionID, string data) { Assert.ArgumentNotNull(formId, "formId"); Assert.ArgumentNotNull(fields, "fields"); Infrastructure.Data.Form form = _formFactory.Create(formId, fields, sessionID, data); using (WebFormForMarketersDataContext webFormForMarketersDataContext = new WebFormForMarketersDataContext(ConnectionString)) { webFormForMarketersDataContext.Forms.InsertOnSubmit(form); webFormForMarketersDataContext.SubmitChanges(); } }
public DateTime OldestFormSubmission(ID formId) { var dt = DateTime.Now; using (WebFormForMarketersDataContext webFormForMarketersDataContext = new WebFormForMarketersDataContext(ConnectionString)) { var forms = webFormForMarketersDataContext.Forms.Where(f => f.FormItemId == formId.Guid); if (forms.Count() > 0) { dt = forms.Min(f => f.Timestamp); } } return(dt); }
public IEnumerable<IForm> Get(ID formId) { List<IForm> forms = new List<IForm>(); using (WebFormForMarketersDataContext webFormForMarketersDataContext = new WebFormForMarketersDataContext(ConnectionString)) { IQueryable<Infrastructure.Data.Form> dataForms = webFormForMarketersDataContext.Forms.Where(f => f.FormItemId == formId.Guid).OrderBy(f => f.Timestamp); foreach (Infrastructure.Data.Form dataForm in dataForms) { Model.Form form = _formFactory.Create(dataForm); if (form != null) forms.Add(form); } } return forms; }
public IEnumerable <IForm> Get(ID formId) { List <IForm> forms = new List <IForm>(); using (WebFormForMarketersDataContext webFormForMarketersDataContext = new WebFormForMarketersDataContext(ConnectionString)) { IQueryable <Infrastructure.Data.Form> dataForms = webFormForMarketersDataContext.Forms.Where(f => f.FormItemId == formId.Guid).OrderBy(f => f.Timestamp); foreach (Infrastructure.Data.Form dataForm in dataForms) { Model.Form form = _formFactory.Create(dataForm); if (form != null) { forms.Add(form); } } } return(forms); }
public DateTime OldestFormSubmission(ID formId) { var dt = DateTime.Now; using (WebFormForMarketersDataContext webFormForMarketersDataContext = new WebFormForMarketersDataContext(ConnectionString)) { var forms = webFormForMarketersDataContext.Forms.Where(f => f.FormItemId == formId.Guid); if (forms.Count() > 0) dt = forms.Min(f => f.Timestamp); } return dt; }