예제 #1
0
        private void Edit()
        {
            TrainingProductManager mgr = new TrainingProductManager();

            Entity = mgr.Get(Convert.ToInt32(EventArgument));
            EditMode();
        }
예제 #2
0
        private void Save()
        {
            List <TrainingProduct> lstproduct = new List <TrainingProduct>();
            TrainingProductManager mgr        = new TrainingProductManager();

            if (Mode == "Add")
            {
                mgr.Insert(Entity, out lstproduct);
                Products = lstproduct;
            }
            else
            {
                mgr.Update(Entity, out lstproduct);
                Products = lstproduct;
            }
            ValidationErrors = mgr.ValidationErrors;
            if (ValidationErrors.Count > 0)
            {
                IsValid = false;
            }

            if (!IsValid)
            {
                if (Mode == "Add")
                {
                    AddMode();
                }
                else
                {
                    EditMode();
                }
            }
        }
예제 #3
0
        private void Delete()
        {
            TrainingProductManager mgr        = new TrainingProductManager();
            List <TrainingProduct> lstproduct = new List <TrainingProduct>();

            Entity           = new TrainingProduct();
            Entity.ProductID = Convert.ToInt32(EventArgument);
            mgr.Delete(Entity, out lstproduct);
            Products = lstproduct;
            Get("Delete");
            ListMode();
        }
예제 #4
0
        private void Get(string mode = "")
        {
            TrainingProductManager mgr = new TrainingProductManager();

            Products = mgr.Get(SearchEntity, Products, mode);
        }