예제 #1
0
        public async Task <object> Post(NCIDeductionModel request)
        {
            var    http          = HttpClientHelper.NciHttpClient;
            object resultContent = new object();

            try
            {
                if (request.ID == 0)
                {
                    request.CreateBy  = SecurityHelper.CurrentPrincipal.UserId.ToString();
                    request.CreatTime = DateTime.Now;
                }
                else
                {
                    request.Updateby   = SecurityHelper.CurrentPrincipal.UserId.ToString();
                    request.UpdateTime = DateTime.Now;
                }
                request.Debitmonth      = request.Debitmonth;
                request.DeductionStatus = (int)DeductionStatus.UnCharge;
                request.DeductionType   = (int)DeductionType.NCIOpr;
                var result = await http.PostAsJsonAsync("/api/DeductionInfo/saveDeduction", request);

                resultContent = await result.Content.ReadAsAsync <object>();
            }
            catch (Exception ex)
            {
                resultContent = "-1";
            }
            return(resultContent);
        }
예제 #2
0
        public IHttpActionResult SaveDeduction(NCIDeductionModel request)
        {
            var response = service.SaveDeduction(request);

            return(Ok(response));
        }
예제 #3
0
 public BaseResponse SaveDeduction(NCIDeductionModel request)
 {
     return(base.Save <LTC_NCIDEDUCTION, NCIDeductionModel>(request, (q) => q.ID == request.ID));
 }