protected void btnSearch_Click(object sender, EventArgs e)
        {
            NewsServiceClient newsSvc      = new NewsServiceClient();
            string            searchOption = searchBox.Text;
            var listOfStrings = new List <AdminClientApp.NewsSVC.New>();

            AdminClientApp.NewsSVC.New[] newsArr = listOfStrings.ToArray();
            if (rbtnTenNews.Checked == true)
            {
                newsArr = newsSvc.GetTenNews(searchOption);
            }
            if (rtbnSimilar.Checked == true)
            {
                newsArr = newsSvc.GetSimilarNews(searchOption);
            }
            if (rtbnPositive.Checked == true)
            {
                newsArr = newsSvc.GetNBestPossitive(searchOption);
            }
            if (rtbnNegative.Checked == true)
            {
                newsArr = newsSvc.GetNBestNegative(searchOption);
            }
            LV1.DataSource = newsArr;
            LV1.DataBind();
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

            con.Open();
            SqlCommand    cmd = new SqlCommand("select * from Student", con);
            SqlDataReader rd  = cmd.ExecuteReader();

            LV1.DataSource = rd;
            LV1.DataBind();
            con.Close();
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        UserInfoLogic       usersList = new UserInfoLogic();
        List <UserInfoItem> AllUsers  = new List <UserInfoItem>();

        AllUsers       = usersList.GetAllData();
        LV1.DataSource = AllUsers;
        LV1.DataBind();
        LV2.DataSource = AllUsers;
        LV2.DataBind();
        DV1.DataSource = AllUsers;
        DV1.DataBind();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string                       searchOption = searchBox.Text;
                NewsServiceClient            newsSvc      = new NewsServiceClient();
                AdminClientApp.NewsSVC.New[] newsArr      = newsSvc.GetTenNews(searchOption);
                LV1.DataSource = newsArr;
                LV1.DataBind();


                int[] userIDs = new int[5] {
                    1, 2, 3, 4, 5
                };
                Random random = new Random();
                int    index  = random.Next(0, userIDs.Length);
                int    userID = userIDs[index];
                Session["userID"] = userID;
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                HttpChannel chnl = new HttpChannel();
                try
                {
                    ChannelServices.RegisterChannel(chnl, false);
                }
                catch (RemotingException ex)
                {
                    //all good, nobody cares, but we log it
                }

                mgr = (INewsManager)Activator.GetObject(typeof(INewsManager), "http://localhost:1234/NewsManager.soap");

                LV1.DataSource = mgr.getLastTenNews();
                LV1.DataBind();
            }
        }