protected virtual void EPEmployee_RowPersisting(PXCache cache, PXRowPersistingEventArgs e) { if (e.Row == null) { return; } EPEmployee epEmployeeRow = (EPEmployee)e.Row; FSxEPEmployee fsxEPEmployeeRow = PXCache <EPEmployee> .GetExtension <FSxEPEmployee>(epEmployeeRow); if (e.Operation != PXDBOperation.Delete) { LicenseHelper.CheckStaffMembersLicense(cache.Graph, epEmployeeRow.BAccountID, fsxEPEmployeeRow.SDEnabled, epEmployeeRow.Status); } fsxEPEmployeeRow.IsDriver = EmployeeDriverSkills.Select().Count > 0; Contact contactRow = Base.Contact.Current; if (contactRow != null) { if (fsxEPEmployeeRow.SendAppNotification == true && contactRow.EMail == null) { if (Base.Contact.Cache.RaiseExceptionHandling <Contact.eMail>(contactRow, contactRow.EMail, new PXException(TX.Error.EMAIL_CANNOT_BE_NULL_IF_SENDAPPNOTIFICATION_IS_TRUE))) { throw new PXRowPersistingException(typeof(Contact.eMail).Name, contactRow.EMail, TX.Error.EMAIL_CANNOT_BE_NULL_IF_SENDAPPNOTIFICATION_IS_TRUE, typeof(Contact.eMail).Name); } } } }
protected virtual void Vendor_RowPersisting(PXCache cache, PXRowPersistingEventArgs e) { if (e.Row == null) { return; } var vendorRow = (Vendor)e.Row; FSxVendor fsxVendorRow = cache.GetExtension <FSxVendor>(vendorRow); if (e.Operation != PXDBOperation.Delete) { LicenseHelper.CheckStaffMembersLicense(cache.Graph, vendorRow.BAccountID, fsxVendorRow.SDEnabled, vendorRow.Status); } }
protected virtual void _(Events.RowPersisting <EPEmployee> e) { if (e.Row == null) { return; } EPEmployee epEmployeeRow = (EPEmployee)e.Row; FSxEPEmployee fsxEPEmployeeRow = PXCache <EPEmployee> .GetExtension <FSxEPEmployee>(epEmployeeRow); if (e.Operation != PXDBOperation.Delete) { LicenseHelper.CheckStaffMembersLicense(e.Cache.Graph, epEmployeeRow.BAccountID, fsxEPEmployeeRow.SDEnabled, epEmployeeRow.Status); } fsxEPEmployeeRow.IsDriver = EmployeeDriverSkills.Select().Count > 0; }