示例#1
0
        public ActionResult Delete_Confirm(int id)
        {
            var strError = string.Empty;

            if (id <= 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            try
            {
                _mainStore.Delete(id);

                //Clear cache
                CachingHelpers.ClearProviderCache();
            }
            catch (Exception ex)
            {
                strError = NotifSettings.Error_SystemBusy;

                logger.Error("Failed to get Delete Provider because: " + ex.ToString());

                return(Json(new { success = true, message = strError }));
            }

            return(Json(new { success = true, message = NotifSettings.Success_Deleted }));
        }
示例#2
0
        public async Task <IActionResult> Delete(long id)
        {
            try
            {
                await _storeProvider.Delete(id);

                var emptyModel = new Store();
                var response   = new StoreResponseModel(emptyModel);
                return(Ok(response));
            }
            catch (Exception)
            {
                var result = new FailureModel(false, (int)HttpStatusCode.BadRequest, "Bad Request");
                return(BadRequest(result));
            }
        }