예제 #1
0
 internal void RecalculateDisposals(int disposalRequestLibId, DataContextAsync context)
 {
     foreach (DisposalRequest _drx in this)
     {
         _drx.RecalculateDisposals(disposalRequestLibId, context);
     }
 }
예제 #2
0
        /// <summary>
        /// Recalculates the disposals before committing changes to the website.
        /// </summary>
        /// <param name="disposalRequestLibId">The disposal request library identifier.</param>
        /// <param name="context">The context.</param>
        /// <exception cref="System.ArgumentOutOfRangeException">toDispose;Cannot dispose - tobacco not available.</exception>
        internal void RecalculateDisposals(int disposalRequestLibId, DataContextAsync context)
        {
            List <CustomsWarehouseDisposal> _2Delete = new List <CustomsWarehouseDisposal>();
            List <CustomsWarehouseDisposal> _2Insert = new List <CustomsWarehouseDisposal>();

            foreach (DisposalRequestDetails _dslRqstDtlItem in Items)
            {
                _dslRqstDtlItem.UpdateDisposal(disposalRequestLibId, _2Delete, _2Insert);
            }
            EntityList <CustomsWarehouseDisposal> _Entity = context.GetList <CustomsWarehouseDisposal>(CommonDefinition.CustomsWarehouseDisposalTitle);

            _Entity.InsertAllOnSubmit(_2Insert);
            // _Entity.DeleteAllOnSubmit(_2Delete); TODO to be implemented
        }
예제 #3
0
        /// <summary>
        /// Gets the data context.
        /// </summary>
        /// <param name="disposalRequestLibId">The disposal request library identifier.</param>
        /// <param name="list">The list.</param>
        /// <param name="context">The context.</param>
        internal void GetDataContext(int disposalRequestLibId, List <CustomsWarehouseDisposal> list, DataContextAsync context, Action dataLoaded)
        {
            m_DisposalRequestLibId = disposalRequestLibId;
            IEnumerable <IGrouping <string, CustomsWarehouseDisposal> > _requests = list.GroupBy <CustomsWarehouseDisposal, string>(x => x.CWL_CWDisposal2CustomsWarehouseID.Batch);
            RequestsQueue _Queue = new RequestsQueue(this, context, dataLoaded);

            _Queue.DoAsync(_requests);
        }
예제 #4
0
 internal RequestsQueue(DisposalRequestObservable parent, DataContextAsync context, Action dataLoaded)
 {
     m_Parent      = parent;
     m_DataContext = context;
     m_DataLoaded  = dataLoaded;
 }
예제 #5
0
 public AddNew(DataContextAsync context)
     : this()
 {
     m_DataContext = context;
 }