Esempio n. 1
0
        protected virtual void _(Events.FieldSelecting <EntryMatrix, EntryMatrix.matrixAvailability> eventArgs)
        {
            eventArgs.ReturnValue = null;

            EntryMatrix row = eventArgs.Row;

            if (row != null && row.SelectedColumn != null && Header.Current?.ShowAvailable == true)
            {
                int columnIndex = (int)row.SelectedColumn;

                eventArgs.ReturnValue = GetAvailability(Header.Current.SiteID,
                                                        GetValueFromArray(row.InventoryIDs, columnIndex),
                                                        GetValueFromArray(row.Quantities, columnIndex));
            }
        }
Esempio n. 2
0
        protected virtual void _(Events.FieldSelecting <InventoryItem, InventoryItem.hasChild> eventArgs)
        {
            if (eventArgs.Row?.InventoryID > 0 && eventArgs.Row.IsTemplate == true && eventArgs.Row.HasChild == null)
            {
                var childSelect = new PXSelectReadonly <InventoryItem,
                                                        Where <InventoryItem.templateItemID, Equal <Required <InventoryItem.inventoryID> > > >(this);

                using (new PXFieldScope(childSelect.View, typeof(InventoryItem.inventoryID)))
                {
                    InventoryItem child = childSelect.Select(eventArgs.Row.InventoryID);
                    eventArgs.Row.HasChild = (child != null);
                }
            }

            eventArgs.ReturnValue = eventArgs.Row?.HasChild;
        }
Esempio n. 3
0
 protected virtual void _(Events.FieldSelecting <PMLaborCostRate, PMLaborCostRate.uOM> e)
 {
     if (e.Row != null)
     {
         var           select = new PXSelect <InventoryItem, Where <InventoryItem.inventoryID, Equal <Required <InventoryItem.inventoryID> > > >(this);
         InventoryItem item   = select.Select(e.Row.InventoryID);
         if (item != null)
         {
             e.ReturnValue = item.BaseUnit;
         }
         else
         {
             e.ReturnValue = EPSetup.Hour;
         }
     }
 }
        protected virtual void _(Events.FieldSelecting <KCSiteMaster, KCSiteMaster.envelop> e)
        {
            KCSiteMaster row = (KCSiteMaster)e.Row;

            if (row == null)
            {
                return;
            }

            if (row != null)
            {
                if (row.BaseUrl == null || row.BaseUrl == "")
                {
                    e.ReturnValue = "http://schemas.xmlsoap.org/soap/envelope/";
                }
            }
        }
        protected virtual void _(Events.FieldSelecting <KCSiteMaster, KCSiteMaster.chacheControlHeader> e)
        {
            KCSiteMaster row = (KCSiteMaster)e.Row;

            if (row == null)
            {
                return;
            }

            if (row != null)
            {
                if (row.BaseUrl == null || row.BaseUrl == "")
                {
                    e.ReturnValue = "no-cache";
                }
            }
        }
        protected virtual void _(Events.FieldSelecting <KCSiteMaster, KCSiteMaster.apiResponse> e)
        {
            KCSiteMaster row = (KCSiteMaster)e.Row;

            if (row == null)
            {
                return;
            }

            if (row != null)
            {
                if (row.BaseUrl == null || row.BaseUrl == "")
                {
                    e.ReturnValue = "https://api.channeladvisor.com/ChannelAdvisorAPI/v7/AdminService.asmx";
                }
            }
        }
        protected virtual void _(Events.FieldSelecting <KCSiteMaster, KCSiteMaster.endpointAddressValueShipment> e)
        {
            KCSiteMaster row = (KCSiteMaster)e.Row;

            if (row == null)
            {
                return;
            }

            if (row != null)
            {
                if (row.EndpointAddressValueShipment == null || row.EndpointAddressValueShipment == "")
                {
                    e.ReturnValue = "https://api.channeladvisor.com/ChannelAdvisorAPI/v7/ShippingService.asmx";
                }
            }
        }
