Inheritance: DomainObject
Ejemplo n.º 1
0
        public static FirmViewModel ReadFirms()
        {
            var imported = Db.Trackings.Where(a => a.Name == _firmTable).Any();

            var firms = new List<Firm>();
            var errors = new List<KeyValuePair<string, string>>();

            ReadData("~/Assets/Firm.xls", imported, firms, errors);

            if (!imported)
            {
                var tracking = new Tracking() { Name = _firmTable };
                Db.Trackings.Add(tracking);
                Db.SaveChanges();
            }

            var viewModel = FirmViewModel.Create(firms, errors, imported);
            return viewModel;
        }
Ejemplo n.º 2
0
        public static SeminarViewModel ReadSeminar()
        {
            var imported = Db.Trackings.Where(a => a.Name == _seminarTable).Any();

            var seminars = new List<Seminar>();
            var errors = new List<KeyValuePair<string, string>>();

            ReadData("~/Assets/Seminar.xls", imported, seminars, errors);

            if (!imported)
            {
                var tracking = new Tracking() { Name = _seminarTable };
                Db.Trackings.Add(tracking);
                Db.SaveChanges();
            }

            var viewModel = SeminarViewModel.Create(seminars, errors, imported);
            return viewModel;
        }