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

            if (model.Id == 0)
            {
                entity.CreateBy = AuthenticationHelper.UserId;
                entity.CreateDate = DateTime.Now;
                entity.CompanyId = AuthenticationHelper.CompanyId.Value;
            }
            else
            {
                entity.CreateBy = model.CreateBy;
                entity.CreateDate = model.CreateDate;
                entity.CompanyId = model.CompanyId;
            }

            entity.EndDate = model.EndDate;
            entity.Id = model.Id;
            entity.SOBId = model.SOBId;
            entity.StartDate = model.StartDate;
            entity.TaxName = model.TaxName;
            entity.UpdateBy = AuthenticationHelper.UserId;
            entity.UpdateDate = DateTime.Now;

            return entity;
        }
コード例 #2
0
 public string Update(Tax entity)
 {
     Tax originalEntity = this.Context.Taxes.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 TaxModel(Tax entity)
 {
     this.EndDate = entity.EndDate;
     this.Id = entity.Id;
     this.SOBId = entity.SOBId;
     this.StartDate = entity.StartDate;
     this.TaxName = entity.TaxName;
     this.CompanyId = entity.CompanyId;
     this.CreateBy = entity.CreateBy;
     this.UpdateBy = entity.UpdateBy;
     this.UpdateDate = entity.UpdateDate;
 }
コード例 #4
0
 public string Update(Tax entity)
 {
     return this.repository.Update(entity);
 }
コード例 #5
0
 public string Insert(Tax entity)
 {
     return this.repository.Insert(entity);
 }
コード例 #6
0
 public string Insert(Tax entity)
 {
     this.Context.Taxes.Add(entity);
     this.Commit();
     return entity.Id.ToString();
 }