Beispiel #1
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
            }
        }