protected void Vendor_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            Vendor    vendorRow    = (Vendor)e.Row;
            FSxVendor fsxVendorRow = cache.GetExtension <FSxVendor>(vendorRow);

            PXUIFieldAttribute.SetEnabled <FSxVendor.sendAppNotification>(cache, vendorRow, fsxVendorRow.SDEnabled == true);
        }
        public virtual void addVendor()
        {
            var graphVendorMaint = PXGraph.CreateInstance <VendorMaint>();

            graphVendorMaint.Insert.Press();

            FSxVendor fsxVendorRow = graphVendorMaint.CurrentVendor.Cache.GetExtension <FSxVendor>(graphVendorMaint.CurrentVendor.Current);

            fsxVendorRow.SDEnabled = true;

            throw new PXRedirectRequiredException(graphVendorMaint, null)
                  {
                      Mode = PXBaseRedirectException.WindowMode.NewWindow
                  };
        }
        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);
            }
        }
Example #4
0
        /// <summary>
        /// Add the Employee(s) info as a recipient(s) in the Email template generated by Appointment.
        /// </summary>
        private static void AddEmployeeStaffRecipient(
            AppointmentEntry graphAppointmentEntry,
            int?bAccountID,
            string type,
            NotificationRecipient recSetup,
            RecipientList recipients)
        {
            NotificationRecipient recipient = null;
            bool?   appNotification         = false;
            Contact contactRow = null;

            if (type == BAccountType.EmployeeType)
            {
                EPEmployee epEmployeeRow = PXSelect <EPEmployee,
                                                     Where <
                                                         EPEmployee.bAccountID, Equal <Required <EPEmployee.bAccountID> > > >
                                           .Select(graphAppointmentEntry, bAccountID);

                FSxEPEmployee fsxEpEmployeeRow = PXCache <EPEmployee> .GetExtension <FSxEPEmployee>(epEmployeeRow);

                appNotification = fsxEpEmployeeRow.SendAppNotification;

                contactRow = PXSelectJoin <Contact,
                                           InnerJoin <BAccount,
                                                      On <BAccount.parentBAccountID, Equal <Contact.bAccountID>,
                                                          And <BAccount.defContactID, Equal <Contact.contactID> > > >,
                                           Where <
                                               BAccount.bAccountID, Equal <Required <BAccount.bAccountID> >,
                                               And <BAccount.type, Equal <Required <BAccount.type> > > > >
                             .Select(graphAppointmentEntry, bAccountID, type);
            }
            else if (type == BAccountType.VendorType)
            {
                Vendor vendorRow = PXSelect <Vendor,
                                             Where <
                                                 Vendor.bAccountID, Equal <Required <Vendor.bAccountID> > > >
                                   .Select(graphAppointmentEntry, bAccountID);

                FSxVendor fsxVendorRow = PXCache <Vendor> .GetExtension <FSxVendor>(vendorRow);

                appNotification = fsxVendorRow.SendAppNotification;

                contactRow = PXSelectJoin <Contact,
                                           InnerJoin <BAccount,
                                                      On <Contact.contactID, Equal <BAccount.defContactID> > >,
                                           Where <
                                               BAccount.bAccountID, Equal <Required <BAccount.bAccountID> >,
                                               And <BAccount.type, Equal <Required <BAccount.type> > > > >
                             .Select(graphAppointmentEntry, bAccountID, type);
            }

            if (appNotification == true)
            {
                if (contactRow != null && contactRow.EMail != null)
                {
                    recipient = new NotificationRecipient()
                    {
                        Active = true,
                        Email  = contactRow.EMail,
                        Hidden = recSetup.Hidden,
                        Format = recSetup.Format
                    };
                    if (recipient != null)
                    {
                        recipients.Add(recipient);
                    }
                }
            }
        }