コード例 #1
0
        private static TaxDetail getEntityByModel(TaxDetailModel model)
        {
            if (model == null) return null;
            TaxDetail entity = new TaxDetail();

            if (model.Id == 0)
            {
                entity.CreateBy = AuthenticationHelper.UserId;
                entity.CreateDate = DateTime.Now;
            }
            else
            {
                entity.CreateBy = model.CreateBy;
                entity.CreateDate = model.CreateDate;
            }
            entity.CodeCombinationId = model.CodeCombinationId;
            entity.EndDate = model.EndDate;
            entity.Id = model.Id;
            entity.Rate = model.Rate;
            entity.StartDate = model.StartDate;
            entity.TaxId = model.TaxId;
            entity.UpdateBy = AuthenticationHelper.UserId;
            entity.UpdateDate = DateTime.Now;

            return entity;
        }
コード例 #2
0
 public string Update(TaxDetail entity)
 {
     var originalEntity = this.Context.TaxDetails.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id.ToString();
 }
コード例 #3
0
 public TaxDetailModel(TaxDetail entity)
 {
     this.CodeCombinationId = entity.CodeCombinationId;
     this.EndDate = entity.EndDate;
     this.Id = entity.Id;
     this.Rate = entity.Rate;
     this.StartDate = entity.StartDate;
     this.TaxId = entity.TaxId;
     this.CreateBy = entity.CreateBy;
     this.CreateDate = entity.CreateDate;
     this.UpdateBy = entity.UpdateBy;
     this.UpdateDate = entity.UpdateDate;
 }
コード例 #4
0
 public string Update(TaxDetail entity)
 {
     return this.repository.Update(entity);
 }
コード例 #5
0
 public string Insert(TaxDetail entity)
 {
     return this.repository.Insert(entity);
 }
コード例 #6
0
 public string Insert(TaxDetail entity)
 {
     this.Context.TaxDetails.Add(entity);
     this.Commit();
     return entity.Id.ToString();
 }