Esempio n. 1
0
        protected virtual IEnumerable insert(PXAdapter adapter)
        {
            GLWorkBook wb = WorkBook.Select();

            if (wb.SingleOpenVoucherBatch == true)
            {
                int unreleasedCount = PXSelect <GLVoucherBatch,
                                                Where <GLVoucherBatch.workBookID, Equal <Required <GLWorkBook.workBookID> >,
                                                       And <GLVoucherBatch.released, Equal <False> > > > .Select(this, wb.WorkBookID).Count;

                if (unreleasedCount > 0)
                {
                    throw new PXException(Messages.OnlyOneUnreleasedBatchAllowed);
                }
            }
            if (BatchCreation.View.Answer == WebDialogResult.None)
            {
                BatchCreation.Cache.Clear();
            }
            if (BatchCreation.AskExt() == WebDialogResult.OK)
            {
                if (VoucherBatches.Current != null)
                {
                    VoucherBatches.Cache.RaiseExceptionHandling <GLVoucherBatch.voucherBatchNbr>(VoucherBatches.Current,
                                                                                                 VoucherBatches.Current.VoucherBatchNbr, null);
                }
                GLVoucherBatch batch = new GLVoucherBatch();
                batch.Descr = BatchCreation.Current.BatchDescription;
                Numbering numbering        = Numbering.Select();
                bool      isManualNumberig = numbering != null && numbering.UserNumbering == true;
                if (isManualNumberig)
                {
                    batch.VoucherBatchNbr = BatchCreation.Current.VoucherBatchNbr;
                }

                batch = VoucherBatches.Insert(batch);
                this.VoucherBatches.Current = batch;
                Save.Press();
                editRecord.Press();
            }

            return(adapter.Get());
        }
Esempio n. 2
0
        private void SetMessages(KCMSMQueueReader queue)
        {
            foreach (KCMSMQMessage msg in queue.PeekAllMessages())
            {
                if (msg.Inserted.Count > 0 && Messages.Cache.Inserted.RowCast <KCPriceAndInventoryMessage>().All(x => x.MessageID != msg.Id))
                {
                    string message    = String.Join(",", msg.Inserted);
                    var    newMessage = Messages.Insert(new KCPriceAndInventoryMessage()
                    {
                        MessageID       = msg.Id,
                        Address         = queue.Address,
                        Selected        = false,
                        Message         = message.Length > 2500 ? message.Substring(0, 2500) : message,
                        CreatedDateTime = msg.AdditionalInfo.PXPerformanceInfoStartTime
                    });

                    Messages.Cache.SetStatus(newMessage, PXEntryStatus.Inserted);
                }
            }
        }
Esempio n. 3
0
        /* All revisions:
         * public PXSelectJoin<WikiPage,
         * InnerJoin<WikiPageLanguage, On<WikiPageLanguage.pageID, Equal<WikiPage.pageID>>,
         * InnerJoin<WikiRevision, On<WikiRevision.pageID, Equal<WikiPage.pageID>>>>,
         * Where<WikiRevision.plainText, Equal<EmptyString>>> WikiArticles;*/

        public virtual IEnumerable items()
        {
            bool found = false;

            foreach (FullTextIndexRebuildProc.RecordType item in Items.Cache.Inserted)
            {
                found = true;
                yield return(item);
            }
            if (found)
            {
                yield break;
            }

            foreach (Type entity in PXSearchableAttribute.GetAllSearchableEntities(this))
            {
                yield return(Items.Insert(new FullTextIndexRebuildProc.RecordType()
                {
                    Entity = entity.FullName, Name = entity.Name, DisplayName = Caches[entity].DisplayName
                }));
            }

            Items.Cache.IsDirty = false;
        }