Пример #1
0
 /// <summary>
 /// Instantiates a new RemoteManager without a context Event and with the configured default mandator
 /// </summary>
 /// <param name="mobileNumber"></param>
 public RemoteManager(string mobileNumber)
 {
     bll = new EventSiteBL(EventSiteBL.GetDefaultMandator());
     if (!mobileNumber.StartsWith("+"))
     {
         mobileNumber = "+" + mobileNumber;
     }
     senderContact = bll.GetContactByMobileNumber(mobileNumber);
 }
Пример #2
0
        /// <summary>
        /// The constructor of RemoteManager which instantiates a new bll and a new contact
        /// </summary>
        /// <param name="eventId">The event id to subscribe</param>
        /// <param name="mobileNumber">The subscriber's mobile number</param>
        public RemoteManager(string mobileNumber, int eventId)
        {
            contextEvent = EventSiteBL.GetEventById(eventId);
            Mandator mand = contextEvent.EventCategory.Mandator;

            bll = new EventSiteBL(mand);
            if (!mobileNumber.StartsWith("+"))
            {
                mobileNumber = "+" + mobileNumber;
            }
            senderContact = bll.GetContactByMobileNumber(mobileNumber);
        }
Пример #3
0
        protected override void OnInit(EventArgs e)
        {
            string mandQryStr = Request.QueryString["mid"];

            if (mandQryStr == null || mandQryStr == string.Empty)
            {
                throw new EventSiteException("QueryString Parameter 'mid' not found!", 900);
            }
            BLL = new EventSiteBL(mandQryStr);

            base.OnInit(e);
        }
Пример #4
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    bool notifyChange = false;
                    if (IsDriving.Checked)
                    {
                        JourneySubscription.NumLifts = Convert.ToInt32(NumLifts.Text);
                        JourneySubscription.SetJourneyStartTime(JourneyStartTime.Text);
                        JourneySubscription.LiftSubscriptionJourneyStationId = null;
                        notifyChange = BLL.HasSubscriptionLiftsSet(JourneySubscription);
                    }
                    else
                    {
                        if (BLL.HasSubscriptionLiftsSet(JourneySubscription))
                        {
                            RegisterStartupScriptIfNeeded("JourneySaveFailed", string.Format(pbHelpers.JavaScriptAlertString, "Diese Route kann nicht gelöscht werden,\\nda schon Personen definiert sind,\\nwelche mitfahren."));
                            return;
                        }
                        JourneySubscription.NumLifts = null;
                        foreach (JourneyStation journeyStation in JourneySubscription.journeyStations)
                        {
                            journeyStation.SortOrder = -1;
                        }
                    }

                    BLL.EditSubscription(JourneySubscription, false);

                    if (notifyChange)
                    {
                        //notify all lifts about the change
                        BLL.NofityJourneyChange(JourneySubscription);
                    }
#if (DEBUG)
                    System.Threading.Thread.Sleep(2500);
#endif

                    RegisterStartupScriptIfNeeded("JourneySaveSuccess", string.Format(pbHelpers.JavaScriptString, "alert('Routendefinition erfolgreich gespeichert.');fClose();"));
                }
                catch (EventSiteException ex)
                {
                    RegisterStartupScriptIfNeeded("SaveJourneyExc", ex.JavaScriptAlertString);
                    JourneySubscription = BLL.GetSubscription(JourneySubscription.SubscriptionId);
                    EventSiteBL.SetJourneyStations(JourneySubscription);
                }
            }
        }
Пример #5
0
 private void SetNotifSubscriptionFields()
 {
     EventSiteBL.SetSmsNotifSubscriptions(CurrentEvent);
     foreach (SmsNotifSubscription notifSubscription in CurrentEvent.SmsNotifSubscriptions)
     {
         if (notifSubscription.Contact.ContactId.Equals(BLL.CurrentContact.ContactId))
         {
             chkNotifSubscription.Checked = true;
             txtNumSmsNotifications.Text  = notifSubscription.MaxNotifications.IsNull ? "" : notifSubscription.MaxNotifications.ToString();
             return;
         }
     }
     chkNotifSubscription.Checked = false;
     txtNumSmsNotifications.Text  = string.Empty;
 }
