public virtual void EnableDisableLicenseFields(PXCache cache, FSLicense fsLicenseRow, bool enabled) { PXUIFieldAttribute.SetEnabled <FSLicense.licenseTypeID>(cache, fsLicenseRow, !enabled); PXUIFieldAttribute.SetEnabled <FSLicense.descr>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.issueDate>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.expirationDate>(cache, fsLicenseRow, fsLicenseRow.NeverExpires != null ? (bool)!fsLicenseRow.NeverExpires : true); }
protected virtual void FSLicense_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } FSLicense fsLicenseRow = (FSLicense)e.Row; EnableDisableLicenseFields(cache, fsLicenseRow, fsLicenseRow.LicenseTypeID != null); }
public virtual void openLicenseDocument() { FSLicense fsLicenseRow = EmployeeLicenses.Current; LicenseMaint graphLicenseMaintEntry = PXGraph.CreateInstance <LicenseMaint>(); graphLicenseMaintEntry.LicenseRecords.Current = graphLicenseMaintEntry.LicenseRecords.Search <FSLicense.refNbr>(EmployeeLicenses.Current.RefNbr); throw new PXRedirectRequiredException(graphLicenseMaintEntry, null) { Mode = PXBaseRedirectException.WindowMode.NewWindow }; }
protected virtual void _(Events.RowSelected <FSLicense> e) { if (e.Row == null) { return; } FSLicense fsLicenseRow = (FSLicense)e.Row; EnableDisableLicenseFields(e.Cache, fsLicenseRow, fsLicenseRow.LicenseTypeID != null); PXDefaultAttribute.SetPersistingCheck <FSLicense.expirationDate>(e.Cache, fsLicenseRow, fsLicenseRow.NeverExpires != null && fsLicenseRow.NeverExpires == true ? PXPersistingCheck.Nothing : PXPersistingCheck.NullOrBlank); }
protected virtual void _(Events.FieldUpdated <FSLicense, FSLicense.neverExpires> e) { FSLicense fsLicenseRow = (FSLicense)e.Row; if (fsLicenseRow == null) { return; } if (fsLicenseRow.NeverExpires == true) { fsLicenseRow.ExpirationDate = null; } }
private void EnableDisableLicenseFields(PXCache cache, FSLicense fsLicenseRow, bool enabled) { PXUIFieldAttribute.SetEnabled <FSLicense.licenseTypeID>(cache, fsLicenseRow, !enabled); PXUIFieldAttribute.SetEnabled <FSLicense.certificateRequired>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.descr>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.expirationDate>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.initialAmount>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.initialTerm>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.initialTermType>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.issueByVendorID>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.issueDate>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.issuingAgencyName>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.renewalAmount>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.renewalTerm>(cache, fsLicenseRow, enabled); PXUIFieldAttribute.SetEnabled <FSLicense.renewalTermType>(cache, fsLicenseRow, enabled); }
protected virtual void FSLicense_RowPersisting(PXCache cache, PXRowPersistingEventArgs e) { if (e.Row == null) { return; } FSLicense fsLicenseRow = (FSLicense)e.Row; FSSetup fsSetupRow = SetupRecord.Select(); if (string.IsNullOrEmpty(fsSetupRow.LicenseNumberingID)) { EmployeeLicenses.Cache.RaiseExceptionHandling <FSLicense.refNbr>( fsLicenseRow, fsLicenseRow.RefNbr, new PXSetPropertyException(TX.Error.LICENSE_NEED_NUMBERING_ID, PXErrorLevel.RowError)); throw new PXException(TX.Error.LICENSE_NEED_NUMBERING_ID); } }
protected virtual void _(Events.FieldUpdated <FSLicense, FSLicense.licenseTypeID> e) { FSLicense fsLicenseRow = (FSLicense)e.Row; if (fsLicenseRow != null) { if (fsLicenseRow.LicenseTypeID != null) { FSLicenseType fsLicenseTypeRow = PXSelect <FSLicenseType, Where < FSLicenseType.licenseTypeID, Equal <Required <FSLicenseType.licenseTypeID> > > > .Select(new PXGraph(), fsLicenseRow.LicenseTypeID); if (fsLicenseTypeRow != null) { fsLicenseRow.Descr = fsLicenseTypeRow.Descr; } } } }
protected virtual void FSLicense_LicenseTypeID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e) { FSLicense fsLicenseRow = (FSLicense)e.Row; if (fsLicenseRow != null) { if (fsLicenseRow.LicenseTypeID != null) { FSLicenseType fsLicenseTypeRow = PXSelect <FSLicenseType, Where < FSLicenseType.licenseTypeID, Equal <Required <FSLicenseType.licenseTypeID> > > > .Select(new PXGraph(), fsLicenseRow.LicenseTypeID); if (fsLicenseTypeRow != null) { fsLicenseRow.Descr = fsLicenseTypeRow.Descr; } } } }
protected virtual void _(Events.RowPersisting <FSLicense> e) { if (e.Row == null) { return; } FSLicense fsLicenseRow = (FSLicense)e.Row; FSSetup fsSetupRow = SetupRecord.Select(); if (string.IsNullOrEmpty(fsSetupRow.LicenseNumberingID)) { string displayName = DACHelper.GetDisplayName(typeof(FSSetup)); EmployeeLicenses.Cache.RaiseExceptionHandling <FSLicense.refNbr>(fsLicenseRow, fsLicenseRow.RefNbr, new PXSetPropertyException(TX.Error.SPECIFY_LICENSE_NUMBERINGID_IN_X, PXErrorLevel.RowError, displayName)); throw new PXException(TX.Error.SPECIFY_LICENSE_NUMBERINGID_IN_X, displayName); } }