Esempio n. 1
0
        private void Save()
        {
            var mgr = new TrainingProductManager();

            if (Mode == "Add")
            {
                mgr.Insert(Entity);
            }
            else
            {
                mgr.Update(Entity);
            }

            ValidationErrors = mgr.ValidationErrors;
            if (ValidationErrors.Count > 0)
            {
                IsValid = false;
            }

            if (!IsValid)
            {
                if (Mode == "Add")
                {
                    AddMode();
                }
                EditMode();
            }
        }
Esempio n. 2
0
        public void Edit()
        {
            var mgr = new TrainingProductManager();

            Entity = mgr.Get(Convert.ToInt32(EventArgument));
            EditMode();
        }
Esempio n. 3
0
        private void Delete()
        {
            var mgr = new TrainingProductManager();

            Entity = mgr.Get(Convert.ToInt32(EventArgument));

            mgr.Delete(Entity);
            Get();
            ListMode();
        }
Esempio n. 4
0
        private void Get()
        {
            var mgr = new TrainingProductManager();

            Products = mgr.Get(SearchEntity);
        }