protected override void Init()
        {
            Products = new List<TrainingProduct>();
            SearchEntity = new TrainingProduct();
            Mgr = new TrainingProductManager();

            base.Init();
        }
 public bool Update(TrainingProduct entity)
 {
     bool ret = Validate(entity);
     if (ret)
     {
         //update db
     }
     return ret;
 }
 public bool Insert(TrainingProduct entity)
 {
     bool ret = Validate(entity);
     if (ret)
     {
         //add logic to insert
     }
     return ret;
 }
 public List<TrainingProduct> Get(TrainingProduct entity)
 {
     if (!String.IsNullOrEmpty(entity.ProductName))
     {
         return CreateMockData().FindAll(
             p =>
                 p.ProductName.ToLower()
                     .StartsWith(entity.ProductName, StringComparison.CurrentCultureIgnoreCase));
     }
     return CreateMockData();
 }
 protected override void Add()
 {
     IsValid = true;
     Entity = new TrainingProduct
     {
         IntroductionDate = DateTime.Now,
         Url = "http://",
         Price = 0
     };
     base.Add();
 }
        public bool Validate(TrainingProduct entity)
        {
            ValidationErrors.Clear();

            if (!string.IsNullOrEmpty(entity.ProductName))
            {
                if (entity.ProductName.ToLower() == entity.ProductName)
                {
                    ValidationErrors.Add(new KeyValuePair<string, string>("ProductName", "Product must not be all lower case."));
                }
            }

            return (ValidationErrors.Count == 0);
        }
        protected override void ResetSearch()
        {
            SearchEntity = new TrainingProduct();

            base.ResetSearch();
        }