Esempio n. 1
0
        private void BindData()
        {
            var objEventInfoHelper        = new EventInfoHelper(this.ModuleId, this.TabId, this.PortalId, this.Settings);
            var objEventTimeZoneUtilities = new EventTimeZoneUtilities();

            this._eventModeration = new ArrayList();
            switch (this.rbModerate.SelectedValue)
            {
            case "Events":
                this._eventModeration =
                    objEventInfoHelper.ConvertEventListToDisplayTimeZone(
                        this._objCtlEvent.EventsModerateEvents(this.ModuleId, this.GetUrlGroupId()),
                        this.GetDisplayTimeZoneId());

                this._eventRecurModeration = new ArrayList();
                this._eventRecurModeration =
                    this._objCtlEventRecurMaster.EventsRecurMasterModerate(this.ModuleId, this.GetUrlGroupId());
                foreach (EventRecurMasterInfo objRecurMaster in this._eventRecurModeration)
                {
                    objRecurMaster.Dtstart = objEventTimeZoneUtilities
                                             .ConvertToDisplayTimeZone(objRecurMaster.Dtstart, objRecurMaster.EventTimeZoneId,
                                                                       this.PortalId, this.GetDisplayTimeZoneId()).EventDate;
                }

                //Get data for selected date and fill grid
                this.grdEvents.DataSource = this._eventModeration;
                this.grdEvents.DataBind();

                if (this._eventRecurModeration.Count > 0)
                {
                    this.grdRecurEvents.DataSource = this._eventRecurModeration;
                    this.grdRecurEvents.DataBind();
                    this.grdRecurEvents.Visible = true;
                }

                this.grdEvents.Visible     = true;
                this.grdEnrollment.Visible = false;
                break;

            case "Enrollment":
                this._eventModeration =
                    this._objCtlEventSignups.EventsModerateSignups(this.ModuleId, this.GetUrlGroupId());

                var objSignup = default(EventSignupsInfo);
                foreach (EventSignupsInfo tempLoopVar_objSignup in this._eventModeration)
                {
                    objSignup = tempLoopVar_objSignup;
                    if (objSignup.UserID != -1)
                    {
                        objSignup.UserName = objEventInfoHelper
                                             .UserDisplayNameProfile(objSignup.UserID, objSignup.UserName, this.LocalResourceFile)
                                             .DisplayNameURL;
                    }
                    else
                    {
                        objSignup.UserName = objSignup.AnonName;
                        objSignup.Email    = objSignup.AnonEmail;
                    }
                    if (objSignup.Email == "")
                    {
                        objSignup.EmailVisible = false;
                    }
                    else
                    {
                        objSignup.EmailVisible = true;
                    }
                    objSignup.EventTimeBegin = objEventTimeZoneUtilities
                                               .ConvertToDisplayTimeZone(objSignup.EventTimeBegin, objSignup.EventTimeZoneId,
                                                                         this.PortalId, this.GetDisplayTimeZoneId()).EventDate;
                }

                //Get data for selected date and fill grid
                this.grdEnrollment.DataSource = this._eventModeration;
                this.grdEnrollment.DataBind();
                //Add Remove Popup to grid
                var i = 0;
                if (this.grdEnrollment.Items.Count > 0)
                {
                    for (i = 0; i <= this.grdEnrollment.Items.Count - 1; i++)
                    {
                        //Are You Sure You Wish To Email the User?'
                        ((ImageButton)this.grdEnrollment.Items[i].FindControl("btnUserEmail")).Attributes.Add(
                            "onclick",
                            "javascript:return confirm('" +
                            Localization
                            .GetString(
                                "ConfirmModerateSendMailToUser",
                                this
                                .LocalResourceFile) +
                            "');");
                        ((ImageButton)this.grdEnrollment.Items[i].FindControl("btnUserEmail")).AlternateText =
                            Localization.GetString("EmailUser", this.LocalResourceFile);
                        ((ImageButton)this.grdEnrollment.Items[i].FindControl("btnUserEmail")).ToolTip =
                            Localization.GetString("EmailUser", this.LocalResourceFile);
                    }
                    this.grdEvents.Visible      = false;
                    this.grdRecurEvents.Visible = false;
                    this.grdEnrollment.Visible  = true;
                }
                break;
            }
            if (this._eventModeration.Count < 1)
            {
                //"No New Events/Enrollments to Moderate..."
                this.lblMessage.Text = Localization.GetString("MsgModerateNothingToModerate", this.LocalResourceFile);
                this.ShowButtonsGrid(false);
            }
            else
            {
                //Deny option will delete Event/Enrollment Entries from the Database!"
                this.lblMessage.Text = Localization.GetString("MsgModerateNoteDenyOption", this.LocalResourceFile);
                this.ShowButtonsGrid(true);
            }
        }