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); }
public bool CanInsertData() { return((String.IsNullOrEmpty(TxbFileName) || IgnoredRow < 1 || !ExcelEntryHelper.isExcelColPositionUnique(ListExCol) || String.IsNullOrEmpty(SelectedClass) || !_flagCanInsert) ? false : true); }