private bool Search(SolutionStep ss) { for (int i = 0; i < L.Count; i++) { SolutionStep present = L[i]; if (ss.x == present.x && ss.y == present.y && ss.num == present.num) { return(true); } } return(false); }
public void Save() { SQLiteDatabase sqlDatabase = null; try { Globals dbHelp = new Globals(); dbHelp.OpenDatabase(); sqlDatabase = dbHelp.GetSQLiteDatabase(); if (sqlDatabase != null) { if (sqlDatabase.IsOpen) { ContentValues values = new ContentValues(); values.Put("ProblemIdeaID", ProblemIdeaID); values.Put("SolutionStep", SolutionStep.Trim()); values.Put("PriorityOrder", PriorityOrder); if (IsNew) { SolutionPlanID = (int)sqlDatabase.Insert("SolutionPlans", null, values); IsNew = false; IsDirty = false; } if (IsDirty) { string whereClause = "SolutionPlanID = ?"; sqlDatabase.Update("SolutionPlans", values, whereClause, new string[] { SolutionPlanID.ToString() }); IsDirty = false; } sqlDatabase.Close(); } } } catch (Exception e) { Log.Error(TAG, "Save: Exception - " + e.Message); if (sqlDatabase != null && sqlDatabase.IsOpen) { sqlDatabase.Close(); } } }
private void ApplySolutionStep(SolutionStep ss) { s[ss.y, ss.x] = ss.num; f[ss.y, ss.x] = 0; }
public void Add(SolutionStep ss) { // if (!Search(ss)) L.Add(ss); L.Add(ss); }