public string Update(GLLines entity)
 {
     var originalEntity = this.Context.GLLines.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id.ToString();
 }
 public string Update(GLLines entity)
 {
     return this.repository.Update(entity);
 }
 public string Insert(GLLines entity)
 {
     return this.repository.Insert(entity);
 }
 public GLLinesModel(GLLines entity)
 {
     this.Id = entity.Id;
     this.HeaderId = entity.HeaderId;
     this.CodeCombinationId = entity.CodeCombinationId;
     this.EnteredCr = entity.EnteredCr;
     this.EnteredDr = entity.EnteredDr;
     this.AccountedCr = entity.AccountedCr;
     this.AccountedDr = entity.AccountedDr;
     this.Quantity = entity.Qty;
     this.Description = entity.Description;
     this.TaxRateCode = entity.TaxRateCode;
     this.CreateBy = entity.CreateBy;
     this.CreateDate = entity.CreateDate;
     this.UpdateBy = entity.UpdateBy;
     this.UpdateDate = entity.UpdateDate;
 }
        private static GLLines getEntityByModel(GLLinesModel model, decimal conversionRate)
        {
            if (model == null) return null;

            GLLines entity = new GLLines();
            entity.Id = model.Id;
            entity.HeaderId = model.HeaderId;
            entity.CodeCombinationId = model.CodeCombinationId;
            entity.Description = model.Description;
            entity.EnteredCr = model.EnteredCr;
            entity.EnteredDr = model.EnteredDr;
            entity.AccountedCr = model.EnteredCr * conversionRate;
            entity.AccountedDr = model.EnteredDr * conversionRate;
            entity.Qty = model.Quantity;
            entity.TaxRateCode = model.TaxRateCode;
            if (model.Id == 0)
            {
                entity.CreateBy = AuthenticationHelper.UserId;
                entity.CreateDate = DateTime.Now;
            }
            else
            {
                entity.CreateBy = model.CreateBy;
                entity.CreateDate = model.CreateDate;
            }
            entity.UpdateBy = AuthenticationHelper.UserId;
            entity.UpdateDate = DateTime.Now;
            return entity;
        }
 public string Insert(GLLines entity)
 {
     this.Context.GLLines.Add(entity);
     this.Commit();
     return entity.Id.ToString();
 }