using BLL; using System; using System.Linq; using System.Web.Http; namespace WebAPI.Controllers { /// /// /// public class UnitController : ApiController { #region 根据UnitId获取单位信息 /// /// 根据UnitId获取单位信息 /// /// /// public Model.ResponeData getUnitByUnitId(string unitId) { var responeData = new Model.ResponeData(); try { responeData.data = APIUnitService.getUnitByUnitId(unitId); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 获取所有单位 /// /// 获取所有单位 /// /// public Model.ResponeData getUnitLists() { var responeData = new Model.ResponeData(); try { responeData.data = APIUnitService.getUnitLists(); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 获取项目所有单位 /// /// 获取项目所有单位 /// /// public Model.ResponeData getProjectUnitLists(string projectId) { var responeData = new Model.ResponeData(); try { responeData.data = APIUnitService.getProjectUnitLists(projectId); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5) /// /// 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5) /// /// 项目ID /// 类型(null 所有单位) /// public Model.ResponeData getUnitByProjectIdUnitType(string projectId, string unitType) { var responeData = new Model.ResponeData(); try { responeData.data = APIUnitService.getUnitByProjectIdUnitType(projectId, unitType); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5) /// /// 项目ID /// 查询条件 /// 类型(null 所有单位) /// public Model.ResponeData getUnitByProjectIdUnitTypeQuery(string projectId, string strParam, string unitType) { var responeData = new Model.ResponeData(); try { responeData.data = APIUnitService.getUnitByProjectIdUnitTypeQuery(projectId, strParam, unitType); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion } }