Exemplo n.º 1
0
        public ActionResult UpsertConfig(VendorProductCouponPriceConfigModel model)
        {
            if (string.IsNullOrWhiteSpace(model.Pid))
            {
                return(Json(new { Status = false, Msg = "请选择服务Pid" }, JsonRequestBehavior.AllowGet));
            }
            var manager = new VendorProductCouponPriceManager();
            var isExist = manager.IsExistVendorProductCouponPriceConfig(model);

            if (isExist)
            {
                return(Json(new { Status = false, Msg = "已存在重复的数据,不能重复添加" }, JsonRequestBehavior.AllowGet));
            }
            var result = manager.UpSertVendorProductCouponPriceConfig(model, User.Identity.Name);

            return(Json(new { Status = result, Msg = $"操作{(result ? "成功" : "失败")}" }, JsonRequestBehavior.AllowGet));
        }