Exemplo n.º 1
0
        public int Rollback()
        {
            try
            {
                var objs = from o in _dbContext.ABi_Trace
                           where o.ABi_Trace_ID == _traceInfo.TraceID
                           select o;

                if (objs != null && objs.Count() > 0)
                {
                    var obj = objs.First();
                    _model = new ModelInvoiceUpdate();
                    if (obj.TraceType == (int)_model.GetTraceType())
                    {
                        _model = (ModelInvoiceUpdate)_model.Deserialize(obj.Data);
                        var ivs = from o in _dbContext.ABi_Invoice
                                  where o.ABi_Invoice_ID == _model.InvoiceID
                                  select o;
                        var iv = ivs.First();
                        iv.InvoiceNumber = _model.InvoiceNumber;
                        iv.DatePayment = _model.DatePayment;
                        iv.PayAmount = _model.Payamount;

                        obj.Status = (int)VPBLL.Trace.eTraceStatus.eRollback;
                        _dbContext.SaveChanges();
                        return 0;
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(String.Format("IVUpdate.Rollback(TraceID:{0})", _traceInfo.TraceID), ex);
            }

            return -1;
        }
Exemplo n.º 2
0
 public InvoiceUpdate(ModelInvoiceUpdate model)
 {
     _model = model;
 }