public void Initialize()
 {
     ControlSchedulesList = ModelGenerics.GetLastTenInDatabasae(new ControlSchedules());
     Parallel.ForEach(ControlSchedulesList, controleSchedule =>
     {
         controleSchedule.TimeStringHelper = controleSchedule.Time.ToString(@"hh\:mm");
     });
 }
Пример #2
0
        public void Initialize()
        {
            ProductionsList = ModelGenerics.GetLastTenInDatabasae(new Productions());

            Parallel.ForEach(ProductionsList, production =>
            {
                production.BatchDateStringHelper = production.BatchDate.ToString("yyyy/MM/dd");
            });
        }
 public void RefreshLastTen()
 {
     ControlSchedulesList = ModelGenerics.GetLastTenInDatabasae(new ControlSchedules());
     Parallel.ForEach(ControlSchedulesList, controleSchedule =>
     {
         controleSchedule.TimeStringHelper = controleSchedule.Time.ToString(@"hh:mm:ss");
     });
     _message.ShowToastNotification("Opdateret", "Kontrol Skema-tabellen er opdateret");
 }
Пример #4
0
 public void Initialize()
 {
     ShiftRegistrationsList = ModelGenerics.GetLastTenInDatabasae(new ShiftRegistrations());
     Parallel.ForEach(ShiftRegistrationsList, shiftRegistration =>
     {
         shiftRegistration.StartTimeStringHelper = shiftRegistration.StartTime.ToString(@"hh\:mm");
         shiftRegistration.EndDateStringHelper   = shiftRegistration.EndDate.ToString(@"hh\:mm");
     });
 }
 public void RefreshFrontpages()
 {
     ManageTables.Instance.FrontpagesList = ModelGenerics.GetAll(new Frontpages());
     Parallel.ForEach(ManageTables.Instance.FrontpagesList, frontpage =>
     {
         frontpage.DateTimeStringHelper = frontpage.Date.ToString().Remove(10);
     });
     message.ShowToastNotification("Opdateret", "Forside-tabellen er opdateret");
 }
Пример #6
0
 public void RefreshLastTen()
 {
     ShiftRegistrationsList = ModelGenerics.GetLastTenInDatabasae(new ShiftRegistrations());
     Parallel.ForEach(ShiftRegistrationsList, shiftRegistration =>
     {
         shiftRegistration.StartTimeStringHelper = shiftRegistration.StartTime.ToString(@"hh\:mm");
         shiftRegistration.EndDateStringHelper   = shiftRegistration.EndDate.ToString(@"hh\:mm");
     });
     _message.ShowToastNotification("Opdateret", "Vagt Registrerings-tabellen er opdateret");
 }
Пример #7
0
        public void RefreshLastTen()
        {
            ProductionsList = ModelGenerics.GetLastTenInDatabasae(new Productions());

            Parallel.ForEach(ProductionsList, production =>
            {
                production.BatchDateStringHelper = production.BatchDate.ToString("yyyy/MM/dd");
            });
            _message.ShowToastNotification("Opdateret", "Produktions-tabellen er opdateret");
        }
Пример #8
0
 public void SaveAll()
 {
     Parallel.ForEach(ShiftRegistrationsList, shiftRegistrations =>
     {
         InputValidator.CheckIfInputsAreValid(ref shiftRegistrations);
     });
     Parallel.ForEach(ShiftRegistrationsList, shiftRegistrations =>
     {
         ModelGenerics.UpdateByObjectAndId((int)shiftRegistrations.ShiftRegistrationId, shiftRegistrations);
     });
     _message.ShowToastNotification("Gemt", "Vagt Registrerings-tabellen er gemt");
 }
 public void SaveAll()
 {
     Parallel.ForEach(ControlSchedulesList, controleSchedule =>
     {
         InputValidator.CheckIfInputsAreValid(ref controleSchedule);
     });
     Parallel.ForEach(ControlSchedulesList, controlSchedules =>
     {
         ModelGenerics.UpdateByObjectAndId((int)controlSchedules.ControlScheduleId, controlSchedules);
     });
     _message.ShowToastNotification("Gemt", "Kontrol Skema-tabellen er gemt");
 }
Пример #10
0
 public void SaveAll()
 {
     Parallel.ForEach(TuList, tus =>
     {
         InputValidator.CheckIfInputsAreValid(ref tus);
     });
     Parallel.ForEach(TuList, tus =>
     {
         ModelGenerics.UpdateByObjectAndId((int)tus.TuId, tus);
     });
     _message.ShowToastNotification("Gemt", "TU-tabellen er gemt");
 }
Пример #11
0
        private ObservableCollection <Frontpages> GetLastTenFrontpages()
        {
            //Todo format datetime everywhere
            ObservableCollection <Frontpages> result = ModelGenerics.GetLastTenInDatabasae(new Frontpages());

            foreach (var frontpage in result)
            {
                frontpage.DateTimeStringHelper = frontpage.Date.ToString("yyyy/MM/dd");
            }

            return(result);
        }
