66 lines
2.0 KiB
C#
Raw Normal View History

2025-08-15 15:36:40 +08:00
using System.Collections.Generic;
using System.Threading.Tasks;
using SWS.Commons;
using SWS.Model;
namespace SWS.Service
{
public class DataItemService : HttpService
{
public DataItemService( ) : base()
{
}
public async Task<List<ec_dataitemdetail>> GetDetails(string itemCode)
{
var res = await this.GetAsync<List<ec_dataitemdetail>>($"DataItemApi/GetDetails?projectId={GlobalObject.curProject.ProjectId}&itemCode={itemCode}");
//OnRefresh();
if (res.code == 200)
{
return res.data;
}
else
{
return null;//ERROR INFO
}
}
/// <summary>
/// (计量单位)根据计量单位分类ID获取计量单位数据
/// </summary>
/// <param name = "projectId" >项目ID</param >
/// <param name="measuringUnitTypeID">计量单位分类ID。如果是空就是所有的</param>
/// <returns></returns>
public async Task<List<ec_measuring_unit>> GetMeasuringUnitList()
{
var res = await this.GetAsync<List<ec_measuring_unit>>($"DataItemApi/GetMeasuringUnitList?projectId={GlobalObject.curProject.ProjectId}");
//OnRefresh();
if (res.code == 200)
{
return res.data;
}
else
{
return null;//ERROR INFO
}
}
2025-09-04 18:28:02 +08:00
public async Task<object> SaveDetailForm(ec_dataitemdetail entity)
{
var res = await this.PostBodyAsync<ec_dataitemdetail, ec_dataitemdetail>($"DataItemApi/SaveDetailForm?ProjectId={GlobalObject.curProject?.ProjectId}", entity);
2025-09-12 12:03:20 +08:00
//if (res.code == 200)
//{
// //return res.info;
// return null;
//}
//else
//{
// return res.info; // 返回错误信息
//}
return res;
2025-09-04 18:28:02 +08:00
}
2025-08-15 15:36:40 +08:00
}
}