Example #1
0
        private static NInt32 EvaluateNInt32TextBox(string val)
        {
            NInt32 v = new NInt32(0, true);

            if (val == null || val == String.Empty)
            {
                return(v);
            }
            try
            {
                v = Convert.ToInt32(val);
            }
            catch
            {
                throw new EventSiteException("Der angegebene Wert für \\'Automatische Abonnierung\\' ist\\nungültig. Erlaubt: Ganze positive Zahl oder leer.", -1);
            }
            return(v);
        }
        public Mandator(string mandatorId, string mandatorName, string mandatorShortName, string mandatorMail, string entryPointUrl, string siteTitle, string eventName, string featureAssembly, string featureAssemblyClassName, string eventNotificationAddressesDefault, bool showEventsAsList, bool useEventCategories, bool useEventUrl, bool useMinMaxSubscriptions, bool useSubscriptions, bool smsNotifications, bool onNewEventNotifyContacts, bool onEditEventNotifyContacts, bool onNewSubscriptionNotifyContacts, bool onEditSubscriptionNotifyContacts, bool onDeleteSubscriptionNotifyContacts, bool isLiftManagementEnabled, bool notifyDeletableSubscriptionStates, string helpText, NInt32 unsubscribeAllowedFromNumSubscriptions, NInt32 unsubscribeAllowedTillNumSubscriptions, int smsLog, int smsPurchased, bool noSmsCreditNotified, bool useExternalAuth, string authTable, string authIdColumn, string authLoginColumn, string authPasswordColumn)
        {
            this.MandatorId                         = mandatorId;
            this.MandatorName                       = mandatorName;
            this.MandatorShortName                  = mandatorShortName;
            this.MandatorMail                       = mandatorMail;
            this.EntryPointUrl                      = entryPointUrl;
            this.SiteTitle                          = siteTitle;
            this.EventName                          = eventName;
            this.FeatureAssembly                    = featureAssembly;
            this.FeatureAssemblyClassName           = featureAssemblyClassName;
            this.EventNotificationAddressesDefault  = eventNotificationAddressesDefault;
            this.ShowEventsAsList                   = showEventsAsList;
            this.UseEventCategories                 = useEventCategories;
            this.UseEventUrl                        = useEventUrl;
            this.UseMinMaxSubscriptions             = useMinMaxSubscriptions;
            this.UseSubscriptions                   = useSubscriptions;
            this.SmsNotifications                   = smsNotifications;
            this.OnNewEventNotifyContacts           = onNewEventNotifyContacts;
            this.OnEditEventNotifyContacts          = onEditEventNotifyContacts;
            this.OnNewSubscriptionNotifyContacts    = onNewSubscriptionNotifyContacts;
            this.OnEditSubscriptionNotifyContacts   = onEditSubscriptionNotifyContacts;
            this.OnDeleteSubscriptionNotifyContacts = onDeleteSubscriptionNotifyContacts;
            this.IsLiftManagementEnabled            = isLiftManagementEnabled;
            this.NotifyDeletableSubscriptionStates  = notifyDeletableSubscriptionStates;
            this.HelpText = helpText;
            this.UnsubscribeAllowedFromNumSubscriptions = unsubscribeAllowedFromNumSubscriptions;
            this.UnsubscribeAllowedTillNumSubscriptions = unsubscribeAllowedTillNumSubscriptions;
            this.SmsLog              = smsLog;
            this.SmsPurchased        = smsPurchased;
            this.NoSmsCreditNotified = noSmsCreditNotified;
            UseExternalAuth          = useExternalAuth;
            AuthTable          = authTable;
            AuthIdColumn       = authIdColumn;
            AuthLoginColumn    = authLoginColumn;
            AuthPasswordColumn = authPasswordColumn;

            isNull = false;
        }