Esempio n. 8
0
        protected virtual void _(Events.FieldSelecting <Document, Document.curyID> e)
        {
            bool         curyviewstate = Base.Accessinfo.CuryViewState;
            CurrencyInfo info          = GetCurrencyInfo(e.Row);

            if (info != null)
            {
                if (!curyviewstate)
                {
                    e.ReturnValue = info.CuryID;
                }
                else
                {
                    e.ReturnValue = info.BaseCuryID;
                }
            }
        }
        protected virtual void _(Events.FieldSelecting <KCSiteMaster, KCSiteMaster.webservices> e)
        {
            KCSiteMaster row = (KCSiteMaster)e.Row;

            if (row == null)
            {
                return;
            }

            if (row != null)
            {
                if (row.BaseUrl == null || row.BaseUrl == "")
                {
                    e.ReturnValue = "http://api.channeladvisor.com/webservices/";
                }
            }
        }
        protected virtual void _(Events.FieldSelecting <KCSiteMaster, KCSiteMaster.soapCaptionHeader> e)
        {
            KCSiteMaster row = (KCSiteMaster)e.Row;

            if (row == null)
            {
                return;
            }

            if (row != null)
            {
                if (row.BaseUrl == null || row.BaseUrl == "")
                {
                    e.ReturnValue = "\"http://api.channeladvisor.com/webservices/RequestAccess\"";
                }
            }
        }
        protected virtual void _(Events.FieldSelecting <RSSVWorkOrder, RSSVWorkOrder.nbrOfAssignedOrders> e)
        {
            if (e.Row == null)
            {
                return;
            }

            RSSVEmployeeWorkOrderQty employeeNbrOfOrders = SelectFrom <RSSVEmployeeWorkOrderQty> .
                                                           Where <RSSVEmployeeWorkOrderQty.userid.IsEqual <@P.AsGuid> > .View.Select(this, e.Row.AssignTo);

            if (employeeNbrOfOrders != null)
            {
                e.ReturnValue = employeeNbrOfOrders.NbrOfAssignedOrders.GetValueOrDefault();
            }
            else
            {
                e.ReturnValue = 0;
            }
        }
Esempio n. 12
0
        protected void _(Events.FieldSelecting <SOShipmentExt.usrNote> e)
        {
            SOShipment row = e.Row as SOShipment;
            string     str = string.Empty;

            if (row != null)
            {
                foreach (PXResult <Note> pxResult1 in SelectFrom <Note> .InnerJoin <SOOrder> .On <SOOrder.noteID.IsEqual <Note.noteID> >
                         .InnerJoin <SOOrderShipment> .On <SOOrderShipment.orderType.IsEqual <SOOrder.orderType>
                                                           .And <SOOrderShipment.orderNbr.IsEqual <SOOrder.orderNbr> > >
                         .Where <SOOrderShipment.shipmentNbr.IsEqual <P.AsString> > .View.ReadOnly.Select((PXGraph)this.Base, (object)row.ShipmentNbr))
                {
                    Note note = (Note)pxResult1;
                    if (note.NoteText.Length > 0)
                    {
                        str += note.NoteText + "\n--------------------\n";
                    }
                }
            }
            e.ReturnValue = (object)str;
        }
