Exemple #1
0
        private bool UpdateOrganisation()
        {
            Facade.IOrganisation facOrganisaton = new Facade.Organisation();
            string userId = ((Entities.CustomPrincipal)Page.User).UserName;

            if (m_organisation.IdentityStatus == eIdentityStatus.Active && m_originalStatus == eIdentityStatus.Unapproved)
            {
                // Approve all the Points for this Client Customer too.
                Facade.IPoint facPoint = new Facade.Point();
                bool          success  = facPoint.ApproveAllPointsForOganisation(m_organisation.IdentityId);
            }


            Entities.FacadeResult retVal = facOrganisaton.Update(m_organisation, userId);

            if (!retVal.Success)
            {
                infringementDisplay.Infringements = retVal.Infringements;
                infringementDisplay.DisplayInfringments();
                infringementDisplay.Visible = true;
            }

            if (Globals.Configuration.ClientCustomerDeliveryNotificationEnabled)
            {
                Repositories.DTOs.GeofenceNotificationSettings settings = new Repositories.DTOs.GeofenceNotificationSettings();
                settings.IdentityId = m_organisation.IdentityId;
                settings.Enabled    = chkBoxEnableNotification.Checked;

                if (chkBoxEnableNotification.Checked)
                {
                    settings.NotificationType = Convert.ToInt32(cbNotificationType.SelectedValue);
                    settings.NotifyWhen       = Convert.ToInt32(cbNotifyWhen.SelectedValue);
                    settings.Recipient        = txtContactDetail.Text;
                }

                facOrganisaton.AddOrUpdate(settings, userId);
            }

            return(retVal.Success);
        }