public void Delete(T t)
            {
                OleDB.ExecuteNonQuery("delete from TAtomAndGrp"
                                      + " where FKind = '" + Kind + "' and Id = " + t.Id);

                Entities.Remove(t.Id);
            }
示例#2
0
        protected void SaveSln(EnSolution solution)
        {
            OleDB.ExecuteNonQuery("delete from TSolution");

            OleDB.ExecuteNonQuery("insert into TSolution (FActiveWeek, FLessonNumber) values ("
                                  + "'" + ExBuildListWithHexChar.GetHexStr(solution.ActiveWeekArr) + "'"
                                  + ",'" + ExBuildListWithHexChar.GetHexStr(solution.LessonNumberArr) + "'"
                                  + ")");
        }
            public void Update(T t)
            {
                OleDB.ExecuteNonQuery(
                    "update TAtomAndGrp set "

                    + " FName = @FName, "
                    + " FColor = " + (IsCourse ? (t as EnSubject).Color.ToArgb().ToString() : "0")

                    + " where FKind = '" + Kind + "' "
                    + " and Id = " + t.Id,

                    new KeyValue <String, Object>("@FName", t.Name)
                    );
            }
            public void ClearAll()
            {
                OleDB.ExecuteNonQuery("delete from TAtomAndGrp"
                                      + " where FKind = '" + Kind + "'");

                IList <Int64> Ids = new List <Int64>();

                foreach (BaseEntity ety in Entities.Values)
                {
                    if (ety is T)
                    {
                        Ids.Add(ety.Id);
                    }
                }

                foreach (Int64 id in Ids)
                {
                    Entities.Remove(id);
                }
            }