protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(Request.QueryString["Id"]); //ns.getDetails(); //SourceList.SelectedValue = ns.SourceList; if (!Page.IsPostBack) { DataTable tb = addNotificationRepository.GetEventData(0).Tables[0]; DataRow dr = tb.Select("Id = " + id)[0]; NameTextBox.Text = dr[1].ToString(); MandetoryCheckBox.Checked = Convert.ToBoolean(dr[3]); ConfidentialCheckBox.Checked = Convert.ToBoolean(dr[4]); SourceList.SelectedValue = dr[2].ToString(); SourceList.Enabled = false; DataTable tb1 = addNotificationRepository.EventChannelGetData(id).Tables[0]; for (int count = 0; count < tb1.Rows.Count; count++) { // if(tb1.Rows[count]) if (Convert.ToInt32(tb1.Rows[count][0]) == 1) { Intranet.Checked = true; } if (Convert.ToInt32(tb1.Rows[count][0]) == 2) { EmailsCheckBox.Checked = true; } if (Convert.ToInt32(tb1.Rows[count][0]) == 3) { UnaBotCheckBox.Checked = true; } if (Convert.ToInt32(tb1.Rows[count][0]) == 4) { SmsCheckBox.Checked = true; } } } }
protected void Page_Load(object sender, EventArgs e) { int qstring = Convert.ToInt32(Request.QueryString["Id"]); DataTable tb = addNotificationRepository.GetEventData(0).Tables[0]; DataRow dr = tb.Select("Id = " + qstring)[0]; EventName.Text = dr[1].ToString(); ConfCheck.Enabled = false; MandCheck.Enabled = false; if (dr[4].ToString() == "True") { ConfCheck.Enabled = true; ConfCheck.Checked = true; } if (dr[3].ToString() == "True") { MandCheck.Enabled = true; MandCheck.Checked = true; } DataTable tb1 = addNotificationRepository.EventChannelGetData(qstring).Tables[0]; IntranetCheck.Enabled = false; SmsCheckBox.Enabled = false; UnabotCheckBox.Enabled = false; EmailCheckbox.Enabled = false; if (!IsPostBack) { for (int count = 0; count < tb1.Rows.Count; count++) { // if(tb1.Rows[count]) if (Convert.ToInt32(tb1.Rows[count][0]) == 1) { IntranetCheck.Enabled = true; IntranetCheck.Checked = true; } if (Convert.ToInt32(tb1.Rows[count][0]) == 2) { EmailCheckbox.Enabled = true; EmailCheckbox.Checked = true; } if (Convert.ToInt32(tb1.Rows[count][0]) == 3) { UnabotCheckBox.Enabled = true; UnabotCheckBox.Checked = true; } if (Convert.ToInt32(tb1.Rows[count][0]) == 4) { SmsCheckBox.Enabled = true; SmsCheckBox.Checked = true; } } } DataTable SelectPeople = addNotificationRepository.GetData("select UserName from AspNetUsers where Id = any (select distinct(essu.UserId) from Event_slm_subscribe ess, Event_slm_subscribe_users essu where ess.Id = essu.Event_slm_subscribe_Id and ess.EventId = '" + qstring + "')"); list = new ListBox(); list.SelectionMode = ListSelectionMode.Multiple; SelectedPeopleList.Controls.Add(list); if (!IsPostBack) { for (int count = 0; count < SelectPeople.Rows.Count; count++) { list.Items.Add(SelectPeople.Rows[count]["UserName"].ToString()); //ListBox1.Items.da DataValueField = ""; //ListBox1.; } } // for }