1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import {Injectable} from "@angular/core";
- import {Events} from "ionic-angular";
- import {AppConfig} from "../app.config";
- import {ServiceCommon} from "./service.common";
- import {Http} from "@angular/http";
- import {ResultMessage} from "../../viewmodel/result";
- import {DictionaryItemView} from "../../viewmodel/common/dictionaryItemView";
- @Injectable()
- export class SystemService {
- constructor (public events: Events, private http: Http) {
- }
- getDictionaryItemViewList(dictionaryCode:string): Promise<ResultMessage>{
- let url: string = AppConfig.getServiceUrl();
- url += "CommonServices/GetDictionaryViewList";
- return this.http.post(url, JSON.stringify({ dictionaryCode:dictionaryCode}), {headers: ServiceCommon.getHeader()})
- .toPromise()
- .then(res => {
- let dictionaryItemList = res.json();
- if(dictionaryItemList)
- {
- return{
- isSuccess: true,
- message: "",
- data: res.json().map(x => {
- return {
- dictionaryItemID:x.DictionaryItemID,
- dictionaryCode:x.DictionaryCode,
- dictionaryName:x.DictionaryName,
- orderNo:x.OrderNo,
- code:x.Code,
- name:x.Name,
- value:x.Value,
- } as DictionaryItemView
- })
- }as ResultMessage;
- }
- })
- }
- getSchoolAreaListWithoutSocial(): Promise<ResultMessage>{
- let url: string = AppConfig.getServiceUrl();
- url += "UserServices/GetSchoolAreaWithoutSocial";
- return this.http.post(url, JSON.stringify({ bindType:2}), {headers: ServiceCommon.getHeader()})
- .toPromise()
- .then(res => {
- let dictionaryItemList = res.json();
- if(dictionaryItemList)
- {
- return{
- isSuccess: true,
- message: "",
- data: dictionaryItemList
- } as ResultMessage;
- }
- })
- }
- }
|