예제 #1
0
        public ActionResult ReDisableStores(string SID)
        {
            string[]   strIds = SID.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            List <int> list   = new List <int>();

            foreach (string id in strIds)
            {
                list.Add(int.Parse(id));
            }

            var            flag          = false;
            IStoresService storesService = ServiceFactory.Create <IStoresService>();

            using (TransactionScope scope = TransactionScopeHelper.GetTran())
            {
                foreach (var item in list)
                {
                    var data = storesService.GetEntity(item);
                    data.Disabled = false;
                    storesService.UpdateEntity(data);
                }
                scope.Complete();
                flag = true;
            }

            return(Json(new Result(flag, ResultType.Other), JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult SaveProfile(int storeID, string profile)
        {
            bool           result        = false;
            IStoresService storesService = ServiceFactory.Create <IStoresService>();
            var            store         = storesService.GetEntity(storeID);

            if (store.ShopId == CurrentInfo.CurrentShop.ID)
            {
                store.Profile = profile;
                result        = storesService.UpdateEntity(store);
            }

            return(Json(new Result()
            {
                success = result, msg = ""
            }, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        //public JsonResult GetVirtualShops(int shopID)
        //{
        //    var virtualShops = ServiceHelper.GetCommonService.GetVirtualShops(shopID);
        //    return Json(new { success = true, VirtualShops = virtualShops }, JsonRequestBehavior.AllowGet);
        //}

        //门店绑定公众号和解绑公众号操作
        public JsonResult ToggleVirtualShops(int storeID, int?virtualShopsID)
        {
            IStoresService storesService = ServiceFactory.Create <IStoresService>();

            bool result     = false;
            var  storeModel = storesService.GetEntity(storeID);

            if (storeModel != null)
            {
                if (virtualShopsID != null)
                {
                    storeModel.VirtualShopsID = virtualShopsID;
                }
                else
                {
                    storeModel.VirtualShopsID = null;
                }
                result = storesService.UpdateEntity(storeModel);
            }
            //设置成功
            return(Json(new Result(result, result ? (virtualShopsID != null ? "绑定成功" : "解绑成功") : "操作失败"), JsonRequestBehavior.AllowGet));
        }