示例#1
0
        /// <summary>
        /// 新增FloorLabelConfig
        /// </summary>
        /// <param name="floorLabel"></param>
        /// <returns></returns>
        public bool AddFloorLabel(FloorLabelDetail floorLabel)
        {
            var req = Mapper.Map <FloorLabelDetail, AddFloorLabelConfigRequest>(floorLabel);

            var res = CMSClient.Send <AddFloorLabelConfigResponse>(req);

            return(res.DoFlag);
        }
示例#2
0
        /// <summary>
        /// 根据FloorLabelConfig->Id查询单条信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FloorLabelDetail QueryFloorLabelById(int id)
        {
            var result = new FloorLabelDetail();
            var req    = new QueryFloorLabelConfigByIdRequest();

            req.SysNo = id;

            var res = CMSClient.Send <QueryFloorLabelConfigByIdResponse>(req);

            if (res.DoFlag)
            {
                result = Mapper.Map <FloorLabelConfigExt, FloorLabelDetail>(res.FloorDetailDos);
            }
            return(result);
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="strName">首级名称</param>
        /// <param name="name">当前级名称</param>
        /// <param name="floorId">楼层编号</param>
        /// <returns></returns>
        public ActionResult FloorLabelDetail(int?id, string strName, string name, int floorId)
        {
            var result = new FloorLabelDetail();

            if (id > 0)
            {
                result = FloorConfigClient.Instance.QueryFloorLabelById(id.Value);
            }

            //获取楼层类型
            var resultItem = FloorConfigClient.Instance.QueryFloorItemsConfig(3);

            ViewBag.ItemModel = resultItem;
            ViewBag.StrName   = strName;
            ViewBag.Name      = name;
            ViewBag.FloorId   = floorId;

            return(View(result));
        }
示例#4
0
        public JsonResult SaveFloorLabel(FloorLabelDetail floorLabel)
        {
            var result = new BaseResponse()
            {
            };

            try
            {
                if (floorLabel.SysNo > 0)
                {
                    //修改
                    var res = FloorConfigClient.Instance.UpdateFloorLabel(floorLabel);
                    if (res)
                    {
                        result.DoFlag = true;
                    }
                    else
                    {
                        result.DoResult = "修改失败,请稍后重试... ...";
                    }
                }
                else
                {
                    //新增
                    var res = FloorConfigClient.Instance.AddFloorLabel(floorLabel);
                    if (res)
                    {
                        result.DoFlag = true;
                    }
                    else
                    {
                        result.DoResult = "新增失败,请稍后重试... ...";
                    }
                }
            }
            catch (Exception ex)
            {
                result.DoResult = "保存异常,请稍后重试... ...";
            }
            return(Json(result));
        }