protected void listaMenu_Click(object sender, BulletedListEventArgs e)
        {
            // se realizo un click en el control
            // sacar con TEXT

            Console.WriteLine(this.listaMenu.Items[e.Index].Value + " " + this.listaMenu.Items[e.Index].Text );
        }
Beispiel #2
0
 protected void bltMenu_Click(object sender, BulletedListEventArgs e)
 {
     home.Visible = false;
     string menu = bltMenu.Items[e.Index].Value;
     iframe.Visible = true;
     iframe.Src = menu ;
 }
        protected void LstWebsites_Click(Object sender, BulletedListEventArgs e)
        {
            ListItem item = this.LstWebsites.Items[e.Index];
            SiteHelper.SetActiveSiteCookie(item.Value);
            SiteHelper.Configure(Data.Guid.New(item.Value));

            Response.Redirect("~/auth/Default.aspx");
        }
        protected void BulletedList1_Click(object sender, BulletedListEventArgs e)
        {
            ListItem li = BulletedList1.Items[e.Index];

            Response.Write("Text = "+ li.Text + "<br/>");
            Response.Write("Value = " + li.Value + "<br/>");
            Response.Write("Index = " + e.Index.ToString() + "<br/>");
        }
        protected void lbSource_Click(object sender, BulletedListEventArgs e)
        {
            foreach (ListItem item in lbSource.Items)
            {
                item.Selected = false;
            }

            lbSource.Items[e.Index].Selected = true;

            LinqDataSourceCampaign.DataBind();
            ListView1.DataBind();
            ucCampaign1.CampaignID = 0;
        }
        protected void BulletedList4_Click1(object sender, BulletedListEventArgs e)
        {
            //Label1.Text = "The Index of Item you clicked: " + e.Index + "<br> The value of Item you clicked: " + BulletedList4.Items[e.Index].Text;
            foreach(ListItem li in BulletedList4.Items)
                li.Attributes.Add("class", "off");

            BulletedList4.Items[e.Index].Attributes.Add("class", "on");

            ProfileView.ActiveViewIndex = e.Index;

            switch (ProfileView.ActiveViewIndex)
            {
                case 3:
                    lstAllProjects.Items.Clear();
                    lstSelectedProjects.Items.Clear();
                    lstAllProjects.DataSource = Project.GetProjectsByMemberUserName(Security.GetUserName());
                    lstAllProjects.DataTextField = "Name";
                    lstAllProjects.DataValueField = "Id";
                    lstAllProjects.DataBind();

                    // Copy selected users into Selected Users List Box
                    List<ProjectNotification> projectNotifications = ProjectNotification.GetProjectNotificationsByUsername(Security.GetUserName());
                    foreach (ProjectNotification currentNotification in projectNotifications)
                    {
                        ListItem matchItem = lstAllProjects.Items.FindByValue(currentNotification.ProjectId.ToString());
                        if (matchItem != null)
                        {
                            lstSelectedProjects.Items.Add(matchItem);
                            lstAllProjects.Items.Remove(matchItem);
                        }
                    }

                    //ProjectNotification.GetProjectNotificationsByUsername(Security.GetUserName());
                    NotificationManager nm = new NotificationManager();
                    CheckBoxList1.DataSource = nm.LoadNotificationTypes().FindAll(delegate(INotificationType t) { return t.Enabled == true; });
                    CheckBoxList1.DataTextField = "Name";
                    CheckBoxList1.DataValueField = "Name";
                    CheckBoxList1.DataBind();
                    string[] notificationTypes = WebProfile.Current.NotificationTypes.Split(';');
                    foreach (string s in notificationTypes)
                    {
                        ListItem currentCheckBox = CheckBoxList1.Items.FindByText(s);
                        if (currentCheckBox != null)
                            currentCheckBox.Selected = true;

                    }
                    break;
            }
        }
