public ActionResult Index() { F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); ViewBag.ListBook = new F_Book().getAll(); return(View()); }
public ActionResult Product(long id) { F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); var model = new F_Book().FindEntity(id); ViewBag.Book = model; return(View()); }
public ActionResult timkiemtheotacgia(long id) { var dsBook = new F_Book().getAll().Where(x => x.Author == id); ViewBag.Book = dsBook; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View("Search")); }
public ActionResult Payment() { ViewBag.Title = "Giỏ hàng"; GioHangViewModel model = new GioHangViewModel(); model.Cart = (Cart)Session["Cart"]; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View(model)); }
public ActionResult timkiemtheogia(string begin, string end) { int u = Convert.ToInt32(begin); int v = Convert.ToInt32(end); var dsBook = new F_Book().getAll().Where(x => x.Price >= u && x.Price <= v); ViewBag.Book = dsBook; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View("Search")); }
public ActionResult timkiemtheocategory(string query, int?page) { long?id = Convert.ToInt64(query); if (id == null) { id = Convert.ToInt64(Request.QueryString["query"]); } ViewBag.Title = "category=" + id + "&page=" + page; var listBook = new F_CategoryBook().getAll().Where(x => x.IDCategory == id).ToList(); var dsBook = new F_Book().getAll(); var list = (from book in listBook join book1 in dsBook on book.IDBook equals book1.ID select new Book { ID = book1.ID, Name = book1.Name, Image = book1.Image, Price = book1.Price }); List <Book> u = new List <Book>(); foreach (var v in list) { Book temp = new Book(); temp.ID = v.ID; temp.Name = v.Name; temp.Price = v.NumberPage; temp.Image = v.Image; u.Add(temp); } ViewBag.Book = list; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); int pageSize = 5; int pageNumber = (page ?? 1); return(View("Search", u.ToPagedList(pageNumber, pageSize))); }
/// <summary> /// 点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void MenuClicked(object sender, EventArgs e)//,string AssemblyName, string ClassName { ToolStripMenuItem tsm = (ToolStripMenuItem)sender; string tag = (string)tsm.Tag; string[] s = tag.Split(Convert.ToChar('/')); if (s[0] == "F_BasicSet") { F_BasicSet.basicFied = s[1]; F_BasicSet.basicFiedzh = s[2]; F_BasicSet.basicTable = s[3]; F_BasicSet fbasicset = new F_BasicSet(); fbasicset.Text = sender.ToString(); fbasicset.ShowDialog(); } if (s[0] == "passwordForm.F_PasswordManager") { passwordForm.F_PasswordManager.AdvancedCheck = s[1]; passwordForm.F_PasswordManager f = new passwordForm.F_PasswordManager(); f.ShowDialog(); } //反射应用 //Type t = Assembly.GetAssembly(this.GetType()).GetType(AssemblyName + "." + s[0]);//PersonalTools.F_BasicSet //Form ff = (Form)Activator.CreateInstance(t); if (s[0] == "F_Category") { F_Category fcategory = new F_Category(); fcategory.ShowDialog(); } if (s[0] == "F_UserSet") { F_UserSet fuserset = new F_UserSet(); fuserset.ShowDialog(); } if (s[0] == "F_Help") { F_Help fhelp = new F_Help(); fhelp.ShowDialog(); } }
public ActionResult Search(string query, int?page) { if (query == null) { query = ""; } if (page == null) { page = 1; } var model = new F_Book().getAll().Where(x => x.Name.Contains(query)).OrderBy(x => x.ID).ToList(); ViewBag.Title = "q=" + query + "&page=" + page; int pageSize = 6; int pageNumber = (page ?? 1); F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View("Search", model.ToPagedList(pageNumber, pageSize))); }