Ejemplo n.º 1
0
 protected override void SetSpecificType(int id)
 {
     sType = repo.GetSurveyType(id);
     Indicators = sType.Indicators;
     DropDownValues = sType.IndicatorDropdownValues;
     Calculator = new CalcSurvey();
     Validator = new SurveyCustomValidator();
 }
 public IView NewSurvey(SurveyType type)
 {
     if (type.Id < 1)
         return null;
     
     SurveyBaseVm vm = new SurveyBaseVm(adminLevel, type.Id, new CalcSurvey());
     
     if (vm.Initialize())
         return new DataEntryEdit(vm);
     else
         return null;
 }
Ejemplo n.º 3
0
 protected override void ReloadDropdownValues()
 {
     sType = repo.GetSurveyType(sType.Id);
     DropDownValues = sType.IndicatorDropdownValues;
 }
Ejemplo n.º 4
0
 public SurveyTypeEdit(SurveyType t)
     : base()
 {
     model = t;
     InitializeComponent();
 }
Ejemplo n.º 5
0
        private void Upload(SurveyType stype)
        {
            List<IHaveDynamicIndicatorValues> forms = new List<IHaveDynamicIndicatorValues>();
            forms = options.Surveys.Where(d => d.TypeOfSurvey.Id == stype.Id).Cast<IHaveDynamicIndicatorValues>().ToList();
            SurveyImporter importer = new SurveyImporter();
            importer.SetType(stype.Id);
            var payload = new Nada.UI.View.Wizard.SplitDistro.WorkerPayload
            {
                Importer = importer,
                Forms = forms,
            };
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = Translations.ExcelFiles + " (*.xlsx)|*.xlsx";
            ofd.DefaultExt = ".xlsx";

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                OnSwitchStep(new WorkingStep(Translations.ImportingFile));
                payload.FileName = ofd.FileName;
                BackgroundWorker importerWorker = new BackgroundWorker();
                importerWorker.DoWork += importerWorker_DoWork;
                importerWorker.RunWorkerCompleted += importerWorker_RunWorkerCompleted;
                importerWorker.RunWorkerAsync(payload);
            }
        }