private static void Initialize() { if (SaveType.Equals("JSON")) { InitializeJson(); } else if (SaveType.Equals("SQL")) { InitializeSql(); } else if (SaveType.Equals("XML")) { InitializeXml(); } Initialized = true; }
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); } }
/// <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); }