예제 #1
0
    static public bool DeleteTimeReport(DdTimeReportExt item, RevisionInfo revisionInfo)
    {
      DaTimeReport da = new DaTimeReport(DataStore.DbConnection);
      bool ok = da.DeleteById(item.Id);
      if (ok) AddChangeLog(da.TableName, item.Id, item.Timestamp, revisionInfo); //delete
	  return ok;
    }
예제 #2
0
 static public bool AddTimeReport(ref DdTimeReportExt item, RevisionInfo revisionInfo)
 {
   DaTimeReport da = new DaTimeReport(DataStore.DbConnection);
   da.Clear();
   da.CalendarREF = item.CalendarREF;
   da.Description = item.Description;
   da.EffectiveDate = item.EffectiveDate;
   da.Hours = item.Hours;
   da.Modified = item.Modified;
   da.ModifiedBy = item.ModifiedBy;
   da.PersonREF = item.PersonREF;
   da.TaskChargeCodeREF = item.TaskChargeCodeREF;
   bool ok = da.Insert();
   if (ok) AddChangeLog(da.TableName, da.Id, da.Timestamp, revisionInfo); //add
   if (ok) item = new DdTimeReportExt(da.GetBuffer());
   return ok;
 }
예제 #3
0
 static public bool SaveTimeReport(ref DdTimeReportExt item, RevisionInfo revisionInfo)
 {
   DaTimeReport da = new DaTimeReport(DataStore.DbConnection);
   if (!da.GetById(item.Id)) return false;
   da.CalendarREF = item.CalendarREF;
   da.Description = item.Description;
   da.EffectiveDate = item.EffectiveDate;
   da.Hours = item.Hours;
   da.PersonREF = item.PersonREF;
   da.TaskChargeCodeREF = item.TaskChargeCodeREF;
   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 DdTimeReportExt(da.GetBuffer());
   }
   return ok;
 }