static public bool DeleteRequestItem(DdRequestItemExt item, RevisionInfo revisionInfo) { DaRequestItem da = new DaRequestItem(DataStore.DbConnection); bool ok = da.DeleteById(item.Id); if (ok) AddChangeLog(da.TableName, item.Id, item.Timestamp, revisionInfo); //delete return ok; }
static public bool AddRequestItem(ref DdRequestItemExt item, RevisionInfo revisionInfo) { DaRequestItem da = new DaRequestItem(DataStore.DbConnection); da.Clear(); da.ChangeRequestREF = item.ChangeRequestREF; da.Comment = item.Comment; da.Description = item.Description; da.EffectiveDate = item.EffectiveDate; da.ItemID = item.ItemID; da.Modified = item.Modified; da.ModifiedBy = item.ModifiedBy; bool ok = da.Insert(); if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo); //add if (ok) item = new DdRequestItemExt(da.GetBuffer()); return ok; }
static public bool SaveRequestItem(ref DdRequestItemExt item, RevisionInfo revisionInfo) { DaRequestItem da = new DaRequestItem(DataStore.DbConnection); if (!da.GetById(item.Id)) return false; da.ChangeRequestREF = item.ChangeRequestREF; da.Comment = item.Comment; da.Description = item.Description; da.EffectiveDate = item.EffectiveDate; da.ItemID = item.ItemID; 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 DdRequestItemExt(da.GetBuffer()); } return ok; }