Пример #1
0
        protected override void Edit()
        {
            TrainingProductManager mgr = new TrainingProductManager();

            Entity = mgr.Get(Convert.ToInt32(EventArgument));
            base.Edit();
        }
Пример #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();
        }
Пример #4
0
        protected override void Delete()
        {
            TrainingProductManager mgr = new TrainingProductManager();

            Entity           = new TrainingProduct();
            Entity.ProductId = Convert.ToInt32(EventArgument);
            mgr.Delete(Entity);
            Get();
            base.Delete();
        }
Пример #5
0
        private void Delete()
        {
            TrainingProduct entity = new TrainingProduct
            {
                ProductId = Convert.ToInt32(EventArgument)
            };

            TrainingProductManager.Delete(entity);

            Get();

            ListMode();
        }
Пример #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();
        }
Пример #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();
                }
            }
        }
Пример #10
0
 private void Get()
 {
     //TrainingProductManager mgr = new TrainingProductManager();
     Products = TrainingProductManager.Get(SearchEntity);
 }