static public DdPersonExt GetPersonInfo(int personREF) { DaPerson da = new DaPerson(DataStore.DbConnection); if (da.GetById(personREF)) return new DdPersonExt(da.GetBuffer()); else return null; }
static public bool AddPerson(ref DdPersonExt item, RevisionInfo revisionInfo) { DaPerson da = new DaPerson(DataStore.DbConnection); da.Clear(); da.Comment = item.Comment; da.Credentials = item.Credentials; da.FullName = item.FullName; da.Inactive = item.Inactive; da.Modified = item.Modified; da.ModifiedBy = item.ModifiedBy; da.PersonID = item.PersonID; da.Title = item.Title; bool ok = da.Insert(); if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo); //add if (ok) item = new DdPersonExt(da.GetBuffer()); return ok; }
static public bool SavePerson(ref DdPersonExt item, RevisionInfo revisionInfo) { DaPerson da = new DaPerson(DataStore.DbConnection); if (!da.GetById(item.Id)) return false; da.Comment = item.Comment; da.Credentials = item.Credentials; da.FullName = item.FullName; da.Inactive = item.Inactive; da.PersonID = item.PersonID; 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 DdPersonExt(da.GetBuffer()); } return ok; }