/// <summary>
        ///
        /// </summary>
        public string GetVipExpandListData()
        {
            var    service = new VipExpandBLL(CurrentUserInfo);
            string content = string.Empty;

            string key = string.Empty;

            if (Request("VipID") != null && Request("VipID") != string.Empty)
            {
                key = Request("VipID").ToString().Trim();
            }

            int pageIndex = Utils.GetIntVal(FormatParamValue(Request("page"))) - 1;

            IList <VipExpandEntity> data;

            int maxRowCount   = PageSize;
            int startRowIndex = Utils.GetIntVal(Request("start"));

            VipExpandEntity queryInfo = new VipExpandEntity();

            queryInfo.VipID = key;
            data            = service.GetList(queryInfo, pageIndex, PageSize);
            int totalCount = service.GetListCount(queryInfo);

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    data.ToJSON(),
                                    totalCount);

            return(content);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 删除车信息
        /// </summary>
        public string DeleteVipExpand()
        {
            var service = new VipExpandBLL(CurrentUserInfo);

            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();

            string key = string.Empty;

            if (FormatParamValue(Request("ids")) != null && FormatParamValue(Request("ids")) != string.Empty)
            {
                key = FormatParamValue(Request("ids")).ToString().Trim();
            }

            if (key == null || key.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "车信息ID不能为空";
                return(responseData.ToJSON());
            }

            string[] ids = key.Split(',');
            foreach (var id in ids)
            {
                //删除车信息
                service.Delete(new VipExpandEntity()
                {
                    VipExpandID = id
                });
            }

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 根据车信息ID获取车信息
        /// </summary>
        public string GetVipExpandByVipExpandID()
        {
            var    service    = new VipExpandBLL(CurrentUserInfo);
            var    searchInfo = new VipExpandEntity();
            string content    = string.Empty;

            if (Request("VipExpandID") != "")
            {
                searchInfo.VipExpandID = FormatParamValue(Request("VipExpandID"));
            }

            int maxRowCount   = PageSize;
            int startRowIndex = Utils.GetIntVal(FormatParamValue(Request("start")));

            searchInfo.maxRowCount   = maxRowCount;
            searchInfo.startRowIndex = startRowIndex;
            var data = service.SearchVipExpand(searchInfo);

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    data.VipExpandInfoList.ToJSON(),
                                    data.ICount);
            return(content);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 保存车信息
        /// </summary>
        public string SaveVipExpand()
        {
            var vipExpandService = new VipExpandBLL(this.CurrentUserInfo);

            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();

            string key         = string.Empty;
            string vipExpandID = string.Empty;
            var    vipExpands  = Request("vipExpands");

            if (FormatParamValue(vipExpands) != null && FormatParamValue(vipExpands) != string.Empty)
            {
                key = FormatParamValue(vipExpands).ToString().Trim();
            }
            if (FormatParamValue(Request("VipExpandID")) != null && FormatParamValue(Request("VipExpandID")) != string.Empty)
            {
                vipExpandID = FormatParamValue(Request("VipExpandID")).ToString().Trim();
            }

            var vipExpandEntity = key.DeserializeJSONTo <VipExpandEntity>();

            if (vipExpandEntity.LicensePlateNo == null || vipExpandEntity.LicensePlateNo.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "车牌号不能为空";
                return(responseData.ToJSON());
            }
            if (vipExpandEntity.CarBrandID == null || vipExpandEntity.CarBrandID.ToString().Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "车品牌不能为空";
                return(responseData.ToJSON());
            }
            if (vipExpandEntity.CarModelsID == null || vipExpandEntity.CarModelsID.ToString().Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "车型不能为空";
                return(responseData.ToJSON());
            }

            if (vipExpandID.Trim().Length == 0)
            {
                //新增车信息
                vipExpandEntity.VipExpandID = Utils.NewGuid();
                vipExpandEntity.VipCardID   = string.Empty;
                vipExpandService.Create(vipExpandEntity);
            }
            else
            {
                //修改车信息
                vipExpandEntity.VipExpandID = vipExpandID;
                vipExpandService.Update(vipExpandEntity, false);
            }

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }