コード例 #1
0
 public void AddLog(Guid distributrId, string description)
 {
     AuditLog log = new AuditLog
                        {
                            Id = Guid.NewGuid(),
                            DistributorCostCenterId = distributrId,
                            DateCreated = DateTime.Now,
                            Description = description,
                        };
     Save(log);
 }
コード例 #2
0
        AuditLog Map(tblAuditLog tblLog)
        {
            AuditLog log = new AuditLog();
            log.Id = tblLog.Id;
            log.DistributorCostCenterId = tblLog.DistributorCostCenterId;
            log.DateCreated = tblLog.DateCreated;
            log.Type = tblLog.Type;
            log.Direction = tblLog.Direction;
            log.Description = tblLog.Description;

            return log;
        }
コード例 #3
0
        public Guid Save(AuditLog entity)
        {
            tblAuditLog toSave = new tblAuditLog();
            toSave.Id = entity.Id;
            toSave.DistributorCostCenterId = entity.DistributorCostCenterId;
            toSave.DateCreated = entity.DateCreated;
            toSave.Type = entity.Type;
            toSave.Direction = entity.Direction;
            toSave.Description = entity.Description;

            _ctx.tblAuditLog.Add(toSave);
            _ctx.SaveChanges();

            return toSave.Id;
            return Guid.Empty;
        }