예제 #1
0
        public AjaxResult Delete([FromBody] List <Guid> listID)
        {
            var ajaxresult = new AjaxResult();

            try
            {
                using (FundBL fundBL = new FundBL())
                {
                    foreach (var id in listID)
                    {
                        fundBL.DeleteFundBL(id);
                    }
                    ajaxresult.Data = fundBL.GetAllFund();
                }

                ajaxresult.Success = true;
            }
            catch (Exception ex)
            {
                ajaxresult.Success = false;
                ajaxresult.Data    = ex;
                ajaxresult.Message = Resources.ErrorDeleteFund;
            }
            return(ajaxresult);
        }
예제 #2
0
        public async Task <AjaxResult> Get()
        {
            var ajaxresult = new AjaxResult();

            try
            {
                await Task.Delay(500);

                using (FundBL fundBL = new FundBL())
                {
                    ajaxresult.Data    = fundBL.GetAllFund();
                    ajaxresult.Success = true;
                }
            }
            catch (Exception ex)
            {
                ajaxresult.Success = false;
                ajaxresult.Data    = ex;
                ajaxresult.Message = Resources.ErrorGetListFund;
            }
            return(ajaxresult);
        }