static public DdTaskExt GetTaskInfo(int taskREF) { DaTask da = new DaTask(DataStore.DbConnection); if (da.GetById(taskREF)) return new DdTaskExt(da.GetBuffer()); else return null; }
static public bool AddTask(ref DdTaskExt item, RevisionInfo revisionInfo) { DaTask da = new DaTask(DataStore.DbConnection); da.Clear(); da.Description = item.Description; da.DueDate = item.DueDate; da.EstHours = item.EstHours; da.Modified = item.Modified; da.ModifiedBy = item.ModifiedBy; da.TaskHeadingREF = item.TaskHeadingREF; da.TaskID = item.TaskID; da.Title = item.Title; bool ok = da.Insert(); if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo); //add if (ok) item = new DdTaskExt(da.GetBuffer()); return ok; }
static public bool SaveTask(ref DdTaskExt item, RevisionInfo revisionInfo) { DaTask da = new DaTask(DataStore.DbConnection); if (!da.GetById(item.Id)) return false; da.Description = item.Description; da.DueDate = item.DueDate; da.EstHours = item.EstHours; da.TaskHeadingREF = item.TaskHeadingREF; da.TaskID = item.TaskID; 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 DdTaskExt(da.GetBuffer()); } return ok; }