Example #3
0
        public Subscription(Event pEvent, Contact contact, int subscriptionStateId, string subscriptionStateText, string subscriptionTime, string comment, NInt32 numLifts, NInt32 liftSubscriptionJourneyStationId)
        {
            this.SubscriptionId                   = 0;
            this._Event                           = pEvent;
            this.Contact                          = contact;
            this.SubscriptionStateId              = subscriptionStateId;
            this.SubscriptionStateText            = subscriptionStateText;
            this.SubscriptionTime                 = subscriptionTime;
            this.Comment                          = comment;
            this.NumLifts                         = numLifts;
            this.LiftSubscriptionJourneyStationId = liftSubscriptionJourneyStationId;
            this.SubscriptionLiftState            = LiftState.undefined;

            journeyStations = new ArrayList();
        }
Example #4
0
        public Subscription(int subscriptionId, Event pEvent, Contact contact, int subscriptionStateId, string subscriptionStateText, bool subscriptionStateIsDeletable, bool isUnsubscribable, string subscriptionTime, string fontcolor, string comment, NInt32 numLifts, NInt32 liftSubscriptionJourneyStationId, LiftState subscriptionLiftState)
        {
            this.SubscriptionId                   = subscriptionId;
            this._Event                           = pEvent;
            this.Contact                          = contact;
            this.SubscriptionStateId              = subscriptionStateId;
            this.SubscriptionStateText            = subscriptionStateText;
            this.subscriptionStateIsDeletable     = subscriptionStateIsDeletable;
            this.IsUnsubscribable                 = isUnsubscribable;
            this.SubscriptionTime                 = subscriptionTime;
            this.Fontcolor                        = fontcolor;
            this.Comment                          = comment;
            this.NumLifts                         = numLifts;
            this.LiftSubscriptionJourneyStationId = liftSubscriptionJourneyStationId;
            this.SubscriptionLiftState            = subscriptionLiftState;

            journeyStations = new ArrayList();
        }
 public SmsNotifSubscription(Event notifEvent, Contact contact, NInt32 maxNotifications)
 {
     this.NotifEvent       = notifEvent;
     this.Contact          = contact;
     this.MaxNotifications = maxNotifications;
 }
