package com.dev.swms.server.service.base.pojo;

import java.util.Date;
import java.util.List;

import com.dev.energy.server.service.pojo.DefaultBaseManager;
import com.dev.energy.server.web.security.UserHolder;
import com.dev.swms.server.model.base.Province;
import com.dev.swms.server.service.base.ProvinceManager;

public class DefaultProvinceManager  extends DefaultBaseManager implements ProvinceManager{

	@Override
	public void saveProvince(Province p) {
			p.setDisabled(false);//默认否
			p.setCreatDate(new Date());
			p.setCreatPeople(UserHolder.getUser().getName());
				commonDao.store(p);
			
			
	
	}

	@Override
	public void deleteProvince(List<Long> ids) {
		for(Long id : ids) {
			Province p = this.load(Province.class, id);
			this.delete(p);
		}
		
	}

	@Override
	public void ProvinceInvalid(List<Long> ids) {
		for(Long id : ids) {
			Province p = this.load(Province.class, id);
			p.setDisabled(true);
		}
		
	}

	@Override
	public void Provincerestore(List<Long> ids) {
		for(Long id : ids) {
			Province p = this.load(Province.class, id);
			p.setDisabled(false);
		}
		
	}

}