Beispiel #7
0
        protected void BulletedList1_Click(object sender, System.Web.UI.WebControls.BulletedListEventArgs e)
        {
            //Response.Write("You selected: " + e.Index + ": " + VoteList.Items[e.Index].Text);
            modify_topic = VoteList.Items[e.Index].Text;
            //Response.Write("modify topic:" + modify_topic);
            _Default.MySQLconnect();
            SqlConnection Sqlconnect = _Default.GetSqlConnection();
            string        SQLquery   = @"SELECT * 
                               FROM Online_Polling_DB.dbo.[vote]
                                WHERE topic = '" + modify_topic
                                       + "' ORDER BY ID ASC;";
            SqlCommand    MyCommand       = new SqlCommand(SQLquery, Sqlconnect);
            SqlDataReader MysqlDataReader = MyCommand.ExecuteReader();

            MysqlDataReader.Read();
            try
            {
                if (MysqlDataReader["id"].ToString() != null)
                {
                    Label1.Text               = "投票主題:";
                    Label1.Text              += MysqlDataReader["topic"].ToString().Replace(" ", string.Empty);
                    Label1.Text              += "<br />";
                    Label1.Text              += "主辦人:";
                    Label1.Text              += MysqlDataReader["host_id"].ToString().Replace(" ", string.Empty);
                    Label1.Text              += "<br />";
                    Label1.Text              += "投票敘述:";
                    Label1.Text              += MysqlDataReader["description"].ToString().Replace(" ", string.Empty);
                    Label1.Text              += "<br />";
                    Label1.Text              += "投票開始日期:";
                    Label1.Text              += MysqlDataReader["startdate"].ToString().Replace(" ", string.Empty);
                    Label1.Text              += "<br />";
                    Label1.Text              += "投票結束日期:";
                    Label1.Text              += MysqlDataReader["enddate"].ToString().Replace(" ", string.Empty);
                    Label1.Text              += "<br />";
                    Label1.Visible            = true;
                    StartModifyButton.Visible = true;
                }
            }
            catch (Exception exep)
            {
                Response.Write(exep.ToString());

                return;
            }
        }
        public void PopulateBullListAssoWebpage(BulletedListEventArgs e)
        {
            bullListAssoWebpages.Items.Clear();

            //Hitta webpages för ALLA associations och lägg i en lista
            List<webpages> assoWebpageList = WebPageDB.GetAllAssociationWebpages();

            //Gör en lista för assoId som tillhör samma community
            List<int> assoIdsInCommunityList = new List<int>();

            ////Id för vald Community Webpage
            //int selectedCommWebpageId = int.Parse(bullListCommWebpages.Items[e.Index].Value);

            ////Det riktiga id för den valda community
            //int selectedCommWebpageCommId = WebPageDB.GetWebPageById(selectedCommWebpageId).CommunityId.GetValueOrDefault();

            //communities comm = CommunityDB.GetCommunityById(selectedCommWebpageCommId);
            //List<associations> assoList = AssociationDB.GetAllAssociationsInCommunity(comm);

            //foreach (var a in assoList)
            //{
            //    assoIdsInCommunityList.Add(a.Id);
            //}

            foreach (associations asso in
                CommunityDB.GetCommunityById(
                    WebPageDB.GetWebPageById(int.Parse(bullListCommWebpages.Items[e.Index].Value))
                        .CommunityId.GetValueOrDefault()).associations)
            {
                assoIdsInCommunityList.Add(asso.Id);
            }

            foreach (var wp in assoWebpageList.OrderBy(w => w.Title))
            {
                if (assoIdsInCommunityList.Contains(wp.AssociationId.GetValueOrDefault()))
                {
                    bullListAssoWebpages.Items.Add(new ListItem(wp.Title, wp.Id.ToString()));
                }
            }
        }
