CString sql="select count(*) as t from tbl_personinfo where id='"+id+"'";
m_DateDriver.ExecuteSQL(sql);
int count;
m_DateDriver.GetIntValue("t",count);
if(count!=0)
{
sql="update tbl_personinfo set Phone='"+phone+"', NAME='"+name+"',Starttime='"+starttime+"',Endtime='"+endtime+"' ,Memo='"+memo+"' where ID='"+id+"'";
}
else
{
sql="insert into tbl_personinfo(ID,NAME,Starttime,Endtime,Phone,Memo,State) values('"+id+"','"+name+"','"+starttime+"','"+endtime+"','"+phone+"','"+memo+"',+0)";
}
if(m_DateDriver.ExecuteSQL(sql)&&m_CurStat==MODIFY)
{
MSGTYPE msgtype=FORMNOTIFYLISTTOREFRESH;
::SendMessage(AfxGetMainWnd()->m_hWnd,FORMNOTIFYLIST_REFRESH,(WPARAM)msgtype,NULL);
}