示例#1
0
        public lockingTypeCompositeType getLockingTypeById(int iIdLockingType)
        {
            lockingTypeCompositeType etct = new lockingTypeCompositeType();
            LockingType et = new LockingType();

            etct = et.GetLockingTypeById(iIdLockingType);
            return(etct);
        }
示例#2
0
        public List <lockingTypeCompositeType> getAllLockingType()
        {
            List <lockingTypeCompositeType> lst = new List <lockingTypeCompositeType>();
            LockingType et = new LockingType();

            lst = et.getAll();
            return(lst);
        }
示例#3
0
        public bool ExistLockingType(String sDescription, int iIdLockingType)
        {
            LockingType et = new LockingType();

            if (et.getCountLockingTypeByDescription(sDescription, iIdLockingType) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
        public bool ExistLockingTypeDuplicate(String sDescription, int iIdArea)
        {
            LockingType t = new LockingType();


            if (t.getCountLockingTypeDuplicate(iIdArea, sDescription) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public static ILockStrategy Create(LockingType strategy)
        {
            switch (strategy)
            {
                case LockingType.ReaderWriter:

                    return new LockStrategy();
                case LockingType.Exclusive:

                    return new ForcefulLockStrategy();
                default:

                    throw new ArgumentOutOfRangeException();
            }
        }
示例#6
0
        public bool ExistLocking(String sDescription)
        {
            var chocorroles = new LockingType();
            var swap        = chocorroles.getAll();
            var qbo         = (from s in swap where s.sDescription.Equals(sDescription) select s).Count();

            if (qbo < 1)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#7
0
        public static ILockStrategy Create(LockingType strategy)
        {
            switch (strategy)
            {
            case LockingType.ReaderWriter:

                return(new LockStrategy());

            case LockingType.Exclusive:

                return(new ForcefulLockStrategy());

            default:

                throw new ArgumentOutOfRangeException();
            }
        }
示例#8
0
        public errorCompositeType UpdateLockingType(int iIdLockingType, String sDescription)
        {
            errorCompositeType lstError = new errorCompositeType();

            try
            {
                LockingType et = new LockingType();
                et.UpdateLockingType(iIdLockingType, sDescription);
                lstError.bError = true;
                lstError.sError = "";
                return(lstError);
            }
            catch (Exception ex)
            {
                lstError.bError = false;
                lstError.sError = ex.Message;
                return(lstError);
            }
        }
示例#9
0
        public errorCompositeType DeleteLockingType(int iIdLockingType)
        {
            errorCompositeType lstError = new errorCompositeType();

            try
            {
                LockingType et = new LockingType();
                et.DeleteLockingType(iIdLockingType);
                lstError.bError = true;
                lstError.sError = "";
                return(lstError);
            }
            catch (Exception ex)
            {
                lstError.bError = false;
                lstError.sError = ex.Message;
                return(lstError);
            }
        }
示例#10
0
        public errorCompositeType AddLockingType(String description)
        {
            errorCompositeType lstError = new errorCompositeType();

            try
            {
                LockingType et = new LockingType();
                et.InsertLockingType(description);
                lstError.bError = true;
                lstError.sError = "";
                return(lstError);
            }
            catch (Exception ex)
            {
                lstError.bError = false;
                lstError.sError = ex.Message;
                return(lstError);
            }
        }
示例#11
0
 public TaskList(LockingType strategy) : this(LockStrategyFactory.Create(strategy))
 {
 }