Beispiel #9
0
        protected void BulletedListSongs_Click(object sender, BulletedListEventArgs e)
        {
            switch (e.Index)
            {
                case 0:
                    this.HideLoggedIn();
                    //ViewSongs.Visible = true;
                    break;
                case 1:
                    //this.HideLoggedIn();
                    //EditSong.Visible = true;
                    Response.Redirect("~/AddAlbum.aspx");
                    break;
                case 2:

                    break;
                case 3:

                    break;
                default:
                    throw new Exception("You did not click a valid list item.");

            }
        }
        //Klick på Comm Webpage listitem
        protected void bullListCommWebpages_OnClick(object sender, BulletedListEventArgs e)
        {
            lbWebPageUpdate.Text = string.Empty;
            LabelActionStatus.Text = string.Empty;

            //Markera valt item
            bullListCommWebpages.Items[e.Index].Attributes.CssStyle.Add(HtmlTextWriterStyle.FontWeight, "Bold");
            bullListCommWebpages.Items[e.Index].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "Cyan");

            //Visa Association Webpage-lista
            lbAssoWebPage.Visible = true;
            lbAssoWebPage.Text = "Association Webpages";
            bullListAssoWebpages.Visible = true;
            PopulateBullListAssoWebpage(e);

            //Visa WebPage Details för Association
            MultiViewWebPageDetails.ActiveViewIndex = 0;

            //Visa information från databas för Community webpage
            webpages currentWp = WebPageDB.GetWebPageById(int.Parse(bullListCommWebpages.Items[e.Index].Value));
            tbWebpageTitle.Text = currentWp.Title ?? "Untitled";
            lbCommAssoName.Text = "<b>Community Name: </b>";
            hlnkCommAssoName.Text = CommunityDB.GetCommunityById(currentWp.CommunityId.GetValueOrDefault()).Name;
            hlnkCommAssoName.NavigateUrl = "/SitePage.aspx?id=" +
                                           (WebPageDB.GetWebPageByCommunityId(currentWp.CommunityId.GetValueOrDefault()) !=
                                            null
                                               ? WebPageDB.GetWebPageByCommunityId(
                                                   currentWp.CommunityId.GetValueOrDefault()).Id.ToString()
                                               : "") + "&type=C";
            tbLayout.Text = currentWp.Layout ?? "No Layout Specified";
            tbStyle.Text = currentWp.Style ?? "No Style Specified";
            hdnfWebpageId.Value = currentWp.Id.ToString();

            // Visa komponenter i en webpage
            ShowComponentsInWebPage();

            PopulateDropDownListControls();
        }
 protected virtual void OnClick(BulletedListEventArgs e)
 {
     BulletedListEventHandler handler = (BulletedListEventHandler) base.Events[EventClick];
     if (handler != null)
     {
         handler(this, e);
     }
 }
Beispiel #12
0
        protected void bullCarpetas_Click(object sender, BulletedListEventArgs e)
        {
            ListItem li = bullCarpetas.Items[e.Index];
            int idCarpeta = int.Parse(li.Value);

            CargaTablaPorCarpeta(idCarpeta);
        }
Beispiel #13
0
        protected void BulletedList1_Click(object sender, BulletedListEventArgs e)
        {

        }
Beispiel #14
0
		protected virtual void OnClick (BulletedListEventArgs e)
		{
			if (Events != null) {
				BulletedListEventHandler eh = (BulletedListEventHandler) (Events [ClickEvent]);
				if (eh != null)
					eh (this, e);
			}
		}
 /// <summary>
 /// User History Txt click event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void BList_userHistory_Click(object sender, BulletedListEventArgs e)
 {
     try
     {
         string previousShape = BList_userHistory.Items[e.Index].Text;
         string[] delimiters = { "Shape:", "," };
         string[] previousShapeAry = previousShape.Split(delimiters, StringSplitOptions.None);
         previousShapeAry[1].Trim();
         GenerateShape(previousShapeAry[1]);
     }
     catch (Exception e1)
     {
         Lbl_PageErr.Visible = true;
         Lbl_PageErr.Text = e1.ToString();
         throw;
     }
 }
