public void Save() { SQLiteDatabase sqlDatabase = null; try { Globals dbHelp = new Globals(); dbHelp.OpenDatabase(); sqlDatabase = dbHelp.GetSQLiteDatabase(); if (sqlDatabase != null && sqlDatabase.IsOpen) { ContentValues values = new ContentValues(); values.Put("ProblemIdeaID", ProblemIdeaID); values.Put("ReviewText", ReviewText.Trim()); values.Put("Achieved", Achieved); values.Put("AchievedDate", AchievedDate.ToShortDateString()); if (IsNew) { SolutionReviewID = (int)sqlDatabase.Insert("SolutionReviews", null, values); IsNew = false; IsDirty = false; } if (IsDirty) { string whereClause = "SolutionReviewID = ?"; sqlDatabase.Update("SolutionReviews", values, whereClause, new string[] { SolutionReviewID.ToString() }); IsDirty = false; } sqlDatabase.Close(); } } catch (Exception e) { Log.Error(TAG, "Save: Exception - " + e.Message); if (sqlDatabase != null && sqlDatabase.IsOpen) { sqlDatabase.Close(); } } }