static public DdProjectExt GetProjectInfo(int projectREF) { DaProject da = new DaProject(DataStore.DbConnection); if (da.GetById(projectREF)) return new DdProjectExt(da.GetBuffer()); else return null; }
static public bool AddProject(ref DdProjectExt item, RevisionInfo revisionInfo) { DaProject da = new DaProject(DataStore.DbConnection); da.Clear(); da.ClientREF = item.ClientREF; da.Description = item.Description; da.Modified = item.Modified; da.ModifiedBy = item.ModifiedBy; da.ProjectID = item.ProjectID; 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 DdProjectExt(da.GetBuffer()); return ok; }
static public bool SaveProject(ref DdProjectExt item, RevisionInfo revisionInfo) { DaProject da = new DaProject(DataStore.DbConnection); if (!da.GetById(item.Id)) return false; da.ClientREF = item.ClientREF; da.Description = item.Description; da.ProjectID = item.ProjectID; 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 DdProjectExt(da.GetBuffer()); } return ok; }