示例#1
0
        public static InputChoice Load(Int32 inputChoiceId, bool useCache)
        {
            if (inputChoiceId == 0)
            {
                return(null);
            }
            InputChoice inputChoice = null;
            string      key         = "InputChoice_" + inputChoiceId.ToString();

            if (useCache)
            {
                inputChoice = ContextCache.GetObject(key) as InputChoice;
                if (inputChoice != null)
                {
                    return(inputChoice);
                }
            }
            inputChoice = new InputChoice();
            if (inputChoice.Load(inputChoiceId))
            {
                if (useCache)
                {
                    ContextCache.SetObject(key, inputChoice);
                }
                return(inputChoice);
            }
            return(null);
        }
示例#2
0
        public static bool Delete(Int32 inputChoiceId)
        {
            InputChoice inputChoice = new InputChoice();

            if (inputChoice.Load(inputChoiceId))
            {
                return(inputChoice.Delete());
            }
            return(false);
        }