Пример #6
0
        public static bool SendSms(string mandatorId, int contactId, string smsText)
        {
            smsText = smsText.Trim();
            if (smsText.Equals(string.Empty))
            {
                throw new EventSiteException("Du kannst keine leeren Nachrichten verschicken.\nBitte einen Text eingeben.", 900);
            }

            using (EventSiteBL bll = new EventSiteBL(mandatorId))
            {
                Contact recipient = bll.GetContact(contactId);
                Contact sender    = bll.CurrentContact;

                bll.SendSms(sender, recipient, smsText);
            }
            return(true);
        }
Пример #7
0
        private void LiftChoice_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            try
            {
                Subscription subscr = Subscription.GetSubscriptionById(SubscriptionsWithLifts, Convert.ToInt32(LiftChoice.SelectedValue));
                EventSiteBL.SetJourneyStations(subscr);

                JourneyStartTime.InnerText = ((JourneyStation)subscr.JourneyStations[0]).StationTime;

                JourneyStationChoice.DataSource     = subscr.JourneyStations;
                JourneyStationChoice.DataTextField  = "Station";
                JourneyStationChoice.DataValueField = "JourneyStationId";
                JourneyStationChoice.DataBind();

                JourneyStationChoice.Items.Insert(0, new ListItem("", ""));
            }
            catch {}
        }
Пример #8
0
        private void Page_Load(object sender, EventArgs e)
        {
            //reponse.exires to avoid caching in modal dialog
            Response.Expires = -1;
            //Response.Cache.SetNoStore();

            if (!BLL.Mandator.IsLiftManagementEnabled)
            {
                throw new EventSiteException("Dieses Feature ist auf diesem Mandanten ausgeschaltet!", -1);
            }

            if (!IsPostBack)
            {
                string sid = Request.QueryString["sid"];
                if (sid == null || sid == string.Empty)
                {
                    throw new EventSiteException("QueryString Parameter 'sid' not found!", 900);
                }
                JourneySubscription = BLL.GetSubscription(Convert.ToInt32(sid));
                EventSiteBL.SetJourneyStations(JourneySubscription);

                pageTitle.InnerText = string.Format("Route von {0} definieren", JourneySubscription.Contact.Name);

                IsDriving.Checked = JourneySubscription.SubscriptionLiftState == LiftState.drives ||
                                    JourneySubscription.SubscriptionLiftState == LiftState.full;
                if (IsDriving.Checked)
                {
                    NumLifts.Text = JourneySubscription.NumLifts.ToString();
                    if (JourneySubscription.JourneyStations.Count > 0)
                    {
                        JourneyStartTime.Text = ((JourneyStation)JourneySubscription.JourneyStations[0]).StationTime;
                    }
                }

                ContactsPastJourneys = BLL.GetPastJourneys(JourneySubscription.Contact);
                FillPastJourneys();
            }

            if (JourneySubscription.SubscriptionLiftState == LiftState.lift)
            {
                RegisterStartupScriptIfNeeded("LiftShouldNotDrive", string.Format(pbHelpers.JavaScriptString, string.Format("alert('Da {0} schon bei jemandem mitfährt, kann nicht\\nnoch eine Route definiert werden. Bei Bedarf muss\\ndie Mitfahrt zuerst entfernt werden.');fClose();", JourneySubscription.Contact.Name)));
            }
        }
