Ejemplo n.º 1
0
 protected override void SetSpecificType(int id)
 {
     iType = repo.GetIntvType(id);
     Indicators = iType.Indicators;
     DropDownValues = iType.IndicatorDropdownValues;
     Calculator = new CalcIntv();
     Validator = new IntvCustomValidator();
 }
 public IView NewIntv(IntvType type)
 {
     if (type.Id < 1)
         return null;
     return new DataEntryEdit(new IntvBaseVm(adminLevel, type.Id, new CalcIntv()));
 }
Ejemplo n.º 3
0
        private void Upload(IntvType type)
        {
            List<IHaveDynamicIndicatorValues> forms = new List<IHaveDynamicIndicatorValues>();
            forms = options.Intvs.Where(d => d.IntvType.Id == type.Id).Cast<IHaveDynamicIndicatorValues>().ToList();
            IntvImporter importer = new IntvImporter();
            importer.SetType(type.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);
            }
        }
Ejemplo n.º 4
0
 protected override void ReloadDropdownValues()
 {
     iType = repo.GetIntvType(iType.Id);
     DropDownValues = iType.IndicatorDropdownValues;
 }
Ejemplo n.º 5
0
 public IntvTypeEdit(IntvType t)
     : base()
 {
     model = t;
     InitializeComponent();
 }
Ejemplo n.º 6
0
 private void GetIntvTypes()
 {
     // Get the monthly intervention type
     LeishMonthlyIntvType = IntvRepo.GetIntvType(IntvRepo.GetIntvTypeIdByNameKey("LeishMonthlyIntervention"));
     // Get the admin intervention type
     LeishAnnualIntvType = IntvRepo.GetIntvType(IntvRepo.GetIntvTypeIdByNameKey("LeishAnnualIntervention"));
 }