Example #1
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");
 }
 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");
 }
Example #3
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 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();
 }
        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");
        }
Example #6
0
        public void AddNewItem()
        {
            var objectToAdd = NewTUs;

            InputValidator.CheckIfInputsAreValid(ref objectToAdd);

            //Autofills

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

                NewTUs = new Us();
            }
            else
            {
                //error
            }
        }
        public void AddNewItem()
        {
            var objectToAdd = NewControlSchedules;

            InputValidator.CheckIfInputsAreValid(ref objectToAdd);


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

                NewControlSchedules = new ControlSchedules
                {
                    ProcessOrderNo = ControlSchedulesList.Last().ProcessOrderNo
                };
            }
            else
            {
                //error
            }
        }
        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
            }
        }
        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
            }
        }