Beispiel #1
0
 /// <summary>The RowSelected event handler for the <see cref="Document" /> DAC. The handler sets the value of the Enabled property of <see cref="Document.CuryID"/> according to the value of this property of <see cref="CurySource.AllowOverrideCury"/>.</summary>
 /// <param name="e">Parameters of the event.</param>
 protected virtual void _(Events.RowSelected <Document> e)
 {
     if (e.Row != null)
     {
         CurySource source = CurrentSourceSelect();
         PXUIFieldAttribute.SetEnabled <Document.curyID>(e.Cache, e.Row,
                                                         (source == null || source.AllowOverrideCury == true) && !Base.Accessinfo.CuryViewState);
     }
 }
Beispiel #2
0
 /// <summary>The FieldDefaulting2 event handler for the <see cref="CurrencyInfo.CuryRateTypeID" /> field. The CuryRateTypeID field takes the current value of <see cref="CurySource.CuryRateTypeID"/>.</summary>
 /// <param name="e">Parameters of the event.</param>
 protected virtual void _(Events.FieldDefaulting <CurrencyInfo, CurrencyInfo.curyRateTypeID> e)
 {
     if (PXAccess.FeatureInstalled <FeaturesSet.multicurrency>())
     {
         CurySource source = CurrentSourceSelect();
         if (!string.IsNullOrEmpty(source?.CuryRateTypeID))
         {
             e.NewValue = source.CuryRateTypeID;
             e.Cancel   = true;
         }
     }
 }
Beispiel #3
0
 /// <summary>The FieldDefaulting2 event handler for the <see cref="CurrencyInfo.CuryRateTypeID" /> field. The CuryRateTypeID field takes the current value of <see cref="CurySource.CuryRateTypeID"/>.</summary>
 /// <param name="e">Parameters of the event.</param>
 protected virtual void _(Events.FieldDefaulting <CurrencyInfo, CurrencyInfo.curyRateTypeID> e)
 {
     if (PXAccess.FeatureInstalled <FeaturesSet.multicurrency>())
     {
         CurySource source = CurrentSourceSelect();
         if (!string.IsNullOrEmpty(source?.CuryRateTypeID))
         {
             e.NewValue = source.CuryRateTypeID;
             e.Cancel   = true;
         }
         else if (e.Row != null && !String.IsNullOrEmpty(e.Row.ModuleCode))
         {
             e.NewValue = ServiceLocator.Current.GetInstance <Func <PXGraph, IPXCurrencyService> >()(Base).DefaultRateTypeID(e.Row.ModuleCode);
             e.Cancel   = true;
         }
     }
 }
Beispiel #4
0
        /// <summary>The RowSelected event handler for the <see cref="CurrencyInfo" /> DAC. The handler sets the values of the Enabled property of the UI fields of <see cref="CurrencyInfo"/> according to the values of this property of the corresponding fields of <see cref="CurySource"/>.</summary>
        /// <param name="e">Parameters of the event.</param>
        protected virtual void _(Events.RowSelected <CurrencyInfo> e)
        {
            if (e.Row != null)
            {
                bool       curyenabled = true;
                CurySource source      = CurrentSourceSelect();

                if (source != null && source.AllowOverrideRate != true)
                {
                    curyenabled = false;
                }

                PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyRateTypeID>(e.Cache, e.Row, curyenabled);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyEffDate>(e.Cache, e.Row, curyenabled);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.sampleCuryRate>(e.Cache, e.Row, curyenabled);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.sampleRecipRate>(e.Cache, e.Row, curyenabled);
            }
        }
Beispiel #5
0
 /// <summary>The FieldDefaulting2 event handler for the <see cref="CurrencyInfo.CuryID" /> field. The CuryID field takes the current value of <see cref="CurySource.CuryID"/>.</summary>
 /// <param name="e">Parameters of the event.</param>
 protected virtual void _(Events.FieldDefaulting <CurrencyInfo, CurrencyInfo.curyID> e)
 {
     if (PXAccess.FeatureInstalled <FeaturesSet.multicurrency>())
     {
         CurySource source = CurrentSourceSelect();
         if (!string.IsNullOrEmpty(source?.CuryID))
         {
             e.NewValue = source.CuryID;
         }
         else
         {
             e.NewValue = ServiceLocator.Current.GetInstance <Func <PXGraph, IPXCurrencyService> >()(Base).BaseCuryID();
         }
     }
     else
     {
         e.NewValue = ServiceLocator.Current.GetInstance <Func <PXGraph, IPXCurrencyService> >()(Base).BaseCuryID();
     }
     e.Cancel = true;
 }
Beispiel #6
0
        /// <summary>The RowSelected event handler for the <see cref="CurrencyInfo" /> DAC. The handler sets the values of the Enabled property of the UI fields of <see cref="CurrencyInfo"/> according to the values of this property of the corresponding fields of <see cref="CurySource"/>.</summary>
        /// <param name="e">Parameters of the event.</param>
        protected virtual void _(Events.RowSelected <CurrencyInfo> e)
        {
            if (e.Row != null)
            {
                bool       curyenabled = true;
                CurySource source      = CurrentSourceSelect();

                if (source != null && source.AllowOverrideRate != true ||
                    e.Row.IsReadOnly == true || (e.Row.CuryID == e.Row.BaseCuryID))
                {
                    curyenabled = false;
                }

                PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyMultDiv>(e.Cache, e.Row, curyenabled);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.baseCuryID>(e.Cache, e.Row, false);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.displayCuryID>(e.Cache, e.Row, false);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyID>(e.Cache, e.Row, true);

                PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyRateTypeID>(e.Cache, e.Row, curyenabled);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyEffDate>(e.Cache, e.Row, curyenabled);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.sampleCuryRate>(e.Cache, e.Row, curyenabled);
                PXUIFieldAttribute.SetEnabled <CurrencyInfo.sampleRecipRate>(e.Cache, e.Row, curyenabled);
            }
        }