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> GetDetails(string itemCode) { var res = await this.GetAsync>($"DataItemApi/GetDetails?projectId={GlobalObject.curProject.ProjectId}&itemCode={itemCode}"); //OnRefresh(); if (res.code == 200) { return res.data; } else { return null;//ERROR INFO } } /// /// (计量单位)根据计量单位分类ID获取计量单位数据 /// /// 项目ID /// 计量单位分类ID。如果是空,就是所有的 /// public async Task> GetMeasuringUnitList() { var res = await this.GetAsync>($"DataItemApi/GetMeasuringUnitList?projectId={GlobalObject.curProject.ProjectId}"); //OnRefresh(); if (res.code == 200) { return res.data; } else { return null;//ERROR INFO } } public async Task SaveDetailForm(ec_dataitemdetail entity) { var res = await this.PostBodyAsync($"DataItemApi/SaveDetailForm?ProjectId={GlobalObject.curProject?.ProjectId}", entity); //if (res.code == 200) //{ // //return res.info; // return null; //} //else //{ // return res.info; // 返回错误信息 //} return res; } } }