Пример #9
0
        private void Page_Load(object sender, EventArgs e)
        {
            //reponse.exires to avoid caching in modal dialog
            Response.Expires = -1;
            //Response.Cache.SetNoStore();

            if (!BLL.Mandator.IsLiftManagementEnabled)
            {
                throw new EventSiteException("Dieses Feature ist auf diesem Mandanten ausgeschaltet!", -1);
            }

            if (!IsPostBack)
            {
                string sid = Request.QueryString["sid"];
                if (sid == null || sid == string.Empty)
                {
                    throw new EventSiteException("QueryString Parameter 'sid' not found!", 900);
                }
                JourneySubscription = BLL.GetSubscription(Convert.ToInt32(sid));
                EventSiteBL.SetJourneyStations(JourneySubscription);

                pageTitle.InnerText = string.Format("Mitfahrt von {0} definieren", JourneySubscription.Contact.Name);

                try
                {
                    FillFormFields();
                }
                catch (EventSiteException ex)
                {
                    RegisterStartupScriptIfNeeded("FillFormFieldsError", ex.JavaScriptAlertString);
                }
            }

            if (BLL.HasSubscriptionLiftsSet(JourneySubscription))
            {
                RegisterStartupScriptIfNeeded("LiftShouldNotDrive", string.Format(pbHelpers.JavaScriptString, string.Format("alert('Da mit {0} schon Personen mitfahren, kann keine\\nMitfahrt definiert werden.');fClose();", JourneySubscription.Contact.Name)));
            }
        }
Пример #10
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();
        }
Пример #11
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Subscription oldSubscription = (JourneySubscription.LiftSubscriptionJourneyStationId.IsNull ? null : GetSubscriptionByJourneyStationId(JourneySubscription.LiftSubscriptionJourneyStationId));
                Subscription newSubscription = (TakesLift.Checked ? GetSubscriptionByJourneyStationId(Convert.ToInt32(JourneyStationChoice.SelectedValue)) : null);

                SaveCase scase = SaveCase.saves_new_lift;
                if (TakesLift.Checked)
                {
                    if (JourneySubscription.LiftSubscriptionJourneyStationId.IsNull)
                    {
                        //saves new lift
                        scase = SaveCase.saves_new_lift;
                    }
                    else
                    {
                        if (JourneySubscription.LiftSubscriptionJourneyStationId == Convert.ToInt32(JourneyStationChoice.SelectedValue))
                        {
                            //saves but no change
                            scase = SaveCase.saves_lift_but_no_change;
                        }
                        else
                        {
                            if (oldSubscription == newSubscription)
                            {
                                //saves a change same subscription
                                scase = SaveCase.saves_lift_change_same_subscription;
                            }
                            else
                            {
                                //saves a change other subscription
                                scase = SaveCase.saves_lift_change_other_subscription;
                            }
                        }
                    }
                    JourneySubscription.NumLifts = null;
                    foreach (JourneyStation journeyStation in JourneySubscription.journeyStations)
                    {
                        journeyStation.SortOrder = -1;
                    }
                    JourneySubscription.LiftSubscriptionJourneyStationId = Convert.ToInt32(JourneyStationChoice.SelectedValue);
                }
                else
                {
                    if (JourneySubscription.LiftSubscriptionJourneyStationId.IsNull)
                    {
                        //saves but no change
                        scase = SaveCase.saves_nolift_but_no_change;
                    }
                    else
                    {
                        //saves remove lift
                        scase = SaveCase.saves_remove_lift;
                    }
                    JourneySubscription.LiftSubscriptionJourneyStationId = null;
                }

                try
                {
                    BLL.EditSubscription(JourneySubscription, false);
                }
                catch (EventSiteException ex)
                {
                    RegisterStartupScriptIfNeeded("SaveLiftExc", ex.JavaScriptAlertString);
                    JourneySubscription = BLL.GetSubscription(JourneySubscription.SubscriptionId);
                    EventSiteBL.SetJourneyStations(JourneySubscription);

                    return;
                }

                string action         = "";
                string definition     = "";
                string successMessage = "Der Fahrer wurde darüber informiert.";
                switch (scase)
                {
                case SaveCase.saves_new_lift:
                    action     = "eine neue Mitfahrt definiert:";
                    definition = string.Format("{0} fährt ab {1} mit. Bemerkung: {2}",
                                               JourneySubscription.Contact.Name,
                                               JourneyStationChoice.SelectedItem.Text,
                                               Comment.Text);
                    BLL.NotifyLiftSave(action, definition, JourneySubscription.Event, newSubscription.Contact, JourneySubscription.Contact);
                    break;

                case SaveCase.saves_lift_change_same_subscription:
                    action     = "eine Mitfahrt geändert. Neu:";
                    definition = string.Format("{0} fährt ab {1} mit. Bemerkung: {2}",
                                               JourneySubscription.Contact.Name,
                                               JourneyStationChoice.SelectedItem.Text,
                                               Comment.Text);
                    BLL.NotifyLiftSave(action, definition, JourneySubscription.Event, newSubscription.Contact, JourneySubscription.Contact);
                    break;

                case SaveCase.saves_lift_change_other_subscription:
                    action     = "eine Mitfahrt entfernt:";
                    definition = string.Format("{0} fährt nicht mit.",
                                               JourneySubscription.Contact.Name);
                    BLL.NotifyLiftSave(action, definition, JourneySubscription.Event, oldSubscription.Contact, JourneySubscription.Contact);

                    action     = "eine neue Mitfahrt definiert:";
                    definition = string.Format("{0} fährt ab {1} mit. Bemerkung: {2}",
                                               JourneySubscription.Contact.Name,
                                               JourneyStationChoice.SelectedItem.Text,
                                               Comment.Text);
                    BLL.NotifyLiftSave(action, definition, JourneySubscription.Event, newSubscription.Contact, JourneySubscription.Contact);
                    break;

                case SaveCase.saves_remove_lift:
                    action     = "eine Mitfahrt entfernt:";
                    definition = string.Format("{0} fährt nicht mit.",
                                               JourneySubscription.Contact.Name);
                    BLL.NotifyLiftSave(action, definition, JourneySubscription.Event, oldSubscription.Contact, JourneySubscription.Contact);
                    break;

                case SaveCase.saves_nolift_but_no_change:
                case SaveCase.saves_lift_but_no_change:
                    //no notification needed
                    successMessage = "Der Fahrer wurde nicht informiert, da keine Änderung gemacht wurde.";
                    break;
                }

                RegisterStartupScriptIfNeeded("JourneySaveSuccess", string.Format(pbHelpers.JavaScriptString, "alert('Mitfahr-Einstellung wurde erfolgreich gespeichert.\\n\\n" + successMessage + "');fClose();"));

