Ejemplo n.º 1
0
 private void AddEntryExcelB()
 {
     MyCollectionB.Add(AddExcelB);
     MyCollectionBMains = new ObservableCollection <String>(_manager.LoadCollectionBMains(MyCollectionB.ToList()));
     _manager.StoreCollectionB(MyCollectionB.ToList());
     AddExcelB = new ExcelB();
 }
Ejemplo n.º 2
0
        private void InitValuesAndCollections()
        {
            // IMPOTANT: The order of these is essential as the last attributes are calling command on set()
            _manager = new ExcelManager();

            AddExcelA = new ExcelA();
            AddExcelB = new ExcelB();

            MyCollectionA             = new ObservableCollection <ExcelA>();
            MyCollectionExcelAValue12 = new ObservableCollection <String>();
            MyCollectionB             = new ObservableCollection <ExcelB>();
            MyCollectionC             = new ObservableCollection <ExcelC>();

            MonthComboboxSource = Constants.Months;
            SelectedMonth       = Constants.getCurrentDateMonth();
        }
Ejemplo n.º 3
0
        public List <ExcelB> LoadCollectionExcelB()
        {
            try
            {
                slDocExcelB = new SLDocument("ExcelB.xlsx");
            }
            catch (System.IO.FileNotFoundException e)
            {
                slDocExcelB = new SLDocument();
                slDocExcelB.SaveAs("ExcelB.xlsx");
                slDocExcelB = new SLDocument("ExcelB.xlsx");
            }
            catch (System.IO.IOException f)
            {
                throw f;
            }

            List <ExcelB> tempList = new List <ExcelB>();

            for (int i = 2; i < 80; i++)
            {
                ExcelB temp = new ExcelB();
                temp.Val3Main = slDocExcelB.GetCellValueAsString("B" + i.ToString());
                temp.Val4     = slDocExcelB.GetCellValueAsString("C" + i.ToString());
                temp.Val5     = slDocExcelB.GetCellValueAsString("D" + i.ToString());

                if (string.IsNullOrEmpty(temp.Val3Main)) // Check for ID is not empty
                {
                    break;
                }
                else
                {
                    tempList.Add(temp);
                }
            }

            return(tempList);
        }