Ejemplo n.º 1
0
        //
        // GET: /Admin/KaMi/

        public ActionResult Index()
        {
            if (Session["admin_User"] == null)
            {
                return(RedirectToRoute(new { controller = "Account", action = "Login", area = "" }));
            }
            List <ProductTypeViewModel> lstRes = BProductType.SearchAll();

            ViewBag.option = lstRes;
            ViewBag.title  = "卡密管理";
            return(View());
        }
Ejemplo n.º 2
0
        public JsonResult GetProductTypes(int limit, int offset, string departmentname)
        {
            List <ProductTypeViewModel> lstRes = null;

            if (!string.IsNullOrEmpty(departmentname))
            {
                lstRes = BProductType.SearchBysql(departmentname);
            }
            else
            {
                lstRes = BProductType.SearchAll();
            }

            var total = lstRes.Count;
            var rows  = lstRes.Skip(offset).Take(limit).ToList();

            return(Json(new { total = total, rows = rows }, JsonRequestBehavior.AllowGet));
        }