static public DdTaskRoleExt GetTaskRoleInfo(int taskRoleREF) { DaTaskRole da = new DaTaskRole(DataStore.DbConnection); if (da.GetById(taskRoleREF)) return new DdTaskRoleExt(da.GetBuffer()); else return null; }
static public bool AddTaskRole(ref DdTaskRoleExt item, RevisionInfo revisionInfo) { DaTaskRole da = new DaTaskRole(DataStore.DbConnection); da.Clear(); da.Description = item.Description; da.Modified = item.Modified; da.ModifiedBy = item.ModifiedBy; da.OnlyOne = item.OnlyOne; da.ProjectLevel = item.ProjectLevel; da.TaskRoleID = item.TaskRoleID; da.Title = item.Title; bool ok = da.Insert(); if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo); //add if (ok) item = new DdTaskRoleExt(da.GetBuffer()); return ok; }
static public bool SaveTaskRole(ref DdTaskRoleExt item, RevisionInfo revisionInfo) { DaTaskRole da = new DaTaskRole(DataStore.DbConnection); if (!da.GetById(item.Id)) return false; da.Description = item.Description; da.OnlyOne = item.OnlyOne; da.ProjectLevel = item.ProjectLevel; da.TaskRoleID = item.TaskRoleID; 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 DdTaskRoleExt(da.GetBuffer()); } return ok; }