Ejemplo n.º 1
0
 public void Initialize()
 {
     ControlSchedulesList = ModelGenerics.GetLastTenInDatabasae(new ControlSchedules());
     Parallel.ForEach(ControlSchedulesList, controleSchedule =>
     {
         controleSchedule.TimeStringHelper = controleSchedule.Time.ToString(@"hh\:mm");
     });
 }
Ejemplo n.º 2
0
        public void Initialize()
        {
            ProductionsList = ModelGenerics.GetLastTenInDatabasae(new Productions());

            Parallel.ForEach(ProductionsList, production =>
            {
                production.BatchDateStringHelper = production.BatchDate.ToString("yyyy/MM/dd");
            });
        }
Ejemplo n.º 3
0
 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");
 }
Ejemplo n.º 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");
     });
 }
Ejemplo n.º 5
0
 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");
 }
Ejemplo n.º 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");
 }
Ejemplo n.º 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");
        }
Ejemplo n.º 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");
 }
Ejemplo n.º 9
0
 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");
 }
Ejemplo n.º 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");
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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");
        }
Ejemplo n.º 14
0
        public void AddNewItem()
        {
            var objectToAdd = NewTUs;

            InputValidator.CheckIfInputsAreValid(ref objectToAdd);

            //Autofills

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

                NewTUs = new Us();
            }
            else
            {
                //error
            }
        }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 18
0
 public void RefreshLastTen()
 {
     TuList = ModelGenerics.GetLastTenInDatabasae(new Us());
     _message.ShowToastNotification("Opdateret", "TU-tabellen er opdateret");
 }
Ejemplo n.º 19
0
 public void RefreshAll()
 {
     TuList = ModelGenerics.GetAll(new Us());
     _message.ShowToastNotification("Opdateret", "TU-tabellen er opdateret");
 }
Ejemplo n.º 20
0
 public void Initialize()
 {
     TuList = ModelGenerics.GetLastTenInDatabasae(new Us());
 }
Ejemplo n.º 21
0
 public void GetByIdTest()
 {
     Assert.AreEqual(ModelGenerics.GetById(new Product(), 666));
 }