Пример #12
0
 public void SaveFrontpages()
 {
     Parallel.ForEach(ManageTables.Instance.FrontpagesList, frontpage =>
     {
         InputValidator.CheckIfInputsAreValid(ref frontpage);
     });
     Parallel.ForEach(ManageTables.Instance.FrontpagesList, frontpages =>
     {
         ModelGenerics.UpdateByObjectAndId(frontpages.ProcessOrder_No, frontpages);
     });
     ManageTables.Instance.FrontpagesList = ModelGenerics.GetLastTenInDatabasae(new Frontpages());
     message.ShowToastNotification("Gemt", "Forside-tabellen er gemt");
     ManageTables.Instance.FrontpagesList = GetLastTenFrontpages();
 }
Пример #13
0
        public void SaveAll()
        {
            ProductionsList = ModelGenerics.GetAll(new Productions());

            Parallel.ForEach(ProductionsList, production =>
            {
                InputValidator.CheckIfInputsAreValid(ref production);
            });

            Parallel.ForEach(ProductionsList, production =>
            {
                ModelGenerics.UpdateByObjectAndId((int)production.ProductionId, production);
            });
            _message.ShowToastNotification("Opdateret", "Produktions-tabellen er opdateret");
        }
Пример #14
0
        public void AddNewItem()
        {
            var objectToAdd = NewTUs;

            InputValidator.CheckIfInputsAreValid(ref objectToAdd);

            //Autofills

            if (ModelGenerics.CreateByObject(objectToAdd))
            {
                Initialize();

                NewTUs = new Us();
            }
            else
            {
                //error
            }
        }
Пример #15
0
        public void AddNewItem()
        {
            var objectToAdd = NewControlSchedules;

            InputValidator.CheckIfInputsAreValid(ref objectToAdd);


            if (ModelGenerics.CreateByObject(objectToAdd))
            {
                Initialize();

                NewControlSchedules = new ControlSchedules
                {
                    ProcessOrderNo = ControlSchedulesList.Last().ProcessOrderNo
                };
            }
            else
            {
                //error
            }
        }
Пример #16
0
        public void AddNewItem()
        {
            var objectToAdd = NewProductions;

            InputValidator.CheckIfInputsAreValid(ref objectToAdd);

            //Autofills

            if (ModelGenerics.CreateByObject(objectToAdd))
            {
                Initialize();

                NewProductions = new Productions
                {
                    ProcessOrderNo = ProductionsList.Last().ProcessOrderNo
                };
            }
            else
            {
                //error
            }
        }
Пример #17
0
        public void AddNewFrontpages()
        {
            var instanceNewFrontpagesToAdd = ManageTables.Instance.NewFrontpagesToAdd;

            InputValidator.CheckIfInputsAreValid(ref instanceNewFrontpagesToAdd);
            instanceNewFrontpagesToAdd.Week_No = FindWeekNumber(instanceNewFrontpagesToAdd);


            ManageTables.Instance.FrontpagesList       = ModelGenerics.GetLastTenInDatabasae(new Frontpages());
            instanceNewFrontpagesToAdd.ProcessOrder_No = ManageTables.Instance.FrontpagesList.Last().ProcessOrder_No + 1;
            if (ModelGenerics.CreateByObject(instanceNewFrontpagesToAdd))
            {
                //ManageTables.Instance.FrontpagesList.Add(NewFrontpagesToAdd);
                ManageTables.Instance.FrontpagesList       = ModelGenerics.GetLastTenInDatabasae(new Frontpages());
                instanceNewFrontpagesToAdd                 = new Frontpages();
                instanceNewFrontpagesToAdd.ProcessOrder_No = ManageTables.Instance.FrontpagesList[ManageTables.Instance.FrontpagesList.Count - 1].ProcessOrder_No + 1;
                instanceNewFrontpagesToAdd.Date            = DateTime.Now;
                instanceNewFrontpagesToAdd.Week_No         = FindWeekNumber(instanceNewFrontpagesToAdd);
            }
            else
            {
                //error
            }
        }
Пример #18
0
 public void RefreshLastTen()
 {
     TuList = ModelGenerics.GetLastTenInDatabasae(new Us());
     _message.ShowToastNotification("Opdateret", "TU-tabellen er opdateret");
 }
Пример #19
0
 public void RefreshAll()
 {
     TuList = ModelGenerics.GetAll(new Us());
     _message.ShowToastNotification("Opdateret", "TU-tabellen er opdateret");
 }
Пример #20
0
 public void Initialize()
 {
     TuList = ModelGenerics.GetLastTenInDatabasae(new Us());
 }
Пример #21
0
 public void GetByIdTest()
 {
     Assert.AreEqual(ModelGenerics.GetById(new Product(), 666));
 }