示例#1
0
        public ExcelEntryViewModel()
            : base()
        {
            ExService        = new ExcelColumnPositionService();
            ExcelEntryHelper = new ExcelEntryHelper();
            ListExCol        = ExService.getListCol();
            IgnoredRow       = 0;
            LblProgress      = "0/0";
            ProgressbarValue = "0";
            ClassesInSchool  = new string[] { "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" };
            // SectionsInClass = new string[] { "-not applicable-", "A", "B", "C", "D", "E" };
            SectionsInClass  = new string[] { "-not applicable-" };
            SessionStartYear = DateTime.Today.ToString("yyyy");
            SessionEndYear   = DateTime.Today.ToString("yyyy");
            ExDb             = new ExcelEntryDb();
            _flagCanInsert   = true;

            FileOpenCommand            = new RelayCommand(getExcelFile, CanFileBrowse);
            IncrementIgnoredRowCommand = new RelayCommand(IncrementIgnoredRow, CanIncrementIgnoredRow);
            DecrementIgnoredRowCommand = new RelayCommand(DecrementIgnoredRow, CanDecrementIgnoredRow);
            InsertDataCommand          = new RelayCommand(InsertData, CanInsertData);
            ResetCommand = new RelayCommand(ResetAll, CanReset);
            AbortCommand = new RelayCommand(Abort, CanAbort);
        }
示例#2
0
 public bool CanInsertData()
 {
     return((String.IsNullOrEmpty(TxbFileName) || IgnoredRow < 1 || !ExcelEntryHelper.isExcelColPositionUnique(ListExCol) || String.IsNullOrEmpty(SelectedClass) || !_flagCanInsert) ? false : true);
 }