public ActionResult DrivingLicenseListProvide(DrivingLicenseDTO drivingLicenseDTO)
        {
            if (!base.HasPermission("DrivingLicense", PermissionOperate.manager))
            {
                return(null);
            }

            int isAll = 1;

            if (!base.HasPermission("DrivingLicenseAll", PermissionOperate.manager))
            {
                drivingLicenseDTO.MpUserId = base.LoginAdmin.MpUserId;
                isAll = 0;
            }

            OceanDynamicList <object> list = _drivingLicenseService.GetPageDynamicList(PageIndex, PageSize, drivingLicenseDTO, isAll);

            if (list != null)
            {
                return(Content(list.ToJson(), "text/javascript"));
            }
            else
            {
                return(Content("{\"rows\":[],\"total\":0}", "text/javascript"));
            }
        }
示例#2
0
        public ActionResult DrivingLicenseListProvide(DrivingLicenseDTO drivingLicenseDTO)
        {
            MpUserID = new Guid("E8325C13-9C76-4B70-911E-57395A2F4D69");
            MpUser mpUser = _mpUserService.GetById(MpUserID);

            if (mpUser == null || mpUser.IsAuth != 1)
            {
                return(Json(new { message = "您没有权限,请先申请成为业务员!" }));
            }
            drivingLicenseDTO.MpUserId = MpUserID;
            //IList<VehicleLicense> vehicleList = _vehicleLicenseService.GetList("from VehicleLicense where MpUserId = '" + mpUser.Id + "'");
            OceanDynamicList <object> drivingList = _drivingLicenseService.GetPageDynamicList(PageIndex, PageSize, drivingLicenseDTO, 0);

            //ViewBag.VehicleList = new JavaScriptSerializer().Serialize(Json(vehicleList).Data); //Json(vehicleList, JsonRequestBehavior.AllowGet);
            //return View(vehicleList);
            if (drivingList != null)
            {
                return(Content(drivingList.ToJson(), "text/javascript"));
            }
            else
            {
                return(Content("{\"rows\":[],\"total\":0}", "text/javascript"));
            }
        }