示例#1
0
        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;
                    }
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            notificationsRepository.getDetails();


            //if (Page.IsPostBack)
            //{


            if (Context.User.IsInRole("Super Admin"))
            {
                for (int Sourcecount = 0; Sourcecount < notificationsRepository.SourceList.Count; Sourcecount++)
                {
                    Label lb = new Label();
                    lb.Text      = notificationsRepository.SourceList[Sourcecount].SourceName1 + "<br/>";
                    lb.ID        = "count";
                    lb.ForeColor = System.Drawing.Color.Red;

                    NotificationPlaceHolder.Controls.Add(lb);


                    DataTable dataEvenets = addNotificationRepository.GetEventData(notificationsRepository.SourceList[Sourcecount].SourceId).Tables[0];
                    for (int i = 0; i < dataEvenets.Rows.Count; i++)
                    {
                        Label Name = new Label();

                        Name.Text = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + dataEvenets.Rows[i]["Name"] + "<br/>";
                        NotificationPlaceHolder.Controls.Add(Name);
                        Name.Width = 300;
                        HyperLink Edit   = new HyperLink();
                        HyperLink delete = new HyperLink();
                        Edit.Text  = "Edit";
                        Edit.Width = 200;
                        string qstr = dataEvenets.Rows[i]["Id"].ToString();
                        Edit.NavigateUrl = "EditEvent?Id=" + dataEvenets.Rows[i]["Id"];
                        NotificationPlaceHolder.Controls.Add(Edit);
                        delete.Text        = "Delete" + "<br/><hr/>";
                        delete.NavigateUrl = "DeleteEvent?id=" + qstr;
                        NotificationPlaceHolder.Controls.Add(delete);
                    }
                }
            }
            //TreeView tree = new TreeView();
            //NotificationPlaceHolder.Controls.Add(tree);

            //for (int i = 0; i < 5; i++)
            //{
            //    TreeNode tn = new TreeNode();
            //    tn.Text = "child";
            //    tn.PopulateOnDemand = false;
            //    tree.Nodes.Add(tn);


            //    for (int j = 0; j < 3; j++)
            //    {
            //        TreeNode tree1 = new TreeNode();
            //        tree1.Text = "shubham" + i;
            //        tree.Target = "_blank";
            //        tree.Nodes.Add(tree1);

            //    }

            //}


            //}

            //if (Context.User.IsInRole(""))
            //{

            for (int Sourcecount = 0; Sourcecount < notificationsRepository.SourceList.Count; Sourcecount++)
            {
                Label lb = new Label();
                lb.Text      = "<br/>" + notificationsRepository.SourceList[Sourcecount].SourceName1 + "<br/><br/>";
                lb.ID        = "count";
                lb.ForeColor = System.Drawing.Color.Red;
                NotificationPlaceHolder.Controls.Add(lb);
                AddNotificationButton.Visible = false;

                DataTable dataEvenets = addNotificationRepository.GetEventData(notificationsRepository.SourceList[Sourcecount].SourceId).Tables[0];


                for (int EventCount = 0; EventCount < dataEvenets.Rows.Count; EventCount++)
                {
                    Label Name = new Label();

                    Name.Text = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + dataEvenets.Rows[EventCount]["Name"] + "<br/>";
                    NotificationPlaceHolder.Controls.Add(Name);
                    Name.Width = 300;
                    HyperLink Edit      = new HyperLink();
                    HyperLink subscribe = new HyperLink();

                    string xxx = dataEvenets.Rows[EventCount]["Id"].ToString();

                    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 = '" + xxx + "')");
                    if (SelectPeople.Rows.Count > 0)
                    {
                        Edit.Text        = "Edit";
                        Edit.Width       = 200;
                        Edit.NavigateUrl = "Subscribe?id=" + xxx;
                        NotificationPlaceHolder.Controls.Add(Edit);
                        subscribe.Text        = "UnSubscribe" + "<br/>";
                        subscribe.NavigateUrl = "Notifications";
                        NotificationPlaceHolder.Controls.Add(subscribe);
                    }
                    else
                    {
                        Edit.Text        = "Edit";
                        Edit.Width       = 200;
                        Edit.NavigateUrl = "Notifications";
                        NotificationPlaceHolder.Controls.Add(Edit);
                        subscribe.Text        = "Subscribe" + "<br/>";
                        subscribe.NavigateUrl = "Subscribe?id=" + xxx;
                        NotificationPlaceHolder.Controls.Add(subscribe);
                    }
                }
            }
            //}
        }
示例#3
0
        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
        }