Example #6
0
        private void Save()
        {
            Contact contact       = BLL.CurrentContact;
            bool    showSmsCols   = BLL.Mandator.SmsNotifications;
            bool    showEmailCols = BLL.Mandator.OnNewEventNotifyContacts ||
                                    BLL.Mandator.OnEditEventNotifyContacts ||
                                    BLL.Mandator.OnNewSubscriptionNotifyContacts ||
                                    BLL.Mandator.OnEditSubscriptionNotifyContacts ||
                                    BLL.Mandator.OnDeleteSubscriptionNotifyContacts;

            string emailBefore = contact.Email;

            try
            {
                contact.Name           = Name.Text;
                contact.Email          = Email.Text;
                contact.MobilePhone    = MobilePhone.Text;
                contact.LiftMgmtSmsOn  = LiftMgmtSmsOn.Checked;
                contact.EventMgmtSmsOn = EventMgmtSmsOn.Checked;

                foreach (EventCategory category in BLL.ListEventCategories())
                {
                    ContactSetting setting          = EventSiteBL.GetContactSetting(contact, category);
                    Hashtable      categoryControls = (Hashtable)ViewState[String.Format("ES_CategoryControls_{0}", category.EventCategoryId)];

                    //check if contactsettings have changed --> if not changed set id to 0 to ignore saving this item
                    bool   notifByEmail = false, notifBySms = false, notifSubscr = false;
                    NInt32 autoNotifSubscr = new NInt32(0, true);
                    if (showEmailCols)
                    {
                        notifByEmail = EvaluateCheckBox(Request.Form[(string)categoryControls[String.Format("chkNotifyByEmail_{0}", category.EventCategoryId)]]);
                    }
                    if (showSmsCols)
                    {
                        notifBySms      = EvaluateCheckBox(Request.Form[(string)categoryControls[String.Format("chkNotifyBySms_{0}", category.EventCategoryId)]]);
                        notifSubscr     = EvaluateCheckBox(Request.Form[(string)categoryControls[String.Format("chkSmsNotifSubscription_{0}", category.EventCategoryId)]]);
                        autoNotifSubscr = EvaluateNInt32TextBox(Request.Form[(string)categoryControls[String.Format("tbAutoNotifSubscription_{0}", category.EventCategoryId)]]);
                    }

                    if (showEmailCols && setting.NotifyByEmail != notifByEmail ||
                        showSmsCols && (setting.NotifyBySms != notifBySms ||
                                        setting.SmsNotifSubscriptionsOn != notifSubscr ||
                                        setting.AutoNotifSubscription.IsNull != autoNotifSubscr.IsNull ||
                                        !setting.AutoNotifSubscription.IsNull && setting.AutoNotifSubscription != autoNotifSubscr))
                    {
                        if (showEmailCols)
                        {
                            setting.NotifyByEmail = notifByEmail;
                        }
                        if (showSmsCols)
                        {
                            setting.NotifyBySms             = notifBySms;
                            setting.SmsNotifSubscriptionsOn = notifSubscr;
                            setting.AutoNotifSubscription   = autoNotifSubscr;
                        }
                    }
                    else
                    {
                        setting.ContactSettingId = 0;
                    }
                    //set NotifyBySms in any case, for validation if mobilephone is empty
                    setting.NotifyBySms = notifBySms;
                }
            }
            catch (EventSiteException ex)
            {
                RegisterStartupScriptIfNeeded("invalContactData", ex.JavaScriptAlertString);
                BLL.RenewCurrentContact();
                FillFieldValues();
                return;
            }

            BLL.EditContact(contact);
            BLL.SaveContactSettings(contact);

            if (!contact.Email.Equals(emailBefore))
            {
                //current contact's email has changed --> signout after update
                string signoutScript = string.Format(pbHelpers.JavaScriptString, @"
	alert('Da die eigene Email-Adresse geändert wurde, musst Du dich neu anmelden.');
	document.getElementById('"     + LogoutButton.ClientID + @"').click();
");
                RegisterStartupScriptIfNeeded("signoutScript", signoutScript);

                return;
            }
            else
            {
                RegisterStartupScriptIfNeeded("saveSuccess", String.Format(playboater.gallery.commons.Helpers.JavaScriptAlertString, "Einstellungen erfolgreich gespeichert."));
                BLL.RenewCurrentContact();
            }

            FillFieldValues();
        }
 public ContactSetting(Contact contact, EventCategory category, bool notifyByEmail, bool notifyBySms, bool smsNotifSubscriptionsOn, NInt32 autoNotifSubscription)
 {
     //0 means no change needed, -1 means new setting --> insert into db
     this.ContactSettingId = -1;
     this.Contact          = contact;
     this.Category         = category;
     //use internal private field to set sms notification, for that no mobilephone validation is processed (this constructor is only called by the dataadapter object)
     this.notifyBySms             = notifyBySms;
     this.SmsNotifSubscriptionsOn = smsNotifSubscriptionsOn;
     this.NotifyByEmail           = notifyByEmail;
     this.AutoNotifSubscription   = autoNotifSubscription;
 }
 public ContactSetting(int contactSettingId, Contact Contact, EventCategory category, bool notifyByEmail, bool notifyBySms, bool smsNotifSubscriptionsOn, NInt32 autoNotifSubscription)
 {
     this.ContactSettingId        = contactSettingId;
     this.Contact                 = Contact;
     this.Category                = category;
     this.NotifyBySms             = notifyBySms;
     this.SmsNotifSubscriptionsOn = smsNotifSubscriptionsOn;
     this.NotifyByEmail           = notifyByEmail;
     this.AutoNotifSubscription   = autoNotifSubscription;
 }
Example #9
0
        public Event(int eventId, EventCategory eventCategory, Contact eventCreator, Location location, DateTime startDate, string duration, string eventTitle, string eventDescription, string eventUrl, NInt32 minSubscriptions, NInt32 maxSubscriptions)
        {
            this.EventId          = eventId;
            this.EventCategory    = eventCategory;
            this.EventCreator     = eventCreator;
            this.Location         = location;
            this.StartDate        = startDate;
            this.Duration         = duration;
            this.EventTitle       = eventTitle;
            this.EventDescription = eventDescription;
            this.EventUrl         = eventUrl;
            this.MinSubscriptions = minSubscriptions;
            this.MaxSubscriptions = maxSubscriptions;

            SmsNotifSubscriptions = null;
        }