示例#1
0
 public void Remove(CRUDControllerIdentifier key)
 {
     if (Contains(key))
     {
         innerList.RemoveAt(IndexOf(key));
     }
 }
示例#2
0
 public void Add(CRUDControllerIdentifier key, AbstractCRUDController crudController)
 {
     if (!Contains(key))
     {
         innerList.Add(new CRUDControllerListEntry(key, crudController));
     }
 }
示例#3
0
 public override bool Equals(object obj)
 {
     if (obj is CRUDControllerIdentifier)
     {
         CRUDControllerIdentifier aux = (CRUDControllerIdentifier)obj;
         return((businessLogicType == aux.businessLogicType) && (crudFormType == aux.crudFormType) && (gridTitle == aux.gridTitle) && (crudFormTitle == aux.crudFormTitle));
     }
     else
     {
         return(false);
     }
 }
示例#4
0
            public int IndexOf(CRUDControllerIdentifier key)
            {
                int result = -1;

                for (int i = 0; (i < innerList.Count) && (result < 0); i++)
                {
                    if (((CRUDControllerListEntry)innerList[i]).Key.Equals(key))
                    {
                        result = i;
                    }
                }
                return(result);
            }
示例#5
0
 public AbstractCRUDController this[CRUDControllerIdentifier key] {
     get {
         AbstractCRUDController result = null;
         for (int i = 0; (i < innerList.Count) && (result == null); i++)
         {
             if (((CRUDControllerListEntry)innerList[i]).Key.Equals(key))
             {
                 result = ((CRUDControllerListEntry)innerList[i]).Value;
             }
         }
         return(result);
     }
 }
示例#6
0
        public void UnloadCRUDController(AbstractCRUDController crudController)
        {
            CRUDControllerIdentifier key = null;

            if (crudController is CRUDController)
            {
                key = new CRUDControllerIdentifier(crudController as CRUDController);
            }
            else
            {
                key = new CRUDControllerIdentifier(crudController);
            }

            if (crudControllerList.Contains(key))
            {
                crudControllerList.Remove(key);
            }
            crudController.Dispose();
        }
示例#7
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);
        }
示例#8
0
        public CRUDOnlineController GetCRUDController(DBase db, Type businessLogicType, string gridTitle)
        {
            CRUDOnlineController     result = null;
            CRUDControllerIdentifier key    = new CRUDControllerIdentifier(businessLogicType, typeof(GridOnLineForm), gridTitle);

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

                result = new CRUDOnlineController(businessLogic, gridTitle);
                crudControllerList.Add(key, result);
            }
            else
            {
                result = (CRUDOnlineController)crudControllerList[key];
            }

            return(result);
        }
示例#9
0
 public CRUDControllerListEntry(CRUDControllerIdentifier key, AbstractCRUDController value)
 {
     this.key   = key;
     this.value = value;
 }
示例#10
0
 public bool Contains(CRUDControllerIdentifier key)
 {
     return(innerList.Contains(new CRUDControllerListEntry(key, null as AbstractCRUDController)));
 }