static void foods_notif_comin(HWND hWnd,int id,int nc,DWORD add_data)
{
char **result,**result1;
char *errmsg,*errmsg1,*sql;
int nrow,ncolumn,nrow1,ncolumn1,j=1;
char value[100],value1[100],*a[30];
// set_serial();
sqlite3_get_table(db,"select * from t1",&result,&nrow,&ncolumn,&errmsg);
for(j;j<(nrow+1) *ncolumn;j++)
{
sprintf(value,"INSERT INTO t VALUES('%s')",result[j]);
sqlite3_exec(db,value,0,0,&errmsg);
SendDlgItemMessage(GetParent(hWnd),IDL_Check,LB_ADDSTRING,0,result[j]);
sprintf(value1,"select id from cdish where dishname=('%s')",result[j]);
sqlite3_get_table(db,value1,&result1,&nrow1,&ncolumn1,&errmsg1);
a[j]=result1[1];
}
sqlite3_exec(db,"DELETE FROM T1",0,0,&errmsg);
SendDlgItemMessage (GetParent(hWnd),IDL_Add, LB_RESETCONTENT, 0, (LPARAM)0);
for(j=1;j<( nrow + 1 ) * ncolumn; j++)
{
printf("ID=%s\n",a[j]);
// write(fd,a[j],sizeof(a[j]));
// write(fd,"\n",1);
}
// close(fd);
sqlite3_free_table(result);
sqlite3_free_table(result1);
}
static void display(HWND hDlg)
{
}
static void JIEZHANG(HWND hDlg)
{
int nrow=0,ncolumn=0;
char * sql,*errmsg,**result;
HDC hdc;
RECT rect ;
sql="DELETE FROM t1";
sqlite3_exec(db,sql,0,0,&errmsg);
sql="DELETE FROM t";
sqlite3_exec(db,sql,0,0,&errmsg);
SendDlgItemMessage (hDlg,IDL_Check, LB_RESETCONTENT, 0, (LPARAM)0);
set_serial();
// write(fd,'J',sizeof(a[j]));
SetTimer(hDlg,Return_ID,300);
}
static void foods_notif_PJ(HWND hWnd,int id,int nc,DWORD add_data)
{
int nrow=0,ncolumn=0,j=1;
char value[100],**result,*errmsg;
sprintf(value,"select jsname from t2 where js='%s'","啤酒");
sqlite3_get_table(db,value,&result,&nrow,&ncolumn,&errmsg);
SendDlgItemMessage (GetParent(hWnd),Check_JS_ID, LB_RESETCONTENT, 0, (LPARAM)0);
for(j;j<(nrow+1)*ncolumn;j++)
{
SendDlgItemMessage(GetParent(hWnd),Check_JS_ID,LB_ADDSTRING,0,result[j]);
}
sqlite3_free_table(result);
}
static void foods_notif_YL(HWND hWnd,int id,int nc,DWORD add_data)
{
int nrow=0,ncolumn=0,j=1;
char value[100],**result,*errmsg;
sprintf(value,"select jsname from t2 where js='%s'","饮料");
sqlite3_get_table(db,value,&result,&nrow,&ncolumn,&errmsg);
SendDlgItemMessage (GetParent(hWnd),Check_JS_ID, LB_RESETCONTENT, 0, (LPARAM)0);
for(j;j<(nrow+1)*ncolumn;j++)
{
SendDlgItemMessage(GetParent(hWnd),Check_JS_ID,LB_ADDSTRING,0,result[j]);
}
sqlite3_free_table(result);
}
static void foods_notif_check_SJ(HWND hWnd,int id,int nc,DWORD add_data)
{
if(nc==LBN_CLICKED||nc==LBN_ENTER)
{
int clickn=SendMessage(hWnd,LB_GETCURSEL,0,0L);
if(clickn>=0)
{
char string[50];//如果改成指针,出现内存错误,花了三个小时查找!
SendMessage(hWnd,LB_GETTEXT,clickn,(LPARAM)JS_del);