Exemplo n.º 1
0
        public JsonResult GetStoreList()
        {
            var storeApi = new StoreApi();
            var stores   = storeApi.Get().ToList();

            if (stores != null)
            {
                return(Json(new
                {
                    status = new
                    {
                        success = true,
                        status = ConstantManager.STATUS_SUCCESS,
                        message = ConstantManager.MES_SUCCESS
                    },
                    data = new
                    {
                        data = new
                        {
                            store_list = stores
                        }
                    }
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new
                {
                    status = new
                    {
                        success = false,
                        status = ConstantManager.STATUS_SUCCESS,
                        message = ConstantManager.MES_FAIL
                    },
                    data = new
                    {
                    }
                }));
            }
        }
Exemplo n.º 2
0
        public JsonResult GetStoreInfo(int storeId)
        {
            var storeApi = new StoreApi();
            var store    = storeApi.Get().Where(q => q.ID == storeId).FirstOrDefault();

            if (store != null)
            {
                return(Json(new
                {
                    status = new
                    {
                        success = true,
                        status = ConstantManager.STATUS_SUCCESS,
                        message = ConstantManager.MES_SUCCESS
                    },
                    data = new
                    {
                        data = new
                        {
                            store = store
                        }
                    }
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new
                {
                    status = new
                    {
                        success = false,
                        status = ConstantManager.STATUS_SUCCESS,
                        message = ConstantManager.MES_FAIL
                    },
                    data = new
                    {
                    }
                }));
            }
        }