Exemple #1
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);
                    }
                }
            }
        }
Exemple #2
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();
                }
            }
        }
        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();
                }
            }
        }
        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);
                    }
                }
            }
        }