コード例 #1
0
        private static void Initialize()
        {
            if (SaveType.Equals("JSON"))
            {
                InitializeJson();
            }
            else if (SaveType.Equals("SQL"))
            {
                InitializeSql();
            }
            else if (SaveType.Equals("XML"))
            {
                InitializeXml();
            }

            Initialized = true;
        }
コード例 #2
0
        public static void Create(Model model)
        {
            if (!Initialized)
            {
                Initialize();
            }

            if (SaveType.Equals("JSON"))
            {
                CreateJson(model);
            }
            else if (SaveType.Equals("SQL"))
            {
                CreateSql(model);
            }
            else if (SaveType.Equals("XML"))
            {
                CreateXml(model);
            }
        }
コード例 #3
0
        /// <summary>
        /// Return true if Object is in datastore. Modifies the given object
        /// </summary>
        /// <returns></returns>
        public static bool Read(ref Doctor model, string extraOptions = "")
        {
            if (!Initialized)
            {
                Initialize();
            }

            var bRead = false;

            if (SaveType.Equals("JSON"))
            {
                bRead = ReadJson(ref model, extraOptions);
            }
            else if (SaveType.Equals("SQL"))
            {
                bRead = ReadSql(ref model, extraOptions);
            }
            else if (SaveType.Equals("XML"))
            {
                bRead = ReadXml(ref model, extraOptions);
            }

            return(bRead);
        }