public string Update(GLHeader entity)
 {
     var originalEntity = this.Context.GLHeaders.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id.ToString();
 }
Пример #2
0
 public GLHeaderModel(GLHeader entity)
 {
     this.Id = entity.Id;
     this.SOBId = entity.SOBId;
     this.CompanyId = entity.CompanyId;
     this.PeriodId = entity.PeriodId;
     this.CurrencyId = entity.CurrencyId;
     this.JournalName = entity.JournalName;
     this.Description = entity.Description;
     this.GLDate = entity.GLDate;
     this.DocumentNo = entity.DocumentNo;
     this.ConversionRate = entity.ConversionRate;
     this.CreateBy = entity.CreateBy;
     this.CreateDate = entity.CreateDate;
     this.UpdateBy = entity.UpdateBy;
     this.UpdateDate = entity.UpdateDate;
     this.PeriodName = "";
     this.CurrencyName = "";
 }
 public string Insert(GLHeader entity)
 {
     this.Context.GLHeaders.Add(entity);
     this.Commit();
     return entity.Id.ToString();
 }
 public string Update(GLHeader entity)
 {
     return this.repository.Update(entity);
 }
 public string Insert(GLHeader entity)
 {
     return this.repository.Insert(entity);
 }
Пример #6
0
        private static GLHeader getEntityByModel(GLHeaderModel model)
        {
            if (model == null) return null;

            GLHeader entity = new GLHeader();
            entity.Id = model.Id;
            entity.JournalName = model.JournalName;
            entity.ConversionRate = model.ConversionRate;
            entity.CurrencyId = model.CurrencyId;
            entity.Description = model.Description;
            entity.DocumentNo = model.DocumentNo;
            entity.GLDate = model.GLDate;
            entity.PeriodId = model.PeriodId;
            entity.SOBId = model.SOBId;
            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.UpdateBy = AuthenticationHelper.UserId;
            entity.UpdateDate = DateTime.Now;
            return entity;
        }