//
        // GET: /SuperAdmin/FurnitureOperate/
        public ActionResult Index(int? id)
        {
            ViewBag.jsInit = Public.SuperAdminCommon.JSInit("FurnitureManage", "FurnitureOperate");

            FurnitureType furnitureType = new FurnitureType();
            ViewBag.furnitureType = furnitureType.GetAllModel();

            Furniture furniture = new Furniture();
            var model = furniture.GetSingleById(id.HasValue ? id.Value : 0);

            return View(model);
        }
Esempio n. 2
0
        public ActionResult List(string furnituretype, int? id)
        {
            FurnitureType furnitureType = new FurnitureType();
            ViewBag.furnitureType = furnitureType.GetAllModel();

            furnituretype = furnituretype == null ? "knowalls" : furnituretype;
            //create query
            var query = new FurnitureListQuery();
            query.Pageindex = id.HasValue ? id.Value : 1;
            query.FurnitureType = furnituretype;
            query.Type = Common.common.ConvertInt32(Request.QueryString["ftype"]);

            ViewBag.query = query;

            //Get List
            Furniture dal = new Furniture();
            IList<Fr_ContentData> 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 = "/furniture/list/" + furnituretype + "/";
            page.SimpleTheme = true;
            page.NavigateNext = "&gt;";
            page.NavigatePrevious = "&lt;";
            ViewBag.pageinfo = page.Render();

            return View(model);
        }
Esempio n. 3
0
        //
        // GET: /SuperAdmin/FurnitureList/
        public ActionResult Page(int? id)
        {
            ViewBag.jsInit = Public.SuperAdminCommon.JSInit("FurnitureManage", "FurnitureList");

            Furniture dal = new Furniture();
            IList<Fr_ContentData> furnitures = 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;

            int currentpage = id.HasValue ? (int)id : 1;
            Common.HtmlPagerControl page = new Common.HtmlPagerControl(pagecount, 3, objectcount);
            page.CurrentPage = currentpage;
            page.HrefPage = "/superadmin/FurnitureList/page/";
            ViewBag.pageinfo = page.Render();
            return View(furnitures);
        }