public JsonResult Update(InputInsertUpdatePayment input) { input.userId = RDAuthorize.UserId; input.branchCode = RDAuthorize.BranchCode; input.stringJsonfileList = input.fileList != null?JsonConvert.SerializeObject(input.fileList) : null; var result = _paymentservice.updateRepayment(input); return(Json(result)); }
////// <summary> ///Insert Thêm mới phiếu thu /// dutp /// 22/7/20 /// </summary> /// <param name="input"></param> /// <returns></returns> /// public ResultModel updateRepayment(InputInsertUpdatePayment input) { try { SqlParameter[] prms = new SqlParameter[] { new SqlParameter { ParameterName = "repaymentId", DbType = DbType.Int64, Value = input.repaymentId, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "scheduleId", DbType = DbType.Int64, Value = input.scheduleId, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "insuranceId", DbType = DbType.Int64, Value = input.insuranceId, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "ftttNo", DbType = DbType.String, Value = input.ftttNo == null ? (object)DBNull.Value : input.ftttNo, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "isExternalRepayment", DbType = DbType.Int16, Value = input.isExternalRepayment, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "paymentDate", DbType = DbType.Date, Value = input.paymentDate == null ? (object)DBNull.Value: input.paymentDate, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "totalAmount", DbType = DbType.Decimal, Value = input.totalAmount, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "userId", DbType = DbType.String, Value = input.userId == null ? (object)DBNull.Value : input.userId, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "branchCode", DbType = DbType.String, Value = input.branchCode == null ? (object)DBNull.Value : input.branchCode, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "fileList", DbType = DbType.String, Value = input.stringJsonfileList == null ? (object)DBNull.Value : input.stringJsonfileList, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "resultMessage", DbType = DbType.String, Direction = ParameterDirection.Output, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "resultCode", DbType = DbType.Int32, Direction = ParameterDirection.Output, Size = Int32.MaxValue } }; var result = _Repository.ExecWithStoreProcedureCommand(Store_updateRepayment, prms); var resultObject = JsonConvert.DeserializeObject <ResultModel>(result.errorMessage); return(resultObject); } catch (Exception ex) { HDBH.Log.WriteLog.Error("PaymentService => updateRepayment", ex); return(new ResultModel()); } }