MusicForm mform = (MusicForm) form;
int mid = Integer.parseInt(s_music_id);
String msg = null;
do{
//�ж��û��Ƿ��¼���Ƿ����Լ�����վ
SessionUserObject loginUser = super.getLoginUser(request, response);
if(loginUser==null){
msg = getMessage(request, null, "error.user_not_login");
break;
}
if(loginUser.getStatus()!=UserBean.STATUS_NORMAL){
msg = getMessage(request, null, "error.user_disabled");
break;
}
if(loginUser.getOwnSiteId()<=0){
msg = getMessage(request, null, "error.user_not_have_a_site");
break;
}
//�ж��û��ĸ��������Ƿ���Ч
SiteBean toSite = super.getSiteByID(loginUser.getOwnSiteId());
if(toSite==null){
msg = super.getMessage(request, null, "error.site_not_available");
break;
}
MusicBean mbean = MusicDAO.getMusicByID(mid);
if(mbean!=null && mbean.getSite().getId()==mform.getSid())
{
MusicBean music = new MusicBean();
music.setCreateTime(new Date());
music.setMusicBox(null);
music.setAlbum(mbean.getAlbum());
music.setSinger(mbean.getSinger());
music.setSite(new SiteBean(loginUser.getOwnSiteId()));
music.setTitle(mbean.getTitle());
music.setUrl(mbean.getUrl());
music.setWord(mbean.getWord());
MusicDAO.addMusic(music);
msg = getMessage(request, null, "music.collected", music.getTitle());