#if (DEBUG)
                System.Threading.Thread.Sleep(2500);
#endif
            }
        }
Пример #12
0
 private void UpdateSubscriptionList()
 {
     UpdateSubscriptionList((CurrentEvent != null ? EventSiteBL.ListSubscriptions(CurrentEvent) : null));
 }
Пример #13
0
        private void Default_PreRender(object sender, EventArgs e)
        {
            #region Features
            string featureAssembly;
            string featureAssemblyClassName;
            if (IsCategoryFilterOn && CurrentEventCategory.FeatureAssembly != null)
            {
                featureAssembly          = CurrentEventCategory.FeatureAssembly;
                featureAssemblyClassName = CurrentEventCategory.FeatureAssemblyClassName;
            }
            else
            {
                featureAssembly          = BLL.Mandator.FeatureAssembly;
                featureAssemblyClassName = BLL.Mandator.FeatureAssemblyClassName;
            }
            if (featureAssembly != null)
            {
                try
                {
                    Assembly a       = Assembly.LoadFrom(featureAssembly);
                    IFeature feature = (IFeature)a.CreateInstance(featureAssemblyClassName);
                    //					IFeature feature = (IFeature)a.CreateInstance(BLL.Mandator.FeatureAssemblyClassName, false, BindingFlags.CreateInstance, null, new object[]{Request}, null, null);

                    feature.AddContent(pnlFeature, Request);
                }
                catch (Exception ex)
                {
                    Helpers.TrySendErrorMail(ex);

                    Label lbl = new Label();
                    lbl.Text  = "Beim Versuch das FeatureAssembly auszuführen ist folgender Fehler aufgetreten: ";
                    lbl.Text += ex.ToString();
                    pnlFeature.Controls.Clear();
                    pnlFeature.Controls.Add(lbl);
                }
            }
            #endregion

            EventCategories.Attributes.Add("onchange", String.Format("document.getElementById('{0}').checked = false;document.getElementById('{0}').click();", chkCategoryFilterOn.ClientID));
            EventCategoryFilterPopup.PopupText    = IsCategoryFilterOn ? "Filter deaktivieren" : "Nach Kategorie filtern";
            EventCategoryFilterPopup.PopupIconSrc = IsCategoryFilterOn ? "images\\icons\\filter_on.gif" : "images\\icons\\filter_off.gif";

            if (BLL.Mandator.UseSubscriptions)
            {
                dgrSubscriptions.DataBind();
//				events.DataBind();

                pnlAddSubscription.Visible  = !BLL.IsReader();
                AddSubscriptionCell.Visible = !BLL.IsReader();
                if (!pnlAddContact.Visible)
                {
                    pnlSubscriptions.Visible = true;
                }
                notifSubscription.Visible = true;

//				string styleBlock = @"
//<style type=""text/css"">
//<!--
//#pnlEventContainer > #pnlEvent
//{
//	 width: 10%;
//}
//
//#eventList
//{
//	vertical-align: bottom;
//}
//#eventChooser > #eventList
//{
//	vertical-align: baseline;
//}
//-->
//</style>";
//				if(!IsClientScriptBlockRegistered("StyleHack"))
//					RegisterClientScriptBlock("StyleHack", styleBlock);
                pnlEvent.Style["FLOAT"]               = "left";
                pnlEvent.Style["MARGIN-BOTTOM"]       = "auto";
                pnlEventDetails.Style["MARGIN-RIGHT"] = "auto";

                string clientScript = string.Format(pbHelpers.JavaScriptString, @"
				fResetEventDetailSize();
				
				/*Überwachung von Veränderung der Fenstergrösse initialisieren*/
				window.onresize = fResetEventDetailSize;
");
                RegisterStartupScriptIfNeeded("EventDetailHandling", clientScript);

                if (IsOldEvent)
                {
                    pnlAddSubscription.Visible = false;
                    subscriptionStates.Enabled = false;
                    email.Enabled              = false;
                    email.BackColor            = Color.FromKnownColor(KnownColor.LightGray);
                    subscriptionTime.Enabled   = false;
                    subscriptionTime.BackColor = Color.FromKnownColor(KnownColor.LightGray);
//					maxNotifications.Enabled = false;
//					maxNotifications.BackColor = Color.FromKnownColor(KnownColor.LightGray);
                    txtComment.Enabled                  = false;
                    txtComment.BackColor                = Color.FromKnownColor(KnownColor.LightGray);
                    AddSubscription.Enabled             = false;
                    dgrSubscriptions.Columns[1].Visible = false;
                    dgrSubscriptions.Columns[9].Visible = false;
                }
                else
                {
                    subscriptionStates.Enabled = true;
                    email.Enabled              = true;
                    email.BackColor            = Color.White;
                    subscriptionTime.Enabled   = true;
                    subscriptionTime.BackColor = Color.White;
//					maxNotifications.Enabled = true;
//					maxNotifications.BackColor = Color.White;
                    txtComment.Enabled                  = true;
                    txtComment.BackColor                = Color.White;
                    AddSubscription.Enabled             = true;
                    dgrSubscriptions.Columns[1].Visible = true;
                    dgrSubscriptions.Columns[9].Visible = true;
                }

                dgrSubscriptions.Columns[9].Visible = BLL.Mandator.IsLiftManagementEnabled && dgrSubscriptions.Columns[9].Visible;
            }
            else
            {
//				string styleBlock = @"
//<style type=""text/css"">
//<!--
//#eventDetails
//{
//	width: 100%;
//}
//
//TABLE#pnlEventDetails DIV
//{
//	 width: auto;
//}
//
//#eventList
//{
//	vertical-align: bottom;
//}
//					#eventChooser > #eventList
//					{
//	vertical-align: baseline;
//}
//-->
//</style>";
//				if(!IsClientScriptBlockRegistered("StyleHack"))
//					RegisterClientScriptBlock("StyleHack", styleBlock);

                pnlAddSubscription.Visible  = false;
                AddSubscriptionCell.Visible = false;
                pnlSubscriptions.Visible    = false;
                notifSubscription.Visible   = false;

                pnlEvent.Style["FLOAT"]               = "none";
                pnlEvent.Style["MARGIN-BOTTOM"]       = "20px";
                pnlEventDetails.Style["MARGIN-RIGHT"] = "5px";
            }

            string titleAdd;
            if (CurrentEvent == null)
            {
                titleAdd = "Kein(e) " + BLL.Mandator.EventName + " ausgewählt";
                lblSubscriptions.Text    = "Es ist kein Anlass ausgewählt.";
                dgrSubscriptions.Visible = false;
                legendDiv.Visible        = false;
            }
            else
            {
                titleAdd = CurrentEvent.EventTitle;
                lblSubscriptions.Text    = "Zur Zeit sind für diesen Anlass folgende Einträge vorhanden:";
                dgrSubscriptions.Visible = true;
                legendDiv.Visible        = BLL.Mandator.IsLiftManagementEnabled;
            }
            Page.Title          = BLL.Mandator.SiteTitle + " - " + titleAdd;
            pageTitle.InnerText = BLL.Mandator.SiteTitle + " - " + titleAdd;
            helptext.Text       = BLL.Mandator.HelpText;

            if (pnlAddSubscription.Visible)
            {
                string previousValue = null;
                if (IsPostBack)
                {
                    previousValue = subscriptionStates.SelectedValue;
                }

                subscriptionStates.DataSource = BLL.ListSubscriptionStates(CurrentEvent.EventCategory);
                subscriptionStates.DataBind();
                if (!IsPostBack && subscriptionStates.Items.Count > 0)
                {
                    subscriptionStates.Items[0].Selected = true;
                }
                else if (IsPostBack && subscriptionStates.Items.Count > 0)
                {
                    //try to set previous value
                    try
                    {
                        subscriptionStates.SelectedValue = previousValue;
                    }
                    catch
                    {
                        subscriptionStates.Items[0].Selected = true;
                    }
                }

                subscriptionMailContainer.Visible = BLL.IsAdministrator() || BLL.IsManager();
            }

            if (BLL.IsReader())
            {
                chkNotifSubscription.Visible     = false;
                txtNumSmsNotifications.Visible   = false;
                numSmsNotificationsLabel.Visible = false;

                lblNofifSubscriptionDisabled.Text    = "Da du nur Leserechte besitzt, kannst<br>du diese Option nicht nutzen.";
                lblNofifSubscriptionDisabled.Visible = true;
            }
            else
            {
                if (CurrentEvent != null && EventSiteBL.GetContactSetting(BLL.CurrentContact, CurrentEvent.EventCategory).SmsNotifSubscriptionsOn)
                {
                    chkNotifSubscription.Visible     = true;
                    txtNumSmsNotifications.Visible   = true;
                    numSmsNotificationsLabel.Visible = true;

                    lblNofifSubscriptionDisabled.Visible = false;

                    SetNotifSubscriptionFields();

                    string notifSubscriptionChangeScript = string.Format(@"
<SCRIPT type=""text/javascript"" language=""javascript"">
	
	function UpdateNotifSubscriptionChange()
	{{
		var nofifSubscriptionElem;
		var maxNotificationsElem;
		nofifSubscriptionElem = document.getElementById('{0}'); 
		maxNotificationsElem = document.getElementById('{1}'); 

		document.getElementById('{4}').style.backgroundColor = 'yellow'; 

		var notifSubscriptionOn;
		var maxNotifications;
		notifSubscriptionOn = nofifSubscriptionElem.checked;

		if(notifSubscriptionOn)
		{{
			maxNotifications = maxNotificationsElem.value;
		}}
		else
		{{
			maxNotificationsElem.value = '';
			maxNotifications = '';
		}}
		//alert(notifSubscriptionOn);
		//alert(maxNotifications);

		//ajax postback to update notifSubscription
		EventSiteBL.UpdateNotifSubscription('{2}', {3}, notifSubscriptionOn, maxNotifications, UpdateNotifSubscription_CallBack);
	}}

	function UpdateNotifSubscription_CallBack(response)
	{{
		if (response.error != null)
		{{
			alert(response.error.description + '\nDie Einstellung konnte nicht gespeichert werden!');
		}}
		else
		{{
			document.getElementById('{4}').style.backgroundColor = '#eeeeee'; 
		}}
	}}
</SCRIPT>
",
                                                                         chkNotifSubscription.ClientID,
                                                                         txtNumSmsNotifications.ClientID,
                                                                         BLL.Mandator.MandatorId,
                                                                         CurrentEvent == null ? "" : CurrentEvent.EventId.ToString(),
                                                                         notifSubscription.ClientID);
                    RegisterStartupScriptIfNeeded("notifSubscriptionChangeScript", notifSubscriptionChangeScript);
                    chkNotifSubscription.Attributes.Add("onclick", "UpdateNotifSubscriptionChange();");
                    txtNumSmsNotifications.Attributes.Add("onchange", "UpdateNotifSubscriptionChange();");
                    txtNumSmsNotifications.Attributes.Add("onkeyup", "UpdateNotifSubscriptionChange();");
                }
                else if (CurrentEvent != null)
                {
                    chkNotifSubscription.Visible     = false;
                    txtNumSmsNotifications.Visible   = false;
                    numSmsNotificationsLabel.Visible = false;

                    if (BLL.Mandator.UseEventCategories)
                    {
                        lblNofifSubscriptionDisabled.Text = "Du hast die Abonnierungsfunktion auf dieser<br>Kategorie zur Zeit ausgeschaltet";
                    }
                    else
                    {
                        lblNofifSubscriptionDisabled.Text = "Du hast die Abonnierungsfunktion<br>zur Zeit ausgeschaltet";
                    }
                    lblNofifSubscriptionDisabled.Visible = true;
                }
                else
                {
                    chkNotifSubscription.Checked     = false;
                    txtNumSmsNotifications.Text      = string.Empty;
                    chkNotifSubscription.Visible     = false;
                    txtNumSmsNotifications.Visible   = false;
                    numSmsNotificationsLabel.Visible = false;

                    lblNofifSubscriptionDisabled.Text    = "Momentan ist kein Anlass ausgewählt";
                    lblNofifSubscriptionDisabled.Visible = true;
                }
            }

            events.Visible    = !BLL.Mandator.ShowEventsAsList;
            eventList.Visible = BLL.Mandator.ShowEventsAsList;

            EventDetails_EventUrlLabel.Visible       = BLL.Mandator.UseEventUrl;
            EventDetails_EventUrlControl.Visible     = BLL.Mandator.UseEventUrl;
            EventDetails_MinMaxSubscriptions.Visible = BLL.Mandator.UseMinMaxSubscriptions;
            EventDetails_EventCategory.Visible       = BLL.Mandator.UseEventCategories;
            EventCategoryFilterPopup.Visible         = BLL.Mandator.UseEventCategories;
        }
Пример #14
0
 public List <Subscription> ListSubscriptions()
 {
     return(EventSiteBL.ListSubscriptions(contextEvent));
 }
Пример #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MandatorList.DataSource = EventSiteBL.GetAllMandators();
     MandatorList.DataBind();
 }