static public bool DeleteTaskHeading(DdTaskHeadingExt item, RevisionInfo revisionInfo)
    {
      DaTaskHeading da = new DaTaskHeading(DataStore.DbConnection);
      bool ok = da.DeleteById(item.Id);
      if (ok) AddChangeLog(da.TableName, item.Id, item.Timestamp, revisionInfo); //delete
	  return ok;
    }
 static public bool AddTaskHeading(ref DdTaskHeadingExt item, RevisionInfo revisionInfo)
 {
   DaTaskHeading da = new DaTaskHeading(DataStore.DbConnection);
   da.Clear();
   da.Description = item.Description;
   da.Modified = item.Modified;
   da.ModifiedBy = item.ModifiedBy;
   da.ProjectREF = item.ProjectREF;
   da.TaskHeadingID = item.TaskHeadingID;
   da.TaskHeadingREF = item.TaskHeadingREF;
   da.Title = item.Title;
   bool ok = da.Insert();
   if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo); //add
   if (ok) item = new DdTaskHeadingExt(da.GetBuffer());
   return ok;
 }
 static public bool SaveTaskHeading(ref DdTaskHeadingExt item, RevisionInfo revisionInfo)
 {
   DaTaskHeading da = new DaTaskHeading(DataStore.DbConnection);
   if (!da.GetById(item.Id)) return false;
   da.Description = item.Description;
   da.ProjectREF = item.ProjectREF;
   da.TaskHeadingID = item.TaskHeadingID;
   da.TaskHeadingREF = item.TaskHeadingREF;
   da.Title = item.Title;
   bool ok = true;
   if (da._IsModified)
   {
     da.Modified = DateTime.Now;
     da.ModifiedBy = Environment.UserName;
     ok = da.Save();
     if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo);
     if (ok) item = new DdTaskHeadingExt(da.GetBuffer());
   }
   return ok;
 }
    private void AddData()
    {
      int proNum = 1031;
      for (int cix = 6; cix < 10; cix++)
      {
        DdClientExt ddc = new DdClientExt();
        ddc.ClientID = "Client-" + cix.ToString();
        ddc.FullName = "Client Named " + cix.ToString();
        DataStore.AddClient(ref ddc, new RevisionInfo());
        for (int pix = 1; pix < 4; pix++)
        {
          DdTaskHeadingExt ddh = new DdTaskHeadingExt();
          ddh.ProjectREF = DataStore.NullId;
          ddh.TaskHeadingID = DateTime.Now.ToString("yyyyMMddHHmmssffff");
          ddh.Title = "General";
          DataStore.AddTaskHeading(ref ddh, new RevisionInfo());

          DdProjectExt ddp = new DdProjectExt();
          ddp.ClientREF = ddc.Id;
          ddp.Description = "Project Number " + pix.ToString();
          ddp.ProjectID = "P" + proNum.ToString("0000");
          ddp.TaskHeadingREF = ddh.Id;
          DataStore.AddProject(ref ddp, new RevisionInfo());
          proNum += 1;

          ddh.ProjectREF = ddp.Id;
          ddh.TaskHeadingID = "General";
          DataStore.SaveTaskHeading(ref ddh, new RevisionInfo());
        }
      }
    }