Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var dbContext = new Books();
            var bookTitles = dbContext.Boooks.Select(t => t.Title.Trim());
            var bookPrice = dbContext.Boooks.Select(t => t.Price.ToString());

            var authorNames = dbContext.Authors.Select(t => t.Name.Trim());
            var authotAges = dbContext.Authors.Select(t => t.Age.ToString());

            string execBooks = DrawChart(bookTitles, bookPrice, "canvas");
            string execAuthors = DrawChart(authorNames, authotAges, "canvas1");
            ExecJs("drawChart", string.Join(";", new[] { execBooks, execAuthors }));
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string name = Request.QueryString["name"];
            string age = Request.QueryString["age"];

            var dbContext = new Books();
            var peopleList = dbContext.Authors.Select(t => t);

            foreach (var u in peopleList)
            {
                if (u.Name == name && u.Age == int.Parse(age))
                {
                    Label1.Text = u.Name + ' ' + u.Age + ' '  + u.ID;
                }

            }
        }