/// <summary> /// Import the given surveys into the DB /// </summary> public void ImportSurveys(NSurveyForm importSurveys, int userId, int folderId) { ISurvey survey = SurveyFactory.Create(); this.TurnOverPrimaryKeys(importSurveys); survey.ImportSurveys(importSurveys, userId, folderId); }
public SurveyController(ISurvey survey, ICommon common, ICustomer customer, IEmployee employee) { surveyContext = survey; commonContext = common; customerContext = customer; employeeContext = employee; }
public SurveyController(IPool pool, ILookUps lookUps, IForm form, ISurvey survey, IUser user) { _pool = pool; _lookUps = lookUps; _form = form; _survey = survey; _user = user; }
public ActionResult EmailSurvey([FromBody] EmailSurveyRequest req) { ISurvey emailSurvey = SurveyFactory.Build(SurveyTypes.EmailSurvey); var survey = _context.Survey.Find(req.SurveyId); emailSurvey.LoadSurvey(survey); emailSurvey.execute(); return Ok(); }
//Constructor public SurveyBusiness(IUser userDAL, ISurvey surveyDAL, IQuestion questionDAL, ITextAnswers textAnswerDAL, IOptionChoice optionChoiceDAL, IAnswers answerDAL, IInputType inputTypeDAL) { this.userDAL = userDAL; this.surveyDAL = surveyDAL; this.questionDAL = questionDAL; this.textAswersDAL = textAnswerDAL; this.optionChoiceDAL = optionChoiceDAL; this.answerDAL = answerDAL; this.inputTypeDAL = inputTypeDAL; }
public InstrumentDto MapToInstrumentDto(ISurvey instrument) { return(new InstrumentDto { Name = instrument.Name, ServerParkName = instrument.ServerPark, InstallDate = instrument.InstallDate, Status = instrument.Status, DataRecordCount = GetNumberOfDataRecords(instrument as ISurvey2) }); }
private void BackupSurvey(ISurvey survey, string localFolderPath, string bucketFolderPath) { _blaiseApi .WithConnection(_blaiseApi.DefaultConnection) .WithInstrument(survey.Name) .WithServerPark(survey.ServerPark) .Survey .ToPath(localFolderPath) .ToBucket(_configurationProvider.BucketName, bucketFolderPath) .Backup(); }
private static IConfiguration GetSurveyConfiguration(ISurvey survey) { var configuration = survey.Configuration.Configurations.FirstOrDefault(); if (configuration == null) { throw new NullReferenceException($"There was no configuration found for survey '{survey.Name}'"); } return configuration; }
public void Cast_ToISurvey_ReturnsNotNull() { // Arange var survey = new Survey(); // Act ISurvey cast = (ISurvey)survey; // Assert Assert.IsNotNull(cast); }
public SurveyPage(ISurvey survey) : base(null) { _survey = survey; _navigateBackCommand = new DelegateCommand ( _ => OnNavigateBack (), _ => OnCanExecuteNavigateBack ()); _submitPageCommand = new DelegateCommand ( _ => OnSubmitPage (), _ => OnCanExecuteSubmitPage ()); }
public InstrumentDto MapToInstrumentDto(ISurvey instrument) { return(new InstrumentDto { Name = instrument.Name, Id = instrument.InstrumentID, ServerParkName = instrument.ServerPark, InstallDate = instrument.InstallDate, Status = _statusMapper.GetInstrumentStatus(instrument).ToString(), DataRecordCount = GetNumberOfDataRecords(instrument as ISurvey2), Nodes = _nodeDtoMapper.MapToInstrumentNodeDtos(instrument.Configuration) }); }
public TestsController(IQMaster question, ISurvey survey, IAMaster answerOptions, IResult results, ISeedService seedService, IQuestion demoQuestions, ISurveyMaster demoSurveyMasters, ISessionUser demoSessionUsers, IAnswerOption demoAnswerOptions) { _questions = question; _answers = survey; _answerOptions = answerOptions; _results = results; _seedService = seedService; _demoQuestions = demoQuestions; _demoAnswerOptions = demoAnswerOptions; _demoSessionUsers = demoSessionUsers; _demoSurveys = demoSurveyMasters; }
public SurveyStatusType GetInstrumentStatus(ISurvey instrument) { if (AllInstrumentNodesAreInAStatus(instrument, SurveyStatusType.Active)) { return(SurveyStatusType.Active); } if (AllInstrumentNodesAreInAStatus(instrument, SurveyStatusType.Inactive)) { return(SurveyStatusType.Inactive); } return(AnyInstrumentNodeHasFailedOrTakenTooLongToInstall(instrument) ? SurveyStatusType.Failed : SurveyStatusType.Installing); }
public async Task <ISurvey> CreateNewSurvey(ISurvey surveyDto) { try { var survey = Mappings.Mapper.Map <Entities.Survey>(surveyDto); survey.Id = Guid.NewGuid(); var preservedEntity = await _surveyRepository.Create(survey); surveyDto.Id = preservedEntity.Id; return(surveyDto); } catch (Exception e) { _logger.Error(e, "SurveyManagementService.CreateNewSurvey"); throw; } }
public CatiInstrumentDto MapToCatiInstrumentDto(ISurvey instrument, List <DateTime> surveyDays) { return(new CatiInstrumentDto { Name = instrument.Name, Id = instrument.InstrumentID, ServerParkName = instrument.ServerPark, InstallDate = instrument.InstallDate, Status = _statusMapper.GetInstrumentStatus(instrument).ToString(), Nodes = _nodeDtoMapper.MapToInstrumentNodeDtos(instrument.Configuration), DataRecordCount = GetNumberOfDataRecords(instrument as ISurvey2), SurveyDays = surveyDays, Active = SurveyIsActive(surveyDays), ActiveToday = SurveyIsActiveToday(surveyDays), DeliverData = SetDeliverDataWhichIncludesADaysGraceFromLastSurveyDay(surveyDays) }); }
public CatiInstrumentDto MapToCatiInstrumentDto(ISurvey instrument, List <DateTime> surveyDays) { var catiInstrument = new CatiInstrumentDto { Name = instrument.Name, ServerParkName = instrument.ServerPark, InstallDate = instrument.InstallDate, Status = instrument.Status, DataRecordCount = GetNumberOfDataRecords(instrument as ISurvey2), SurveyDays = surveyDays, Active = surveyDays.Any(s => s.Date <= DateTime.Today) && surveyDays.Any(s => s.Date >= DateTime.Today), ActiveToday = surveyDays.Any(s => s.Date == DateTime.Today) }; catiInstrument.DeliverData = SetDeliverDataWhichIncludesADayGraceFromLastSurveyDay(catiInstrument); return(catiInstrument); }
public ISurvey AddSurvey(ISurvey survey) { var message = new AddSurveyCommand { surveyToAdd = (Survey)survey }; Survey resultSurvey = new Survey(); var task = bus.Send(message).Register((result => { var reply = result.Messages; return; })); var a = task.GetAwaiter(); a.GetResult(); return(resultSurvey); }
/// <summary> /// Static mechanism to render a survey. /// </summary> /// <param name="survey">The survey.</param> /// <param name="placeHolder">The place holder.</param> /// <param name="readOnly">if set to <c>true</c> [read only].</param> /// <param name="showRequiredNotation">if set to <c>true</c> [show required notation].</param> /// <param name="validationProvider">The validation provider.</param> /// <param name="localizer">Localizes text.</param> public static void RenderSurvey(ISurvey survey, PlaceHolder placeHolder, bool readOnly, bool showRequiredNotation, ValidationProviderBase validationProvider, ILocalizer localizer) { Debug.Assert(placeHolder != null, "placeHolder cannot be null"); Debug.Assert(validationProvider != null, "validationProvider cannot be null"); // add the survey title if (survey.ShowText) { var titleDiv = new HtmlGenericControl("DIV"); titleDiv.Attributes["class"] = Utility.CssClassSurveyTitle; titleDiv.InnerText = survey.Text; placeHolder.Controls.Add(titleDiv); } List <ISection> sections = survey.GetSections(); foreach (ISection s in sections) { s.Render(placeHolder, readOnly, showRequiredNotation, validationProvider, localizer); } }
public ISurvey UpdateSurvey(ISurvey survey) { Survey updatedSurvey = null; return(ExecuteFaultHandeledOperation(() => { if (survey.SurveyId == Guid.Empty) { //add new survey updatedSurvey = (Survey)survey; } //update existing updatedSurvey = (Survey)survey; if (updatedSurvey == null) { throw new FaultException("Something happend -_-"); } return updatedSurvey; })); }
public async Task <bool> UpdateExistingSurvey(Guid id, ISurvey surveyDto) { try { var survey = await _surveyRepository.Get(id); if (survey == null) { return(false); } Mappings.Mapper.Map(surveyDto, survey); await _surveyRepository.Update(survey); return(true); } catch (Exception e) { _logger.Error(e, "SurveyManagementService.UpdateExistingSurvey"); throw; } }
public virtual void AddOption(ISurvey pSurvey, ISurveyOption pOption) { throw new System.NotImplementedException(); }
public virtual void AddVote(ISurvey pSurvey, IVote pVote) { throw new System.NotImplementedException(); }
public SurveyRepoImpl(ISurvey survey) { this._survey = survey; }
public SurveysController(NewsManDbContext context, ISurvey survey, IResult result) { _context = context; _survey = survey; _result = result; }
/// <summary> /// This method adds a Survey to the list of surveys from the project /// </summary> /// <param name="pSurvey"></param> public virtual void AddSurvey(ISurvey pSurvey) { SurveyList.Add(pSurvey); List<InteractionAttributes> changedAttributes = new List<InteractionAttributes>(); changedAttributes.Add(InteractionAttributes.SurveyList); OnModify(new InteractionEventArgs($"Survey IsActive changed [Id={Id}]", DateTime.Now, InteractionType.Project)); }
public Campaign(ISurvey survey, List <ISurveyLocations> locations) { Id = 1; Survey = survey; Adresses = locations; }
/// <summary> /// /// </summary> /// <param name="context"></param> /// <param name="survey"></param> /// <param name="userManager"></param> public SurveysController(AppointmentContext context, ISurvey survey, UserManager <ApplicationUser> userManager) { _context = context; _survey = survey; _userManager = userManager; }
public SurveyController(ISurvey surveyDAO, IPark parkDAO) { this.surveyDAO = surveyDAO; this.parkDAO = parkDAO; }
private static bool InstrumentHasTakenTooLongToInstall(ISurvey instrument) { var expiredInstallDateTime = DateTime.Now.AddMinutes(-InstallExpiryTimeOutInMinutes); return(instrument.InstallDate < expiredInstallDateTime); }
/// <summary> /// Static mechanism to render a survey. /// </summary> /// <param name="survey">The survey.</param> /// <param name="placeHolder">The place holder.</param> /// <param name="readOnly">if set to <c>true</c> [read only].</param> /// <param name="showRequiredNotation">if set to <c>true</c> [show required notation].</param> /// <param name="validationProvider">The validation provider.</param> /// <param name="localizer">Localizes text.</param> public static void RenderSurvey(ISurvey survey, PlaceHolder placeHolder, bool readOnly, bool showRequiredNotation, ValidationProviderBase validationProvider, ILocalizer localizer) { Debug.Assert(placeHolder != null, "placeHolder cannot be null"); Debug.Assert(validationProvider != null, "validationProvider cannot be null"); // add the survey title if (survey.ShowText) { var titleDiv = new HtmlGenericControl("DIV"); titleDiv.Attributes["class"] = Utility.CssClassSurveyTitle; titleDiv.InnerText = survey.Text; placeHolder.Controls.Add(titleDiv); } List<ISection> sections = survey.GetSections(); foreach (ISection s in sections) { s.Render(placeHolder, readOnly, showRequiredNotation, validationProvider, localizer); } }
private static bool AnyInstrumentNodeHasFailed(ISurvey instrument) { return(instrument.Configuration.Configurations.Any(c => c.Status != SurveyStatusType.Active.ToString() && c.Status != SurveyStatusType.Installing.ToString())); }
private static bool AnyInstrumentNodeHasFailedOrTakenTooLongToInstall(ISurvey instrument) { return(AnyInstrumentNodeHasFailed(instrument) || InstrumentHasTakenTooLongToInstall(instrument)); }
private static bool AllInstrumentNodesAreInAStatus(ISurvey instrument, SurveyStatusType statusType) { return(instrument.Configuration.Configurations .All(c => c.Status == statusType.ToString())); }
public CustomerController(ICustomer context, IQuery query, ISurvey survey) { _context = context; queryContext = query; surveyContext = survey; }
public virtual void AddSurvey(ISurvey pSurvey) { throw new System.NotImplementedException(); }
public virtual bool UpsertSurvey(ISurvey pSurvey) { throw new System.NotImplementedException(); }
private CatiInstrumentDto GetCatiInstrumentDto(ISurvey instrument) { var surveyDays = _blaiseCatiApi.GetSurveyDays(instrument.Name, instrument.ServerPark); return(_mapper.MapToCatiInstrumentDto(instrument, surveyDays)); }