Esempio n. 1
0
        private void Save()
        {
            //TrainingProductManager mgr = new TrainingProductManager();
            if (Mode == "Add")
            {
                TrainingProductManager.Insert(this.Entity);
            }
            if (Mode == "Edit")
            {
                TrainingProductManager.Update(this.Entity);
            }
            ValidationErrors = TrainingProductManager.ValidationErrors;

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

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

            if (Mode == "Add")
            {
                //Add data to database here
                mgr.Insert(Entity);
            }
            else
            {
                mgr.Update(Entity);
            }

            ValidationErrors = mgr.ValidationErrors;
            base.Save();
        }
        protected override void Save()
        {
            TrainingProductManager mgr =
                new TrainingProductManager();

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

            // Set any validation errors
            ValidationErrors = mgr.ValidationErrors;

            // Set mode based on validation errors
            base.Save();
        }
Esempio n. 4
0
        private void Save()
        {
            TrainingProductManager mgr = new TrainingProductManager();

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

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

            if (!IsValid)
            {
                if (Mode == "Add")
                {
                    AddMode();
                }
            }
        }