using BLL; using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; using SgManager.AI; using System.Configuration; using Newtonsoft.Json.Linq; using Newtonsoft.Json; namespace WebAPI.Controllers { /// /// /// public class ShiYeController : ApiController { #region 人员档案 #region 人员信息 /// /// 获取下拉框 /// /// public Model.ResponeData GetPersonDropDownList(string projectId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYPersonService.GetPersonDropDownList( projectId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// 人员信息获取接口 /// /// /// /// /// /// public Model.ResponeData GetPersonList(string projectId,string isUser, string unitId, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYPersonService.getPersonList(projectId, isUser,unitId, pageIndex, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetPersonByName(string name) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYPersonService.getPersonByName(name); responeData.data = new { getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetPersonById(string personId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYPersonService.GetPersonById(personId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// 获取详情 /// /// /// public Model.ResponeData AddPerson(Model.SY_Person person) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYPersonService.AddPerson(person); responeData.code = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdatePerson(Model.SY_Person person) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYPersonService.UpdatePerson(person); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeletePersonById(string personId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYPersonService.DeletePersonById(personId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 人员资质 /// /// /// /// /// /// /// /// public Model.ResponeData getPersonQualityList(string projectId, string isQuality, string unitId, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYPersonService.getPersonQualitList(projectId, unitId, isQuality, pageIndex, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData getPersonQualitybyId(string personId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYPersonService.getPersonQualityInfo( personId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// 获取详情 /// /// /// public Model.ResponeData AddPersonQuality(Model.PersonQualityItem person) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYPersonService.SavePersonQuality(person); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdatePersonQuality(Model.PersonQualityItem person) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYPersonService.SavePersonQuality(person); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #endregion #region 隐患 /// /// 获取下拉框 /// /// public Model.ResponeData GetYFInitDropDownList(string projectId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = APIShiYeService.GetYFInitDropDownList(projectId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// /// /// public Model.ResponeData GetRectifyList(string projectId, int pageIndex,string IsRectify) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = APIShiYeService.getRectifyList(projectId, pageIndex, IsRectify, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetRectifyById(string rectifyNoticesId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = APIShiYeService.GetRectifyNoticesById(rectifyNoticesId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddRectify(Model.SY_Check_RectifyNotices rectifyNotices) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { APIShiYeService.AddRectifyNotices(rectifyNotices); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateRectify(Model.SY_Check_RectifyNotices rectifyNotices) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { APIShiYeService.UpdateRectifyNotices(rectifyNotices); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteRectifyById(string rectifyNoticesId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { APIShiYeService.DeleteRectifyNotices(rectifyNoticesId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 风险 /// /// 获取下拉框 /// /// public Model.ResponeData GetFXInitDropDownList(string projectId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = APIShiYeService.GetFXInitDropDownList(projectId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// /// /// public Model.ResponeData GetRoutingList(string projectId, int pageIndex, string PatrolResult) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = APIShiYeService.getRoutingList(projectId, pageIndex, PatrolResult, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetRoutingById(string routingInspectionId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = APIShiYeService.GetRoutingInspectionByRoutingInspectionId(routingInspectionId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddRouting(Model.SY_Hazard_RoutingInspection routingInspection) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { APIShiYeService.AddRoutingInspection(routingInspection); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateRouting(Model.SY_Hazard_RoutingInspection routingInspection) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { APIShiYeService.UpdateRoutingInspection(routingInspection); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteRoutingById(string routingInspectionId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { APIShiYeService.DeleteRoutingInspection(routingInspectionId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 作业票 #region 动火作业票 /// /// /// /// /// /// /// public Model.ResponeData GetFireWorkList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetFireWorkList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetFireWorkById(string fireWorkId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetFireWorkById(fireWorkId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddFireWork(Model.SY_License_FireWork fireWork) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.AddFireWork(fireWork); responeData.code = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateFireWork(Model.SY_License_FireWork fireWork) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateFireWork(fireWork); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteFireWorkById(string fireWorkId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteFireWorkById(fireWorkId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 高处作业票 /// /// /// /// /// /// /// public Model.ResponeData GetHeightWorkList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetHeightWorkList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetHeightWorkById(string heightWorkId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetHeightWorkById(heightWorkId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddHeightWork(Model.SY_License_HeightWork heightWork) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.AddHeightWork(heightWork); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateHeightWork(Model.SY_License_HeightWork heightWork) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateHeightWork(heightWork); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteHeightWorkById(string heightWorkId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteHeightWorkById(heightWorkId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 受限空间作业票 /// /// /// /// /// /// /// public Model.ResponeData GetLimitedSpaceList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetLimitedSpaceList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetLimitedSpaceById(string limitedSpaceId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetLimitedSpaceById(limitedSpaceId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddLimitedSpace(Model.SY_License_LimitedSpace limitedSpace) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.AddLimitedSpace(limitedSpace); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateLimitedSpace(Model.SY_License_LimitedSpace limitedSpace) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateLimitedSpace(limitedSpace); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteLimitedSpaceById(string limitedSpaceId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteLimitedSpaceById(limitedSpaceId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 断路(占道)作业票 /// /// /// /// /// /// /// public Model.ResponeData GetOpenCircuitList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetOpenCircuitList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetOpenCircuitById(string openCircuitId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetOpenCircuitById(openCircuitId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddOpenCircuit(Model.SY_License_OpenCircuit openCircuit) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.AddOpenCircuit(openCircuit); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateOpenCircuit(Model.SY_License_OpenCircuit openCircuit) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateOpenCircuit(openCircuit); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteOpenCircuitById(string openCircuitId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteOpenCircuitById(openCircuitId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 动土作业票 /// /// /// /// /// /// /// public Model.ResponeData GetBreakGroundList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetBreakGroundList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetBreakGroundById(string breakGroundId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetBreakGroundById(breakGroundId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddBreakGround(Model.SY_License_BreakGround breakGround) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.AddBreakGround(breakGround); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateBreakGround(Model.SY_License_BreakGround breakGround) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateBreakGround(breakGround); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteBreakGroundById(string breakGroundId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteBreakGroundById(breakGroundId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 吊装作业票 /// /// /// /// /// /// /// public Model.ResponeData GetLiftingWorkList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetLiftingWorkList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetLiftingWorkById(string liftingWorkId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetLiftingWorkById(liftingWorkId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddLiftingWork(Model.SY_License_LiftingWork liftingWork) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.AddLiftingWork(liftingWork); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateLiftingWork(Model.SY_License_LiftingWork liftingWork) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateLiftingWork(liftingWork); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteLiftingWorkById(string liftingWorkId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteLiftingWorkById(liftingWorkId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 临电作业票 /// /// /// /// /// /// /// public Model.ResponeData GetTempElectricityList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetTempElectricityList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetTempElectricityById(string tempElectricityId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetTempElectricityById(tempElectricityId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddTempElectricity(Model.SY_License_TempElectricity tempElectricity) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.AddTempElectricity(tempElectricity); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateTempElectricity(Model.SY_License_TempElectricity tempElectricity) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateTempElectricity(tempElectricity); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteTempElectricityById(string tempElectricityId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteTempElectricityById(tempElectricityId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #region 盲板作业票 /// /// /// /// /// /// /// public Model.ResponeData GetBlindPlateList(string projectId, string unitId, string states, int pageIndex) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getDataList = SYLicensePublicService.GetBlindPlateList(projectId, unitId, pageIndex, states, out int count); int pageCount = count; responeData.data = new { pageCount, getDataList }; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData GetBlindPlateById(string blindPlateId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { var getData = SYLicensePublicService.GetBlindPlateById(blindPlateId); responeData.data = getData; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData AddBlindPlate(Model.SY_License_BlindlWork blindPlate) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.AddBlindPlate(blindPlate); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData UpdateBlindPlate(Model.SY_License_BlindlWork blindPlate) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.UpdateBlindPlate(blindPlate); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// /// /// /// public Model.ResponeData DeleteBlindPlateById(string blindPlateId) { var responeData = new Model.ResponeData(); try { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { SYLicensePublicService.DeleteBlindPlateById(blindPlateId); responeData.code = 1; } } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion #endregion #region 获取所有单位 /// /// 获取所有单位 /// /// public Model.ResponeData getUnitLists(string projectId) { var responeData = new Model.ResponeData(); try { responeData.data = SYLicensePublicService.getUnitLists(projectId); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } #endregion } }