Пример #1
0
 public PaymentInvoiceLinesModel(PaymentInvoiceLines entity)
 {
     if (entity != null)
     {
         this.Id = entity.Id;
         this.Amount = entity.Amount;
         this.CreateBy = entity.CreateBy;
         this.CreateDate = entity.CreateDate;
         this.InvoiceId = entity.InvoiceId;
         this.PaymentId = entity.PaymentId;
         this.UpdateBy = entity.UpdateBy;
         this.UpdateDate = entity.UpdateDate;
     }
 }
 public PaymentInvoiceLinesViewModel(PaymentInvoiceLines entity)
 {
     this.Id = entity.Id;
     this.Amount = entity.Amount;
     this.InvoiceId = entity.InvoiceId;
     this.PaymentId = entity.PaymentId;
 }
Пример #3
0
        private static PaymentInvoiceLines getEntityByModel(PaymentInvoiceLinesModel model)
        {
            if (model == null) return null;

            PaymentInvoiceLines entity = new PaymentInvoiceLines
            {
                Amount = model.Amount,
                PaymentId = model.PaymentId,
                InvoiceId = model.InvoiceId,
                Id = model.Id
            };
            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;
        }
Пример #4
0
 public long Update(PaymentInvoiceLines entity)
 {
     return this.repository.Update(entity);
 }
Пример #5
0
 public long Insert(PaymentInvoiceLines entity)
 {
     return this.repository.Insert(entity);
 }
 public long Update(PaymentInvoiceLines entity)
 {
     var originalEntity = this.Context.PaymentInvoiceLines.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id;
 }
 public long Insert(PaymentInvoiceLines entity)
 {
     this.Context.PaymentInvoiceLines.Add(entity);
     this.Commit();
     return entity.Id;
 }