static public bool DeleteTaskChargeCode(DdTaskChargeCodeExt item, RevisionInfo revisionInfo) { DaTaskChargeCode da = new DaTaskChargeCode(DataStore.DbConnection); bool ok = da.DeleteById(item.Id); if (ok) AddChangeLog(da.TableName, item.Id, item.Timestamp, revisionInfo); //delete return ok; }
static public bool AddTaskChargeCode(ref DdTaskChargeCodeExt item, RevisionInfo revisionInfo) { DaTaskChargeCode da = new DaTaskChargeCode(DataStore.DbConnection); da.Clear(); da.Description = item.Description; da.Modified = item.Modified; da.ModifiedBy = item.ModifiedBy; da.TaskChargeCodeID = item.TaskChargeCodeID; da.TaskHeadingRoleREF = item.TaskHeadingRoleREF; da.Title = item.Title; bool ok = da.Insert(); if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo); //add if (ok) item = new DdTaskChargeCodeExt(da.GetBuffer()); return ok; }
static public bool SaveTaskChargeCode(ref DdTaskChargeCodeExt item, RevisionInfo revisionInfo) { DaTaskChargeCode da = new DaTaskChargeCode(DataStore.DbConnection); if (!da.GetById(item.Id)) return false; da.Description = item.Description; da.TaskChargeCodeID = item.TaskChargeCodeID; da.TaskHeadingRoleREF = item.TaskHeadingRoleREF; 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 DdTaskChargeCodeExt(da.GetBuffer()); } return ok; }