Beispiel #1
0
        public async Task <IActionResult> CreateNewBill(AccountBillDto input)
        {
            input.CreateUserID      = Convert.ToInt32(User.FindFirstValue(ClaimTypes.Sid));;
            input.CreateDisPlayName = User.Identity.Name;
            var model = await _accountBillService.Create(input);

            return(Json(model));
        }
Beispiel #2
0
        public async Task <ReturnValueModel> Create(AccountBillDto input)
        {
            string           strMessage = string.Empty;
            bool             IfSuccess  = true;
            ReturnValueModel model      = new ReturnValueModel();

            try
            {
                var bill = _mapper.Map <AccountBill>(input);
                await _repository.InsertAsync(bill);

                await _unitOfWork.SaveChangesAsync();
            }
            catch (System.Exception ex)
            {
                IfSuccess  = false;
                strMessage = ex.Message;
            }
            model.IfSuccess = IfSuccess;
            model.Message   = strMessage;
            return(model);
        }