Exemple #1
0
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="model"></param>
        public static void AddData(BaseModel model)
        {
            OnceDataStorage obj = null;

            switch (model.CounterType)
            {
            case CounterTypeEnum.Nil:
                break;

            case CounterTypeEnum.Business:
                obj = new BizCounter();
                break;

            case CounterTypeEnum.Custom:
                obj = new CoustomCounter();
                break;

            case CounterTypeEnum.Error:
                obj = new ErrorCounter();
                break;

            default:
                break;
            }
            if (obj != null)
            {
                obj.Add(model);
            }
        }
Exemple #2
0
        public static OnceDataStorage Instance(CmdModel cmd)
        {
            OnceDataStorage obj = null;

            switch (cmd.CounterType)
            {
            case CounterTypeEnum.Nil:
                break;

            case CounterTypeEnum.Business:
                obj = new BizCounter();
                break;

            case CounterTypeEnum.Custom:
                obj = new CoustomCounter();
                break;

            case CounterTypeEnum.Error:
                obj = new ErrorCounter();
                break;

            default:
                throw new Exception("not found this CounterType");
                break;
            }
            obj.Cmd = cmd;
            return(obj);
        }