Пример #1
0
 public bool SetFieldStatus(int otherRevenueId, string fieldname, bool included)
 {
     try
     {
         var provider = new OtherRevenueTableProvider(_context);
         var entity   = provider.Retrieve(otherRevenueId);
         if (entity != null)
         {
             if (fieldname == "IncludeOnStatement")
             {
                 entity.IncludeOnStatement = included;
                 provider.Update(entity.OtherRevenueId, entity);
                 provider.Commit();
                 return(true);
             }
             else // not supported field; just ignore for now...
             {
                 return(true);
             }
         }
     }
     catch
     {
         throw;
     }
     return(false);
 }
Пример #2
0
 public override void Update(int id, OtherRevenueModel model)
 {
     try
     {
         var dataProvider = new OtherRevenueTableProvider(_context);
         var entity       = dataProvider.Retrieve(model.OtherRevenueId);
         MapData(model, ref entity);
         dataProvider.Update(id, entity);
     }
     catch
     {
         throw;
     }
 }
Пример #3
0
 public override void Create(OtherRevenueModel model)
 {
     try
     {
         OtherRevenue entity = new OtherRevenue();
         MapData(model, ref entity);
         var dataProvider = new OtherRevenueTableProvider(_context);
         dataProvider.Create(entity);
     }
     catch
     {
         throw;
     }
 }
Пример #4
0
 public override void Delete(int id)
 {
     try
     {
         // entity deletion does not physically delete the record; it marks [IsDeletd] = true
         var dataProvider = new OtherRevenueTableProvider(_context);
         var entity       = dataProvider.Retrieve(id);
         entity.IsDeleted = true;
         dataProvider.Update(id, entity);
     }
     catch
     {
         throw;
     }
 }
Пример #5
0
 public RevenueApprovalStatus?MoveWorkflow(int otherRevenueId, RevenueApprovalStatus state)
 {
     try
     {
         var dataProvider = new OtherRevenueTableProvider(_context);
         var entity       = dataProvider.Retrieve(otherRevenueId);
         var nextState    = NextState(state);
         if (entity != null && nextState != null)
         {
             entity.ApprovalStatus = state;
             SetWorkflowSignature(ref entity, state);
             dataProvider.Update(otherRevenueId, entity);
             dataProvider.Commit();
             return(nextState);
         }
     }
     catch
     {
         throw;
     }
     return(null);
 }
Пример #6
0
 public RevenueApprovalStatus?BacktrackWorkflow(int reservationId, RevenueApprovalStatus state)
 {
     try
     {
         var dataProvider = new OtherRevenueTableProvider(_context);
         var entity       = dataProvider.Retrieve(reservationId);
         var prevState    = PrevState(state);
         if (entity != null && prevState != null)
         {
             entity.ApprovalStatus = prevState.Value;
             RetrackWorkflowSignature(ref entity, state);
             dataProvider.Update(reservationId, entity);
             dataProvider.Commit();
             return(prevState);
         }
     }
     catch
     {
         throw;
     }
     return(null);
 }