51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
![]() |
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
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|