public ApiResult AddCostData(AddCostVM CostInfo) { List <Claim> Claims = new JwtSecurityTokenHandler().ReadJwtToken(Request.Headers["Authorization"].ToString().Replace("Bearer ", "")).Claims.ToList(); var data = this._costService.AddCostData(Convert.ToInt32(Claims[1].Value), CostInfo); return(new ApiResult(data)); }
public object AddCostData(int id, AddCostVM costInfo) { try { using (var connection = new OracleConnection(_connectionString)) { var result = connection.Execute(_costSqlTemplate.AddCostData, new { USER_ID = id, COSTTYPE = costInfo.CostType, COSTCOUNT = costInfo.CostCount, FILENAME = costInfo.CostFileName.FileName, NEWFILENAME = costInfo.CostFileName.NewFileName, DATETIME = DateTime.Now, STATUS = "未审核" }); return(result); } } catch (Exception ex) { ex.ToString(); throw; } }
public object AddCostData(int id, AddCostVM costInfo) { var data = this._costRepository.AddCostData(id, costInfo); return(data); }