Beispiel #1
0
        protected virtual void Validate(PXCache cache, EWPMSetup row)
        {
            EWPMSetup setup = row;

            if (!string.IsNullOrEmpty(setup.SystemWeightUnit) && !string.IsNullOrEmpty(setup.SystemVolumeUnit))
            {
                if (string.Compare(setup.SystemWeightUnit, setup.SystemVolumeUnit, true) == 0)
                {
                    cache.RaiseExceptionHandling <EWPMSetup.systemVolumeUnit>(row, row.SystemVolumeUnit, new PXSetPropertyException("Weight and volume both can not be same.", PXErrorLevel.RowError));
                }
            }
            else if (!string.IsNullOrEmpty(setup.SystemWeightUnit) && string.IsNullOrEmpty(setup.SystemVolumeUnit))
            {
                cache.RaiseExceptionHandling <EWPMSetup.systemVolumeUnit>(row, row.SystemVolumeUnit, new PXSetPropertyException("Volume can not be empty.", PXErrorLevel.RowError));
            }
        }
Beispiel #2
0
        /// <summary>
        /// Event will execute on changed the value of a volume.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void _(Events.FieldVerifying <EWPMSetup, EWPMSetup.systemVolumeUnit> e)
        {
            EWPMSetup setup  = e.Row;
            string    volume = Convert.ToString(e.NewValue);

            if (!string.IsNullOrEmpty(setup.SystemWeightUnit) && !string.IsNullOrEmpty(volume))
            {
                if (string.Compare(setup.SystemWeightUnit, volume, true) == 0)
                {
                    e.Cache.RaiseExceptionHandling <EWPMSetup.systemVolumeUnit>(e.Row, e.NewValue, new PXSetPropertyException("Weight and volume both can not be same.", PXErrorLevel.RowError));
                }
            }
            else if (!string.IsNullOrEmpty(setup.SystemWeightUnit) && string.IsNullOrEmpty(volume))
            {
                e.Cache.RaiseExceptionHandling <EWPMSetup.systemVolumeUnit>(e.Row, volume, new PXSetPropertyException("Volume can not be empty.", PXErrorLevel.RowError));
            }
        }
Beispiel #3
0
 public EWPMFormulaMaint()
 {
     EWPMSetup setup = Setup.Current;
 }
Beispiel #4
0
        /// <summary>
        /// Event will execute on changed the value of a volume.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void _(Events.FieldUpdated <EWPMSetup, EWPMSetup.systemWeightUnit> e)
        {
            EWPMSetup setup = e.Row;

            setup.SystemVolumeUnit = string.Empty;
        }