Esempio n. 13
0
        protected void _(
            Events.FieldSelecting <InventoryAllocDetEnqFilterExt.usrAvailablePlus> e)
        {
            InventoryAllocDetEnqFilter current = this.Base.Filter.Current;

            if (current == null)
            {
                return;
            }
            Events.FieldSelecting <InventoryAllocDetEnqFilterExt.usrAvailablePlus> fieldSelecting = e;
            Decimal?qtyAvail           = current.QtyAvail;
            Decimal?qtyPoFixedOrders   = current.QtyPOFixedOrders;
            Decimal?nullable1          = qtyAvail.HasValue & qtyPoFixedOrders.HasValue ? new Decimal?(qtyAvail.GetValueOrDefault() + qtyPoFixedOrders.GetValueOrDefault()) : new Decimal?();
            Decimal?qtyPoFixedReceipts = current.QtyPOFixedReceipts;
            Decimal?nullable2          = nullable1.HasValue & qtyPoFixedReceipts.HasValue ? new Decimal?(nullable1.GetValueOrDefault() + qtyPoFixedReceipts.GetValueOrDefault()) : new Decimal?();
            Decimal?qtySoFixed         = current.QtySOFixed;
            // ISSUE: variable of a boxed type
            Decimal?local = (nullable2.HasValue & qtySoFixed.HasValue ? new Decimal?(nullable2.GetValueOrDefault() - qtySoFixed.GetValueOrDefault()) : new Decimal?());

            fieldSelecting.ReturnValue = (object)local;
        }
        protected virtual void _(Events.FieldSelecting <KCSiteAssociation, KCSiteAssociation.siteMasterId> e)
        {
            KCSiteAssociation row = (KCSiteAssociation)e.Row;

            if (row == null)
            {
                return;
            }

            if (row != null)
            {
                List <string> allowedText   = new List <string>();
                List <string> allowedValues = new List <string>();
                foreach (KCSiteMaster iSiteMaster in PXSelect <KCSiteMaster> .Select(this))
                {
                    allowedValues.Add(iSiteMaster.SiteMasterCD);
                    allowedText.Add(string.Format(KCConstants.DualParameters, iSiteMaster.SiteMasterCD, iSiteMaster.Descr));
                }

                e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 10, true, typeof(KCSiteMaster.siteMasterCD).Name, false, -1, string.Empty, allowedValues.ToArray(), allowedText.ToArray(), false, null);
            }
        }
        protected virtual void _(Events.FieldSelecting <PMBillingRule, PMBillingRule.accountSource> e)
        {
            if (e.Row != null)
            {
                List <string> allowedValues = new List <string>();
                List <string> allowedLabels = new List <string>();

                if (e.Row.Type == PMBillingType.Transaction)
                {
                    allowedValues.Add(PMAccountSource.None);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_SourceTransaction));
                    allowedValues.Add(PMAccountSource.BillingRule);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_BillingRule));
                    allowedValues.Add(PMAccountSource.Project);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_Project));
                    allowedValues.Add(PMAccountSource.Task);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_Task));
                    allowedValues.Add(PMAccountSource.InventoryItem);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_InventoryItem));
                    allowedValues.Add(PMAccountSource.Customer);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_Customer));
                    allowedValues.Add(PMAccountSource.Employee);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_Employee));
                }
                else
                {
                    allowedValues.Add(PMAccountSource.AccountGroup);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_AccountGroup));
                    allowedValues.Add(PMAccountSource.Project);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_Project));
                    allowedValues.Add(PMAccountSource.Task);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_Task));
                    allowedValues.Add(PMAccountSource.InventoryItem);
                    allowedLabels.Add(Messages.GetLocal(Messages.AccountSource_InventoryItem));
                }

                e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 1, false, typeof(PMBillingRule.accountSource).Name, true, 1, null, allowedValues.ToArray(), allowedLabels.ToArray(), true, allowedValues[0]);
            }
        }
Esempio n. 16
0
        protected virtual void _(Events.FieldSelecting <PMTimeActivity, PMTimeActivity.approvalStatus> e)
        {
            if (e.Row != null)
            {
                List <string> allowedValues = new List <string>();
                List <string> allowedLabels = new List <string>();

                if (e.Row.Released == true)
                {
                    allowedValues.Add(ActivityStatusListAttribute.Released);
                    allowedLabels.Add(Messages.GetLocal(EP.Messages.Released));
                }
                else
                {
                    allowedValues.Add(ActivityStatusListAttribute.Open);
                    allowedLabels.Add(Messages.GetLocal(EP.Messages.Open));
                    allowedValues.Add(ActivityStatusListAttribute.Completed);
                    allowedLabels.Add(Messages.GetLocal(EP.Messages.Completed));
                }

                e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 1, false, typeof(PMTimeActivity.approvalStatus).Name, true, 1, null, allowedValues.ToArray(), allowedLabels.ToArray(), true, ActivityStatusListAttribute.Completed);
            }
        }
Esempio n. 17
0
 protected virtual void _(Events.FieldSelecting <PMLaborCostRate, PMLaborCostRate.taskID> e)
 {
     if (e.Row != null && e.Row.Type == PMLaborCostRateType.Certified)
     {
         e.ReturnState = PXStringState.CreateInstance(null, null, null, nameof(PMLaborCostRate.TaskID), false, null, null, null, null, null, null);
         PXFieldState ss = e.ReturnState as PXFieldState;
         ss.Enabled    = false;
         ss.Visible    = PXAccess.FeatureInstalled <FeaturesSet.projectModule>();
         ss.Visibility = PXAccess.FeatureInstalled <FeaturesSet.projectModule>() ? PXUIVisibility.Visible : PXUIVisibility.Invisible;
         e.Cancel      = true;
     }
     else if (e.Row == null)
     {
         //For Excel Import - make field as editable in order to map the field.
         e.ReturnState = PXStringState.CreateInstance(null, null, null, nameof(PMLaborCostRate.TaskID), false, null, null, null, null, null, null);
         PXFieldState ss = e.ReturnState as PXFieldState;
         ss.Enabled     = true;
         ss.Visible     = PXAccess.FeatureInstalled <FeaturesSet.projectModule>();
         ss.Visibility  = PXAccess.FeatureInstalled <FeaturesSet.projectModule>() ? PXUIVisibility.Visible : PXUIVisibility.Invisible;
         ss.DisplayName = PXUIFieldAttribute.GetDisplayName <PMLaborCostRate.taskID>(e.Cache);
         e.Cancel       = true;
     }
 }
 protected virtual void _(Events.FieldSelecting <CAExpense, CAExpense.adjCuryRate> e)
 {
     e.ReturnValue = CuryRateFieldSelecting <CAExpense.curyInfoID>(e.Cache, e.Row);
 }
 protected virtual void _(Events.FieldSelecting <CATransfer, CATransferMultiCurrency.outCuryRate> e)
 {
     e.ReturnValue = CuryRateFieldSelecting <CATransfer.outCuryInfoID>(e.Cache, e.Row);
 }
 protected virtual void _(Events.FieldSelecting <CATransfer, CATransfer.outCuryID> e)
 {
     e.ReturnValue = CuryIDFieldSelecting <CATransfer.outCuryInfoID>(e.Cache, e.Row);
 }
 protected virtual void _(Events.FieldSelecting <SOInvoice.refNbr> e)
 {
     ShowErrors(e.Cache);
 }
