protected override void Edit()
        {
            TrainingProductManager mgr = new TrainingProductManager();

            Entity = mgr.Get(Convert.ToInt32(EventArgument));
            base.Edit();
        }
Esempio n. 2
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();
                }
            }
        }
        protected override void Get()
        {
            TrainingProductManager mgr = new TrainingProductManager();

            Products = mgr.Get(SearchEntity);

            base.Get();
        }
        protected override void Delete()
        {
            TrainingProductManager mgr = new TrainingProductManager();

            Entity           = new TrainingProduct();
            Entity.ProductId = Convert.ToInt32(EventArgument);
            mgr.Delete(Entity);
            Get();
            base.Delete();
        }
Esempio n. 5
0
        private void Delete()
        {
            TrainingProduct entity = new TrainingProduct
            {
                ProductId = Convert.ToInt32(EventArgument)
            };

            TrainingProductManager.Delete(entity);

            Get();

            ListMode();
        }
Esempio n. 6
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 Delete()
        {
            TrainingProductManager mgr =
                new TrainingProductManager();

            // Create new entity
            Entity = new TrainingProduct();

            // Get primary key from EventArgument
            Entity.ProductId =
                Convert.ToInt32(EventArgument);

            // Call data layer to delete record
            mgr.Delete(Entity);

            // Reload the Data
            Get();

            base.Delete();
        }
        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. 9
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();
                }
            }
        }
Esempio n. 10
0
 private void Get()
 {
     //TrainingProductManager mgr = new TrainingProductManager();
     Products = TrainingProductManager.Get(SearchEntity);
 }