Beispiel #16
0
		static void list_Click (object sender, BulletedListEventArgs e)
		{
			WebTest.CurrentTest.UserData = "list_Click Fired_" + e.Index.ToString();
		}
 /// <devdoc>
 /// <para>Raises the Click event.</para>
 /// </devdoc>
 protected virtual void OnClick(BulletedListEventArgs e) {
     BulletedListEventHandler onClickHandler = (BulletedListEventHandler)Events[EventClick];
     if (onClickHandler != null)
         onClickHandler(this, e);
 }
 protected virtual new void OnClick(BulletedListEventArgs e)
 {
 }
Beispiel #19
0
 /// <summary>
 /// 转入对应做题页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void bltQu_Click(object sender, BulletedListEventArgs e)
 {
     string quesId = BLquestions.Items[e.Index].Value.ToString();
     Session["quesId"] = quesId;
     //Response.Write(" <script> parent.window.location.href= 'study1.aspx?ques=" + quesId + "' </script> ");
     Response.Write(" <script> parent.window.location.href= '../study1.aspx' </script> ");
 }
Beispiel #20
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void bl_subject_Click(object sender, BulletedListEventArgs e)
 {
     sectId = bl_subject.Items[e.Index].Value.ToString();
     lb_dis.Text = bl_subject.Items[e.Index].Text.ToString();
     classcard();
 }
        protected void BulletedList4_Click1(object sender, BulletedListEventArgs e)
        {

            //Label1.Text = "The Index of Item you clicked: " + e.Index + "<br> The value of Item you clicked: " + BulletedList4.Items[e.Index].Text;
            foreach (ListItem li in BulletedList4.Items)
                li.Attributes.Add("class", "");

            BulletedList4.Items[e.Index].Attributes.Add("class", "active");

            ProfileView.ActiveViewIndex = e.Index;
            var userName = Security.GetUserName();

            switch (ProfileView.ActiveViewIndex)
            {
                case 2:
                    lstAllProjects.Items.Clear();
                    lstSelectedProjects.Items.Clear();
                    lstAllProjects.DataSource = ProjectManager.GetByMemberUserName(userName);
                    lstAllProjects.DataTextField = "Name";
                    lstAllProjects.DataValueField = "Id";
                    lstAllProjects.DataBind();

                    // Copy selected users into Selected Users List Box
                    var projectNotifications = ProjectNotificationManager.GetByUsername(userName);

                    foreach (var currentNotification in projectNotifications)
                    {
                        var matchItem = lstAllProjects.Items.FindByValue(currentNotification.ProjectId.ToString());
                        if (matchItem == null) continue;

                        lstSelectedProjects.Items.Add(matchItem);
                        lstAllProjects.Items.Remove(matchItem);
                    }
                    break;
            }

        }
Beispiel #22
0
		private void BulletedListClickHandler (object sender, BulletedListEventArgs e)
		{
			clicked = true;
		}
 protected virtual new void OnClick(BulletedListEventArgs e)
 {
 }
Beispiel #24
0
		public void DoOnClick (BulletedListEventArgs e)
		{
			OnClick (e);
		}
