Beispiel #1
0
        /// <summary>
        /// 新增商品搜索指定位置显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AddSortProductResponse AddSortProduct(SortProductDetail request)
        {
            var req = Mapper.Map <SortProductDetail, AddSortProductRequest>(request);

            req.IsDelete = request.IsDelete ?? false;
            var response = MKMSClient.Send <AddSortProductResponse>(req);

            return(response);
        }
        //新增或修改指定商品的排序列表
        public JsonResult EditSortProdutDetail(SortProductDetail model)
        {
            var result = new BaseResponse()
            {
                DoFlag = false, DoResult = "保存失败,请稍后重试... ..."
            };

            try
            {
                if (model.Id > 0)
                {
                    //修改
                    model.LastUpdateTime = DateTime.Now;
                    model.LastOperator   = UserInfo.UserSysNo;
                    var res = SortProductConfigClient.Instance.UpdateSortProduct(model);
                    if (res.DoFlag)
                    {
                        result.DoFlag   = true;
                        result.DoResult = res.DoResult;
                    }
                    else
                    {
                        result.DoResult = res.DoResult;
                    }
                }
                else
                {
                    //新增
                    model.CreateTime     = DateTime.Now;
                    model.LastUpdateTime = DateTime.Now;
                    model.CreateOperator = UserInfo.UserSysNo;
                    model.LastOperator   = UserInfo.UserSysNo;
                    var res = SortProductConfigClient.Instance.AddSortProduct(model);
                    if (res.DoFlag)
                    {
                        result.DoFlag   = true;
                        result.DoResult = res.DoResult;
                    }
                    else
                    {
                        result.DoResult = res.DoResult;
                    }
                }
            }
            catch (Exception ex)
            {
                result.DoResult = "保存异常,请稍后重试... ...";
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        /// <summary>
        /// 根据Id查询
        /// </summary>
        /// <param name="sysNo"></param>
        /// <returns></returns>
        public SortProductDetail QuerySortProductEntity(int id)
        {
            var sortProductInfo = new SortProductDetail();
            var param           = new QuerySortProductEntity()
            {
                Id = id
            };
            var response = MKMSClient.Send <QuerySortProductEntityResponse>(param);

            if (response.DoFlag)
            {
                sortProductInfo = Mapper.Map <SortProductDto, SortProductDetail>(response.SortProductEntity);
            }
            return(sortProductInfo);
        }
        //2进入编辑页面
        public ActionResult EditDetail(int?id)
        {
            SortProductDetail result = new SortProductDetail();

            if (id > 0)
            {
                result = SortProductConfigClient.Instance.QuerySortProductEntity(id ?? 0);
                JavaScriptSerializer jss = new JavaScriptSerializer();
                if (result.ProductJson != null && result.ProductJson.Any())
                {
                    ViewBag.ProductJson = jss.Deserialize <List <ProductJson> >(result.ProductJson);
                }
            }
            return(View(result));
        }
Beispiel #5
0
        /// <summary>
        /// 修改商品搜索指定位置显示
        /// </summary>
        /// <param name="request"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public UpdateSortProductResponse UpdateSortProduct(SortProductDetail request)
        {
            var param = new UpdateSortProductRequest()
            {
                Id             = request.Id,
                KeyWordType    = request.KeyWordType,
                KeyWord        = request.KeyWord,
                StartTime      = request.StartTime,
                EndTime        = request.EndTime,
                ProductJson    = request.ProductJson,
                Enable         = request.Enable,
                LastOperator   = request.LastOperator,
                LastUpdateTime = request.LastUpdateTime,
            };
            var response = MKMSClient.Send <UpdateSortProductResponse>(param);

            return(response);
        }