int i,count; string carNos,resName,resId,sql; count=grid_row_num("MG_Item"); carNos=""; for(i=1;i<count;i++){ resId=grid_get_v("MG_Item","res_id",i); if(resId==""){ break; } resName=grid_get_v("MG_Item","res_name",i); if(resName=="-"){ //车牌为 - 的直接不能保存? can_save=0; warn("第"+i+"行不能保存"); return 0; } if(carNos==""){ carNos="'"+resId+"'"; }else{ carNos=carNos+",'"+resId+"'"; } } if(carNos==""){ can_save=0; warn("当前无数据,无法保存"); return 0; } sql="select car_no from car_card where car_no in ("+carNos+")"; db_run(sql); count=db_row_count() if(count>0){ can_save=0; warn("当前有禁止退回仓库的记录"); return 0; } return 0; |