Exemple #1
0
        protected void RelSel(DataCombo dc, Type relType, Persistent parent)
        {
            if (relType == businessLogic.PersistentType)
            {
                if (crudController != null)
                {
                    crudController.Dispose();
                }

                if (businessLogic is IFiltrable)
                {
                    ((IFiltrable)businessLogic).SetFilterObject(parent);
                }

                this.dc        = dc;
                crudController = new CRUDController(businessLogic, gridTitle, crudFormTitle, crudFormType, this);
                CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(crudController);

                if (dc.ValueChanged)
                {
                    crudController.ShowGrid(dc.Text);
                }
                else
                {
                    crudController.ShowGrid("");
                }
            }
        }
Exemple #2
0
        public CRUDController GetCRUDController(DBase db, Type businessLogicType, Type crudFormType, string gridTitle, string crudFormTitle, bool repeatCreate)
        {
            CRUDController           result = null;
            CRUDControllerIdentifier key    = new CRUDControllerIdentifier(businessLogicType, crudFormType, gridTitle, crudFormTitle);

            if (!crudControllerList.Contains(key))
            {
                BusinessLogic businessLogic = BusinessLogicFactory.GetBusinessLogicInstance(db, businessLogicType);

                result = new CRUDController(businessLogic, gridTitle, crudFormTitle, crudFormType, repeatCreate);
                childControllerManager.SetChildControllers(result);
                crudControllerList.Add(key, result);
            }
            else
            {
                result = (CRUDController)crudControllerList[key];
            }
            return(result);
        }
Exemple #3
0
 public CRUDControllerIdentifier(CRUDController controller) : this(controller.BusinessLogic.GetType(), controller.CRUDFormType, controller.GridTitle, controller.CRUDFormTitle)
 {
 }