Ejemplo n.º 1
0
 public void CommitTest()
 {
     ModelGRDelete m = new ModelGRDelete() {
          GRNumber = "5000406156",
          GRItemNumber = "0001",
          UserID = 1513
     };
     GRDelete target = new GRDelete(m); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     actual = target.Commit();
     Assert.AreEqual(expected, actual);
 }
Ejemplo n.º 2
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 ModelGRDelete();
                    if (obj.TraceType == (int)_model.GetTraceType())
                    {
                        _model = (ModelGRDelete)_model.Deserialize(obj.Data);
                        var grs = from o in _dbContext.ABi_GR
                                  where _model.GRIDs.Contains(o.ABi_GR_ID)
                                  select o;
                        foreach (var gr in grs)
                        {
                            gr.Deleted = false;
                        }

                        obj.Status = (int)VPBLL.Trace.eTraceStatus.eRollback;
                        obj.DateModified = DateTime.Now;
                        return _dbContext.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(String.Format("GRDelete.Rollback(TraceID:{0})", _traceInfo.TraceID), ex);
            }
            return -1;
        }
Ejemplo n.º 3
0
 public GRDelete(ModelGRDelete m)
 {
     _model = m;
 }