示例#1
0
        // GET: Stores
        public async Task <ActionResult> Index()
        {
            var result = await Service.Get();

            ResultHelper.SetResult(this, result);

            return(View(result.stores));
        }
示例#2
0
 public ActionResult getStore(string username)
 {
     try
     {
         Stores history = _storesService.Get(_ => _.Username.Equals(username));
         return(Ok(history));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
示例#3
0
        private async Task LoadDropDownLists()
        {
            var result = await StoreService.Get();

            ResultHelper.SetResult(this, result);

            if (result.Success)
            {
                ViewData["Stores"] = new SelectList((List <Store>)result.stores, "Id", "Name");
            }
            else
            {
                ViewData["Stores"] = new SelectList(new List <Store>());
            }
        }