コード例 #1
0
        public virtual IEnumerable delete(PXAdapter adapter)
        {
            GLVoucherBatch batch = VoucherBatches.Current;

            if (batch == null)
            {
                throw new PXException(Messages.NoBatchesForDelete);
            }
            if (VoucherBatches.Ask(PXMessages.LocalizeFormatNoPrefixNLA(Messages.BatchDeleteConfirmation, batch.VoucherBatchNbr), MessageButtons.OKCancel) == WebDialogResult.OK)
            {
                if (batch.Released == true)
                {
                    throw new PXException(Messages.BatchDeleteReleased);
                }
                List <GLVoucherBatch> fullList = new List <GLVoucherBatch>();
                foreach (GLVoucherBatch voucherBatch in VoucherBatches.Select())                //create list to show all records during processing
                {
                    fullList.Add(voucherBatch);
                }
                PXLongOperation.ClearStatus(this.UID);
                PXLongOperation.StartOperation(this, delegate() { DeleteBatch(batch, fullList.ToArray <object>()); });
                VoucherBatches.View.RequestRefresh();
            }
            return(adapter.Get());
        }
コード例 #2
0
        public virtual IEnumerable GLEditReport(PXAdapter adapter)
        {
            if (this.BatchList.Current != null)
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                int i = 0;
                foreach (Batch batch in adapter.Get())
                {
                    if (batch.Selected == true)
                    {
                        StringBuilder BatchNbr = new StringBuilder("Batch.BatchNbr");
                        BatchNbr.Append(Convert.ToString(i));

                        parameters[BatchNbr.ToString()] = batch.BatchNbr;
                        i++;
                    }
                }

                if (parameters.Count > 0)
                {
                    parameters["LedgerID"]   = null;
                    parameters["PeriodFrom"] = null;
                    parameters["PeriodTo"]   = null;
                    parameters["BranchID"]   = null;
                    throw new PXReportRequiredException(parameters, "GL610500", PXBaseRedirectException.WindowMode.New, "GL Edit");
                }
            }
            return(BatchList.Select());
        }