Esempio n. 22
0
 protected virtual void _(Events.FieldSelecting <FWorkgroupID> e)
 {
     FieldSelectingOwnerOrWorkgroup(e);
 }
Esempio n. 23
0
        protected virtual void _(Events.FieldSelecting <PMRateSequence, PMRateSequence.sequence> e)
        {
            PXSelectBase <PMRateDefinition> select = new PXSelect <PMRateDefinition, Where <PMRateDefinition.rateTableID, Equal <Required <PMRateSequence.rateTableID> >,
                                                                                            And <PMRateDefinition.rateTypeID, Equal <Required <PMRateSequence.rateTypeID> > > >, OrderBy <Asc <PMRateDefinition.sequence> > >(this);

            List <string> labels = new List <string>();
            List <int>    values = new List <int>();

            int? retValue   = (int?)e.ReturnValue;
            bool valueValid = false;

            PMRateSequence currentSequence = RateSequence.Current ?? e.Row;

            if (currentSequence != null)
            {
                foreach (PMRateDefinition rd in select.Select(currentSequence.RateTableID, currentSequence.RateTypeID))
                {
                    string description = string.Format("{0} - [ ", rd.Sequence);
                    if (rd.Project == true)
                    {
                        description = description + PXMessages.LocalizeNoPrefix(Messages.Project) + "  ";
                    }
                    if (rd.Task == true)
                    {
                        description = description + PXMessages.LocalizeNoPrefix(Messages.Task) + "  ";
                    }
                    if (rd.AccountGroup == true)
                    {
                        description = description + PXMessages.LocalizeNoPrefix(Messages.AccountGroup) + "  ";
                    }
                    if (rd.RateItem == true)
                    {
                        description = description + PXMessages.LocalizeNoPrefix(Messages.Item) + "  ";
                    }
                    if (rd.Employee == true)
                    {
                        description = description + PXMessages.LocalizeNoPrefix(EP.Messages.Employee) + "  ";
                    }


                    description = description + "] " + rd.Description;

                    if (retValue != null && retValue.Value == rd.Sequence.Value)
                    {
                        valueValid = true;
                    }

                    labels.Add(description);
                    values.Add(Convert.ToInt32(rd.Sequence.Value));
                }
            }


            if (!valueValid && values.Count > 0)
            {
                e.ReturnValue = values[0];
            }

            e.ReturnState = PXIntState.CreateInstance(e.ReturnState, "Sequence", false, 1, null, null,
                                                      values.ToArray(), labels.ToArray(), null, null);
        }
Esempio n. 24
0
 protected virtual void _(Events.FieldSelecting <Document, Document.curyViewState> e)
 {
     e.ReturnValue = Base.Accessinfo.CuryViewState;
 }
Esempio n. 25
0
 protected virtual void _(Events.FieldSelecting <SOInvoice.refNbr> e)
 {
     e.Cache.RaiseExceptionHandling <SOInvoice.refNbr>(null, null, new PXSetPropertyException("Something bad happened"));
 }
Esempio n. 26
0
 /// <summary> Set engrRef Disabled </summary>
 public void _(Events.FieldSelecting <ENGineering.engrRef> e)
 => PXUIFieldAttribute.SetEnabled <ENGineering.engrRef>(e.Cache, null, false);