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 { } })); } }
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 { } })); } }