Ejemplo n.º 1
0
        private void EditEntity()
        {
            BufferHours bh = FocusedEntity;

            if (bh == null || SWController == null || EntityStore == null)
            {
                return;
            }
            if (CanEditEntity())
            {
                FormSelectYear selectYear = new FormSelectYear();

                List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID);

                selectYear.SetStoreWorlds(lst);
                selectYear.EntityStore = EntityStore;

                selectYear.SetReadOnly();
                selectYear.Entity = bh;

                if (selectYear.ShowDialog() == DialogResult.OK)
                {
                    BufferHoursList.ResetItemById(bh.ID);
                }
            }
        }
Ejemplo n.º 2
0
        private void EditEntity()
        {
            Benchmark bh = FocusedEntity;

            if (bh == null || SWController == null || EntityStore == null)
            {
                return;
            }

            if (CanEditEntity())
            {
                using (FormBenchmark formEdit = new FormBenchmark())
                {
                    List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID);

                    formEdit.SetStoreWorlds(lst);
                    formEdit.EntityStore = EntityStore;

                    formEdit.SetReadOnly();
                    formEdit.EntityBenchmark = bh;

                    if (formEdit.ShowDialog() == DialogResult.OK)
                    {
                        BenchmarksList.ResetItemById(bh.ID);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void EditEntity()
        {
            TrendCorrection bh = FocusedEntity;

            if (bh == null || SWController == null || EntityStore == null)
            {
                return;
            }

            // Edit can now trendcorrection, can't edit last EndTime < Today
            if (CanEditEntity())
            {
                using (FormTrendCorrection formEdit = new FormTrendCorrection())
                {
                    List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID);

                    formEdit.SetStoreWorlds(lst);
                    formEdit.EntityStore = EntityStore;

                    formEdit.SetReadOnly();
                    formEdit.Entity = bh;

                    if (formEdit.ShowDialog() == DialogResult.OK)
                    {
                        TrendCorrectionList.ResetItemById(bh.ID);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void NewEntity()
        {
            if (SWController == null || EntityStore == null)
            {
                return;
            }

            FormSelectYear selectYear = new FormSelectYear();

            List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID);

            selectYear.SetStoreWorlds(lst);
            selectYear.EntityStore = EntityStore;
            if (selectYear.ShowDialog() == DialogResult.OK)
            {
                short y = selectYear.Entity.Year;
                if (y >= StartYear && y <= EndYear)
                {
                    BufferHoursList.Add(selectYear.Entity);
                }
            }
        }
Ejemplo n.º 5
0
        private void NewEntity()
        {
            if (SWController == null || EntityStore == null)
            {
                return;
            }

            using (FormBenchmark formEdit = new FormBenchmark())
            {
                List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID);

                formEdit.SetStoreWorlds(lst);
                formEdit.EntityStore = EntityStore;
                if (formEdit.ShowDialog() == DialogResult.OK)
                {
                    short y = formEdit.EntityBenchmark.Year;
                    if (y >= StartYear && y <= EndYear)
                    {
                        BenchmarksList.Add(formEdit.EntityBenchmark);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void NewEntity()
        {
            if (SWController == null || EntityStore == null)
            {
                return;
            }

            using (FormTrendCorrection formEdit = new FormTrendCorrection())
            {
                List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID);

                formEdit.SetStoreWorlds(lst);
                formEdit.EntityStore = EntityStore;
                if (formEdit.ShowDialog() == DialogResult.OK)
                {
                    if (IsIncludeDateRange(StartDate, EndDate, formEdit.EntityTrend.BeginTime, formEdit.EntityTrend.EndTime))
                    {
                        TrendCorrectionList.Add(formEdit.EntityTrend);
                    }
                    UpdateButtonState();
                }
            }
        }