public ActionResult List(string designertype, int? id) { //房屋類型 DAL.HouseType dal_housetype = new DAL.HouseType(); var housetype = dal_housetype.GetAllModel(); ViewBag.housetype = housetype; //設計型式 DAL.DesignType dal_designtype = new DAL.DesignType(); var designtype = dal_designtype.GetAllModel(); ViewBag.designtype = designtype; //設計風格 DAL.DesignStyleType dal_designstyletype = new DAL.DesignStyleType(); var designstyletype = dal_designstyletype.GetAllModel(); ViewBag.designstyletype = designstyletype; ViewBag.isindex = designertype; designertype = designertype == null ? "popular" : designertype; //create query var query = new DesignerListQuery(); query.Pageindex = id.HasValue ? id.Value : 1; query.DeesignerType = designertype; query.Housetype = Common.common.ConvertInt32(Request.QueryString["housetype"]); query.Designtype = Common.common.ConvertInt32(Request.QueryString["designtype"]); query.Designstyletype = Common.common.ConvertInt32(Request.QueryString["designstyletype"]); ViewBag.query = query; //Get List Designer dal = new Designer(); IList<ID_DContentData> model; model = dal.GetList(query); //page info int pagecount = 1; int pagestep = 18; int objectcount = dal.GetCount(query); if (objectcount % pagestep == 0) pagecount = objectcount / pagestep; else pagecount = objectcount / pagestep + 1; ////// //pagecount = 13; int currentpage = id.HasValue ? (int)id : 1; Common.HtmlPagerControl page = new Common.HtmlPagerControl(pagecount, 7, objectcount); page.CurrentPage = currentpage; page.HrefPage = "/designer/list/" + designertype + "/"; page.SimpleTheme = true; page.NavigateNext = ">"; page.NavigatePrevious = "<"; ViewBag.pageinfo = page.Render(); return View(model); }
public string Delete(int id) { string result = "0"; Designer dal = new Designer(); var model = dal.GetSingledataById(id); if (model != null) { model.Dc_display = false; dal.Update(model); result = "1"; } return result; }
// // GET: /SuperAdmin/DesignerList/ public ActionResult Page(int? id) { ViewBag.jsInit = Public.SuperAdminCommon.JSInit("DesignerManage", "DesignerList"); Designer dal = new Designer(); IList<ID_DContentData> designers = dal.GetModel(id.HasValue ? (int)id : 1); int pagecount = 1; int pagestep = 18; int objectcount = dal.GetCount(); if (objectcount % pagestep == 0) pagecount = objectcount / pagestep; else pagecount = objectcount / pagestep + 1; ////// /////pagecount = 13; int currentpage = id.HasValue ? (int)id : 1; Common.HtmlPagerControl page = new Common.HtmlPagerControl(pagecount, 3, objectcount); page.CurrentPage = currentpage; page.HrefPage = "/superadmin/DesignerList/page/"; ViewBag.pageinfo = page.Render(); return View(designers); }