protected void ddlZanr_SelectedIndexChanged(object sender, EventArgs e) { string vrednost = ddlZanr.SelectedValue; OpKnjigaSelect knjsort = new OpKnjigaSelect(); if (vrednost != "0") { knjsort.Kriterijum = new KriterijumKnjiga(); knjsort.Kriterijum.Zanr = vrednost; } OperacijaRezultat objsort = OperationManager.Singleton.izvrsiOperaciju(knjsort); DbItem[] itemsort = objsort.DbItems; KnjigaDb[] knj = itemsort.Cast <KnjigaDb>().ToArray(); if (knj.Count() == 0) { this.DataPager1.SetPageProperties(0, DataPager1.PageSize, false); BookList.DataSource = knj; BookList.DataBind(); noBooks.Visible = true; } else { noBooks.Visible = false; this.DataPager1.SetPageProperties(0, DataPager1.PageSize, false); BookList.DataSource = knj; BookList.DataBind(); } }
protected void btnSearch_Click(object sender, EventArgs e) { string text = tbSearch.Text; OpKnjigaSelect knjiga = new OpKnjigaSelect(); knjiga.Kriterijum = new KriterijumKnjiga(); knjiga.Kriterijum.Knjiga_pretraga = text; OperacijaRezultat obj = OperationManager.Singleton.izvrsiOperaciju(knjiga); if ((obj == null) || (!obj.Status)) { return; } else { if (obj.DbItems.Count() == 0) { noBooks.Visible = true; } else { noBooks.Visible = false; } this.DataPager1.SetPageProperties(0, DataPager1.PageSize, false); BookList.DataSource = obj.DbItems; BookList.DataBind(); ddlZanr.SelectedValue = "0"; } }
private void Llenar() { String Nick = Convert.ToString(Session["Admin"]); cdc = new ConexionLQDataContext(); BookList.DataSource = cdc.vLibroUsuario(Nick); BookList.DataBind(); }
private void LoadBooks() { using (dbModelContainer db = new dbModelContainer()) { var books = db.Book.ToList(); BookList.DataSource = books; BookList.DataBind(); } }
private void LoadBooks(string keyword) { using (dbModelContainer db = new dbModelContainer()) { var books = (from i in db.Book where i.BookName.Contains(keyword) || i.Description.Contains(keyword) select i).ToList(); BookList.DataSource = books; BookList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { AdminPopedom.IsHoldModel("02"); BatchDelete(); DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager") .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize) .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex) .AddInputParameter("@Columns", DbType.String, "*") .AddInputParameter("@TableName", DbType.String, "web_msg") .AddInputParameter("@Wheres", DbType.String, "") .AddInputParameter("@KeyName", DbType.String, "msgid") .AddInputParameter("@OrderBy", DbType.String, "msgid desc") .ToDataSet(); if (ds.Tables.Count > 0 && ds.Tables[1].Rows.Count > 0) { anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0]; anpPageIndex.CurrentPageIndex = PageIndex; BookList.DataSource = ds.Tables[1]; BookList.DataBind(); BookList.Visible = true; NoBookList.Visible = false; } else { NoBookList.Visible = true; BookList.Visible = false; } /* * DataTable sd = new DataTable(); * string para = ""; * string[] sql = new string[2]; * sql[0] = "select * from web_msg order by msgid desc"; * sql[1] = "select count(*) from web_msg"; * string url = ""; * PageLink page_set = new PageLink(url, 20, 10, para, sql); * page_set.paraLinkType = paraLinkShow.middling.ToString(); * sd = page_set.get_table(); * if (sd.Rows.Count > 0) * { * Repeater Vlist = (Repeater)Page.FindControl("BookList"); * Vlist.DataSource = sd; * Vlist.DataBind(); * this.pageList.Text = page_set.pageList(); * } * else * this.NoBookList.Visible = true; * sd.Clear();*/ }
private void LoadBooks(int id) { using (dbModelContainer db = new dbModelContainer()) { var books = from c in db.Category.Where(c => c.Category_Book.Any()) from cb in db.Category_Book.Where(cb => cb.CategoryId.Equals(c.Id)) from b in db.Book.Where(b => b.Id.Equals(cb.BookId)) where c.Id == id select new { b.BookName, b.Price, b.Image }; BookList.DataSource = books.ToList(); BookList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { cart.EmptyShoppingCart(); //get all books in the catalog. ArrayList books = BookCatalogDataAccess.GetAllBooks(); BookList.DataSource = books; BookList.DataTextField = "Title"; BookList.DataValueField = "Id"; BookList.DataBind(); BookList.Items.Insert(0, new ListItem("Select a Book ...", "-1")); } btnViewCart.Text = "View Cart (" + cart.NumOfItems + " items)"; }
protected void Page_Load(object sender, EventArgs e) { OpKnjigaSelect knjiga = new OpKnjigaSelect(); //knjiga.Kriterijum = new KriterijumKnjiga(); //knjiga.Kriterijum.Get_cena = 31; //samo da bih probao da li ce da vrati svuda OperacijaRezultat obj = OperationManager.Singleton.izvrsiOperaciju(knjiga); if ((obj == null) || (!obj.Status)) { return; } else { BookList.DataSource = obj.DbItems; BookList.DataBind(); } ZanrSelect znr = new ZanrSelect(); OperacijaRezultat obj2 = OperationManager.Singleton.izvrsiOperaciju(znr); if ((obj2 == null) || (!obj2.Status)) { return; } else { DbItem[] items = obj2.DbItems; ZanrDb[] zanr = items.Cast <ZanrDb>().ToArray(); if (!Page.IsPostBack) { ddlZanr.DataTextField = "naziv"; ddlZanr.DataValueField = "naziv"; ddlZanr.DataSource = zanr; ddlZanr.DataBind(); } } }
protected void FillInBookControl(BookLibraryContext db) { if (Request.Params.AllKeys.Contains("bookID")) { int bookID = Convert.ToInt32(Request["bookID"]); Book book = db.Books.Single(b => b.BookID == bookID); BookTextBox.Text = book.ISBN + " " + book.Title; BookListLabel.Visible = false; BookList.Visible = false; BookTextBoxLabel.Visible = true; BookTextBox.Visible = true; } else { BookList.DataValueField = "BookID"; BookList.DataTextField = "DisplayName"; BooksLogic bl = new BooksLogic(); List <Book> notBorrowedBooks = bl.GetNotBorrowedBooks(); /* * foreach (Book b in notBorrowedBooks) * { * b.DisplayName = b.ISBN + " " + b.Title; * } */ BookList.DataSource = notBorrowedBooks; BookList.DataBind(); BookListLabel.Visible = true; BookList.Visible = true; BookTextBoxLabel.Visible = false; BookTextBox.Visible = false; } }
private void LlenarLista() { cdc = new ConexionLQDataContext(); BookList.DataSource = cdc.vLibros.Where(x => x.id_Autor == idAutor).OrderBy(x => x.Nombre); BookList.DataBind(); }
protected void BookList_PagePropertiesChanged(object sender, EventArgs e) { BookList.DataBind(); }
private void llenado() { cdc = new ConexionLQDataContext(); BookList.DataSource = cdc.vLibros.OrderBy(x => x.Nombre); BookList.DataBind(); }