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)); } }
/// <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)); } }
public EWPMFormulaMaint() { EWPMSetup setup = Setup.Current; }
/// <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; }