Beispiel #25
0
        protected void BulletedList1_Click(object sender, System.Web.UI.WebControls.BulletedListEventArgs e)
        {
            //print vote
            Response.Write("You selected: " + e.Index + ": " + VoteList.Items[e.Index].Text);
            topic_IN = VoteList.Items[e.Index].Text;
            _Default.MySQLconnect();
            SqlConnection Sqlconnect = _Default.GetSqlConnection();
            string        SQLquery   = @"SELECT * 
                               FROM Online_Polling_DB.dbo.[vote]
                                WHERE topic = '" + VoteList.Items[e.Index].Text
                                       + "' ORDER BY ID ASC;";
            SqlCommand    MyCommand       = new SqlCommand(SQLquery, Sqlconnect);
            SqlDataReader MysqlDataReader = MyCommand.ExecuteReader();

            MysqlDataReader.Read();

            try
            {
                if (MysqlDataReader["id"].ToString() != null)
                {
                    Label1.Text    = "投票主題:";
                    Label1.Text   += MysqlDataReader["topic"].ToString().Replace(" ", string.Empty);
                    Label1.Text   += "<br />";
                    Label1.Text   += "主辦人:";
                    Label1.Text   += MysqlDataReader["host_id"].ToString().Replace(" ", string.Empty);
                    Label1.Text   += "<br />";
                    Label1.Text   += "投票敘述:";
                    Label1.Text   += MysqlDataReader["description"].ToString().Replace(" ", string.Empty);
                    Label1.Text   += "<br />";
                    Label1.Text   += "投票開始日期:";
                    Label1.Text   += MysqlDataReader["startdate"].ToString().Replace(" ", string.Empty);
                    Label1.Text   += "<br />";
                    Label1.Text   += "投票結束日期:";
                    Label1.Text   += MysqlDataReader["enddate"].ToString().Replace(" ", string.Empty);
                    Label1.Text   += "<br /><br />";
                    Label1.Visible = true;
                }
            }
            catch (Exception exep)
            {
                Response.Write(exep.ToString());
            }
            MysqlDataReader.Close();
            //print result
            SQLquery = @"SELECT * 
                               FROM Online_Polling_DB.dbo.[result]
                                WHERE topic = '" + VoteList.Items[e.Index].Text
                       + "' ;";
            MyCommand       = new SqlCommand(SQLquery, Sqlconnect);
            MysqlDataReader = MyCommand.ExecuteReader();
            MysqlDataReader.Read();
            Label1.Text += "投票結果:<br />";

            //for draw graph
            List <double> yval = new List <double>();
            List <string> xval = new List <string>();

            try
            {
                do
                {
                    if (MysqlDataReader["result_id"].ToString() != null)
                    {
                        string option = MysqlDataReader["option"].ToString().Replace(" ", string.Empty);
                        if (!xval.Contains(option))
                        {
                            xval.Add(option);
                            yval.Add(0);
                        }
                        int index = xval.IndexOf(option);
                        yval[index] += 1;
                        Label1.Text += "選項:";
                        Label1.Text += option;
                        Label1.Text += "<br />";
                        Label1.Text += "投票人:";
                        Label1.Text += MysqlDataReader["voter_id"].ToString().Replace(" ", string.Empty);
                        Label1.Text += "<br /><br />";
                    }
                }while (MysqlDataReader.Read());
            }
            catch (Exception exep)
            {
                Response.Write(exep.ToString());
            }


            //lsit<string> xval = { "Peter", "Andrew", "Julie", "Mary", "Dave" };
            Chart1.Series["Series1"].Points.DataBindXY(xval, yval);
        }
 /// <summary>
 /// Redireciona o usuário para uma janela específica
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void OnClick_RedirecionaJanela(object sender, BulletedListEventArgs e)
 {
     ScriptManager.RegisterStartupScript(Page, typeof(Page), "open", "window.open('" + BulletedList_Menu.Items[e.Index].Value + "');", true);
 }
        // För att hantera en member - gå till current member view
        protected void bullListMemberList_OnClick(object sender, BulletedListEventArgs e)
        {
            //Visa view när "Show Member"-länken klickas
            MultiViewManageMembers.ActiveViewIndex = 0;
            btnMemberDelete.Visible = true;
            btnMembersSaveChanges.Text = "Save Changes";

            //Labeltext och member info
            LabelUpdateAsso.Text = string.Empty;
            lbMemberUpdate.Text = string.Empty;
            lbMembersTitle.Text = "Current Member Information, in " +
                                  AssociationDB.GetAssociationById(int.Parse(ListBoxAsso.SelectedItem.Value)).Name;

            members member = MemberDB.GetMemberById(int.Parse(bullListMemberList.Items[e.Index].Value)); //e.Index på valt item i listan
            //IAttributeAccessor t =  bullListMemberList.Items[e.Index];

            tbMemberFName.Text = member.FirstName;
            tbMemberSName.Text = member.SurName;
            tbMemberEmail.Text = member.Email;
            tbMemberPhone.Text = member.Phone;
            hdfMemberId.Value = member.Id.ToString(); //spara id i en hiddenfield

            //hdfMemberId.Value = t.GetAttribute("data-value");
        }