static public bool DeletePerson(DdPersonExt item, RevisionInfo revisionInfo) { DaPerson da = new DaPerson(DataStore.DbConnection); bool ok = da.DeleteById(item.Id); if (ok) AddChangeLog(da.TableName, item.Id, item.Timestamp, revisionInfo); //delete return ok; }
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; }
override protected void ClearForm() { dd = new DdPersonExt(); FillForm(); }