大佬您好,这是工程文件和API代码
public async Task TestPostAPI()
{
//获取post请求的数据
var form = await Context.Request.ReadFormAsync();
var B_Type = form["B_Type"][0];
var S_Type = form["S_Type"][0];
var G_Type = form["G_Type"][0];
var B_gongjia = form["B_gongjia"][0];
var G_gongjia = form["G_gongjia"][0];
await this.Context.Response.WriteAsync(B_Type + S_Type + G_Type + B_gongjia + G_gongjia);
//使用AddTableData方法向字典分类表中添加数据
this.DataAccess.AddTableData("工价表", new Dictionary<string, object> { { "大品类", B_Type },
{ "小品类", S_Type }, { "工艺分类", G_Type }, { "板房工价", B_gongjia }, { "工厂工价", G_gongjia } });
}
|