毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 计算机安全 >> 正文

基于zigbee的无线电子点菜系统 第12页

更新时间:2014-6-28:  来源:毕业论文

基于zigbee的无线电子点菜系统 第12页 
}
static  int  foods_notif_del(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];
                               
                         sprintf(value,"DELETE FROM  t1 WHERE a='%s' ",del);
                               
           sqlite3_exec(db,value,0,0,&errmsg);
                              sqlite3_get_table(db,"select * from t1",&result1,&nrow1,&ncolumn1,&errmsg1 );
                                SendDlgItemMessage (GetParent(hWnd),IDL_Add, LB_RESETCONTENT, 0, (LPARAM)0);   
                               for(j;j<(nrow1+1)*ncolumn1;j++)
                                 SendDlgItemMessage(GetParent(hWnd),IDL_Add,LB_ADDSTRING,0,result1[j]);
                                calue(hWnd); 
}
static int fd;
//设置串口
static void set_serial()
{
                   //int fd,j=0;
      int j=0;
                    char ch;
      char *dev ="/dev/ttyS0";//串口1
   fd = init_serial(dev);
   if (fd>0)
    set_speed(fd,9600);
   else {
    //printf("Can't Open Serial Port!\n");
    exit(0);
   }
   if (set_parity(fd,8,1,'n') == FALSE) {
    //printf("Set Parity Error\n");
    exit(1);
   }
   //printf("\nsuccess set\n");
  
}

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);

 << 上一页  [11] [12] [13] 下一页

基于zigbee的无线电子点菜系统 第12页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。