Exemplo n.º 1
0
        /// <summary>
        /// 获取客户列表以及车辆
        /// </summary>
        /// <param name="iconSkin">值为CarDeviceNo表示是车辆的上一级可以选中,为空表示车辆的上一级不可以选中</param>
        /// <returns></returns>
        public JsonResult GetCusCarListJosn(string iconSkin)
        {
            AjaxResult res = new AjaxResult();
            try
            {
                res.State = AjaxResultState.Success;
                switch (Passport.TenantType)
                {
                    case EnumTenantType.OperatingMerchant: //运营商
                        var _data = new VCustomerWithVehicleTreeItem
                        {
                            TenantCode = Passport.TenantCode,
                            TenantName = Passport.TenantName,
                            iconSkin = "pIcon",
                            IsOM = true,
                            open = true
                        };
                        _data.Children = ModelFacade.VehicleManage.VehicleManageModel.GetMerchantWithVehicleList(Passport.TenantCode, iconSkin);
                        res.Data = _data;
                        break;

                    case EnumTenantType.PlatProvider: //平台商
                        res.Data = ModelFacade.VehicleManage.VehicleManageModel.GetPlatformWithVehicleList(Passport.TenantCode, iconSkin);
                        break;

                    case EnumTenantType.EndCustomer: //终端用户
                        res.Data = ModelFacade.VehicleManage.VehicleManageModel.GetCustomerWithVehicleList(Passport.TenantCode, iconSkin);
                        break;
                }
            }
            catch (Exception ex)
            {
                res.State = AjaxResultState.Error;
                Logger.Error(ex);
                res.Data = null;
                res.Message = ex.Message;
            }

            return Json(res, null, Encoding.UTF8, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取客户列表josn
        /// </summary>
        /// <returns></returns>
        public JsonResult GetCusJosn()
        {
             
            switch (Passport.TenantType)
            {
                case EnumTenantType.OperatingMerchant: //运营商
                    var res = new VCustomerWithVehicleTreeItem
                    {
                        TenantCode = Passport.TenantCode,
                        TenantName = Passport.TenantName,
                        iconSkin = "pIcon",
                        IsOM = true,
                        open = true
                    };
                    res.Children =ModelFacade.VehicleManage.VehicleManageModel.GetChangeOfMerchant(Passport.TenantCode);
                    return Json(new { Data = res }, null, Encoding.UTF8, JsonRequestBehavior.AllowGet);

                case EnumTenantType.PlatProvider: //平台商
                    var OMList = ModelFacade.VehicleManage.VehicleManageModel.GetChangeOfPlatform(Passport.TenantCode);

                    return Json(new { Data = OMList }, null, Encoding.UTF8, JsonRequestBehavior.AllowGet);
                case EnumTenantType.EndCustomer: //终端用户
                    var vehGroup = ModelFacade.VehicleManage.VehicleManageModel.GetChangeOfCustomer(Passport.TenantCode);
                    return Json(new { Data = vehGroup }, null, Encoding.UTF8, JsonRequestBehavior.AllowGet);
            }

            return Json(null, null, Encoding.UTF8, JsonRequestBehavior.AllowGet);
        }