// 调出密码框
 private void IsAdminSet(String NowKey) {
   if ((NowKey.equals("8")) && (pwdcount == 0)) {
     pwdcount++;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
   } else if ((NowKey.equals("3")) && (pwdcount == 1)) {
     pwdcount++;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
   } else if ((NowKey.equals("7")) && (pwdcount == 2)) {
     pwdcount++;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
   } else if ((NowKey.equals("1")) && (pwdcount == 3)) {
     pwdcount++;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
   } else if ((NowKey.equals("8")) && (pwdcount == 4)) {
     pwdcount++;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
   } else if ((NowKey.equals("5")) && (pwdcount == 5)) {
     pwdcount++;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
   } else if ((NowKey.equals("5")) && (pwdcount == 6)) {
     pwdcount++;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
   } else if ((NowKey.equals("7")) && (pwdcount == 7)) {
     pwdcount = 0;
     pwdMode = false;
     ToolClass.Log(
         ToolClass.INFO, "EV_JNI", "APP<<pwd=" + pwdcount + "[" + NowKey + "]", "log.txt");
     passdialog();
   } else {
     pwdMode = !pwdMode;
     pwdcount = 0;
   }
 }
 // 密码框
 private void passdialog() {
   //    	View myview=null;
   //		// TODO Auto-generated method stub
   //		LayoutInflater factory = LayoutInflater.from(context);
   //		myview=factory.inflate(R.layout.selectinteger, null);
   //		final EditText dialoginte=(EditText) myview.findViewById(R.id.dialoginte);
   //
   //		Dialog dialog = new AlertDialog.Builder(context)
   //		.setTitle("设置")
   //		.setPositiveButton("确定", new DialogInterface.OnClickListener()
   //		{
   //
   //			@Override
   //			public void onClick(DialogInterface dialog, int which)
   //			{
   //				boolean istrue=false;
   //				// TODO Auto-generated method stub
   //
   //	ToolClass.Log(ToolClass.INFO,"EV_JNI","APP<<数值="+dialoginte.getText().toString(),"log.txt");
   //				//调出维护页面密码
   //				vmc_system_parameterDAO parameterDAO = new vmc_system_parameterDAO(context);//
   // 创建InaccountDAO对象
   //			    // 获取所有收入信息,并存储到List泛型集合中
   //		    	Tb_vmc_system_parameter tb_inaccount = parameterDAO.find();
   //		    	if(tb_inaccount!=null)
   //		    	{
   //		    		String Pwd=tb_inaccount.getMainPwd().toString();
   //		    		if(Pwd==null)
   //		    		{
   //		    			//ToolClass.Log(ToolClass.INFO,"EV_JNI","APP<<数值=null","log.txt");
   //		    			istrue=passcmp(null,dialoginte.getText().toString());
   //		    		}
   //		    		else
   //		    		{
   //		    			//ToolClass.Log(ToolClass.INFO,"EV_JNI","APP<<数值="+Pwd,"log.txt");
   //		    			istrue=passcmp(Pwd,dialoginte.getText().toString());
   //		    		}
   //		    	}
   //		    	else
   //		    	{
   //		    		istrue=passcmp(null,dialoginte.getText().toString());
   //				}
   //
   //		    	if(istrue)
   //		    	{
   //		    		ToolClass.Log(ToolClass.INFO,"EV_JNI","APP<<确定退出","log.txt");
   //		    		//步骤二、fragment向activity发送回调信息
   //		        	listterner.finishBusiness();
   //		    	}
   //		    	else
   //		    	{
   //		    		listterner.restarttimer();//重新打开定时器
   //				}
   //			}
   //		})
   //		.setNegativeButton("取消",  new DialogInterface.OnClickListener()//取消按钮,点击后调用监听事件
   //    	{
   //			@Override
   //			public void onClick(DialogInterface dialog, int which)
   //			{
   //				// TODO Auto-generated method stub
   //				listterner.restarttimer();//重新打开定时器
   //			}
   //    	})
   //		.setView(myview)//这里将对话框布局文件加入到对话框中
   //		.create();
   //		dialog.show();
   listterner.stoptimer(); // 关闭定时器
   ToolClass.Log(ToolClass.INFO, "EV_JNI", "APP<<打开密码框", "log.txt");
   // 步骤二、fragment向activity发送回调信息
   listterner.finishBusiness();
 }
 // num出货柜号,type=1输入数字,type=0回退数字
 private void chuhuo(String num, int type) {
   if (type == 1) {
     if (count < 3) {
       count++;
       huo = huo + num;
       txtadsTip.setText(huo);
     }
   } else if (type == 0) {
     if (count > 0) {
       count--;
       huo = huo.substring(0, huo.length() - 1);
       if (count == 0) txtadsTip.setText("");
       else txtadsTip.setText(huo);
     }
   }
   if (count == 3) {
     cabID = huo.substring(0, 1);
     huoID = huo.substring(1, huo.length());
     vmc_columnDAO columnDAO = new vmc_columnDAO(context); // 创建InaccountDAO对象		
     Tb_vmc_product tb_inaccount = columnDAO.getColumnproduct(cabID, huoID);
     if (tb_inaccount != null) {
       productID = tb_inaccount.getProductID().toString();
       prosales = String.valueOf(tb_inaccount.getSalesPrice());
       proImage = tb_inaccount.getAttBatch1();
       proID = productID + "-" + tb_inaccount.getProductName().toString();
       ToolClass.Log(
           ToolClass.INFO,
           "EV_JNI",
           "APP<<商品proID="
               + proID
               + " productID="
               + productID
               + " proType="
               + "2"
               + " cabID="
               + cabID
               + " huoID="
               + huoID
               + " prosales="
               + prosales
               + " count="
               + "1",
           "log.txt");
       count = 0;
       huo = "";
       txtadsTip.setText("");
       //				Intent intent = null;// 创建Intent对象
       //	        	intent = new Intent(context, BusgoodsSelect.class);// 使用Accountflag窗口初始化Intent
       //	        	intent.putExtra("proID", proID);
       //	        	intent.putExtra("productID", productID);
       //	        	intent.putExtra("proImage", proImage);
       //	        	intent.putExtra("prosales", prosales);
       //	        	intent.putExtra("procount", "1");
       //	        	intent.putExtra("proType", "2");//1代表通过商品ID出货,2代表通过货道出货
       //	        	intent.putExtra("cabID", cabID);//出货柜号,proType=1时无效
       //	        	intent.putExtra("huoID", huoID);//出货货道号,proType=1时无效
       //
       //
       ////	        	OrderDetail.setProID(proID);
       ////            	OrderDetail.setProductID(productID);
       ////            	OrderDetail.setProType("2");
       ////            	OrderDetail.setCabID(cabID);
       ////            	OrderDetail.setColumnID(huoID);
       ////            	OrderDetail.setShouldPay(Float.parseFloat(prosales));
       ////            	OrderDetail.setShouldNo(1);
       //
       //	        	startActivityForResult(intent,REQUEST_CODE);// 打开Accountflag
       Map<String, String> str = new HashMap<String, String>();
       str.put("proID", proID);
       str.put("productID", productID);
       str.put("proImage", proImage);
       str.put("prosales", prosales);
       str.put("procount", "1");
       str.put("proType", "2"); // 1代表通过商品ID出货,2代表通过货道出货
       str.put("cabID", cabID); // 出货柜号,proType=1时无效
       str.put("huoID", huoID); // 出货货道号,proType=1时无效
       listterner.gotoBusiness(3, str);
     } else {
       ToolClass.Log(
           ToolClass.INFO,
           "EV_JNI",
           "APP<<商品proID="
               + proID
               + " productID="
               + productID
               + " proType="
               + "2"
               + " cabID="
               + cabID
               + " huoID="
               + huoID
               + " prosales="
               + prosales
               + " count="
               + "1",
           "log.txt");
       count = 0;
       huo = "";
       txtadsTip.setText("");
     }
   }
 }
Esempio n. 4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.log);
    // 设置横屏还是竖屏的布局策略
    this.setRequestedOrientation(ToolClass.getOrientation());
    df = new SimpleDateFormat("yyyy"); // 设置日期格式
    date = df.format(new Date());
    mYear = Integer.parseInt(date);
    eYear = Integer.parseInt(date);
    df = new SimpleDateFormat("MM"); // 设置日期格式
    date = df.format(new Date());
    mMon = Integer.parseInt(date);
    eMon = Integer.parseInt(date);
    df = new SimpleDateFormat("dd"); // 设置日期格式
    date = df.format(new Date());
    mDay = Integer.parseInt(date);
    eDay = Integer.parseInt(date);
    // ToolClass.Log(ToolClass.INFO,"EV_JNI","APP<<现在时刻是"+y+"-"+m+"-"+d);
    lvlog = (ListView) findViewById(R.id.lvlog);
    edtloggridstart = (EditText) findViewById(R.id.edtloggridstart); // 获取时间文本框
    edtloggridstart.setFocusable(false); // 不让该edittext获得焦点
    edtloggridstart.setOnTouchListener(
        new View.OnTouchListener() {

          @Override
          public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            // 关闭软键盘,这样当点击该edittext的时候,不会弹出系统自带的输入法
            edtloggridstart.setInputType(InputType.TYPE_NULL);
            return false;
          }
        });
    edtloggridstart.setOnClickListener(
        new OnClickListener() { // 为时间文本框设置单击监听事件
          @Override
          public void onClick(View arg0) {
            datetype = DATE_DIALOG_IDSTART;
            showDialog(DATE_DIALOG_IDSTART); // 显示日期选择对话框
          }
        });
    edtloggridend = (EditText) findViewById(R.id.edtloggridend); // 获取时间文本框
    edtloggridend.setFocusable(false); // 不让该edittext获得焦点
    edtloggridend.setOnTouchListener(
        new View.OnTouchListener() {

          @Override
          public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            // 关闭软键盘,这样当点击该edittext的时候,不会弹出系统自带的输入法
            edtloggridend.setInputType(InputType.TYPE_NULL);
            return false;
          }
        });
    edtloggridend.setOnClickListener(
        new OnClickListener() { // 为时间文本框设置单击监听事件
          @Override
          public void onClick(View arg0) {
            datetype = DATE_DIALOG_IDEND;
            showDialog(DATE_DIALOG_IDEND); // 显示日期选择对话框
          }
        });
    // 查询
    btnloggridquery = (Button) findViewById(R.id.btnloggridquery);
    btnloggridquery.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View arg0) {
            loggrid();
          }
        });
    // 删除查询
    btnloggriddel = (Button) findViewById(R.id.btnloggriddel);
    btnloggriddel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View arg0) {
            delloggrid();
          }
        });
    // 退出
    btnloggridexit = (Button) findViewById(R.id.btnloggridexit);
    btnloggridexit.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View arg0) {
            finish();
          }
        });
    // 动态设置控件高度
    //
    DisplayMetrics dm = new DisplayMetrics();
    // 取得窗口属性
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    // 窗口的宽度
    int screenWidth = dm.widthPixels;
    // 窗口高度
    int screenHeight = dm.heightPixels;
    ToolClass.Log(
        ToolClass.INFO, "EV_JNI", "APP<<屏幕" + screenWidth + "],[" + screenHeight + "]", "log.txt");
    // 横屏
    if (ToolClass.getOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
      LinearLayout.LayoutParams linearParams =
          (LinearLayout.LayoutParams) lvlog.getLayoutParams(); // 取控件mGrid当前的布局参数
      linearParams.height = screenHeight - 252; // 当控件的高强制设成75象素
      lvlog.setLayoutParams(linearParams); // 使设置好的布局参数应用到控件mGrid2
    }
    // 竖屏
    else {
      LinearLayout.LayoutParams linearParams =
          (LinearLayout.LayoutParams) lvlog.getLayoutParams(); // 取控件mGrid当前的布局参数
      linearParams.height = screenHeight - 700; // 当控件的高强制设成75象素
      lvlog.setLayoutParams(linearParams); // 使设置好的布局参数应用到控件mGrid2
    }
  }
Esempio n. 5
0
  // 删除查询报表
  private void delloggrid() {
    ToolClass.Log(
        ToolClass.INFO,
        "EV_JNI",
        "APP<<start:"
            + ToolClass.getDayOfMonth(mYear, mMon, mDay)
            + "end:"
            + ToolClass.getDayOfMonth(eYear, eMon, eDay)
            + "时间大小="
            + ToolClass.dateCompare(
                ToolClass.getDayOfMonth(mYear, mMon, mDay),
                ToolClass.getDayOfMonth(eYear, eMon, eDay)),
        "log.txt");
    if ((!edtloggridstart.getText().toString().isEmpty())
        && (!edtloggridend.getText().toString().isEmpty())
        && (ToolClass.dateCompare(
                ToolClass.getDayOfMonth(mYear, mMon, mDay),
                ToolClass.getDayOfMonth(eYear, eMon, eDay))
            < 0)) {
      // 创建警告对话框
      Dialog alert =
          new AlertDialog.Builder(LogOpt.this)
              .setTitle("对话框") // 标题
              .setMessage("您确定要删除该记录吗?") // 表示对话框中得内容
              .setIcon(R.drawable.ic_launcher) // 设置logo
              .setPositiveButton(
                  "删除",
                  new DialogInterface.OnClickListener() // 退出按钮,点击后调用监听事件
                  {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      // TODO Auto-generated method stub
                      String mYearStr = null, mMonthStr = null, mDayStr = null;
                      String eYearStr = null, eMonthStr = null, eDayStr = null;

                      mYearStr =
                          ((mYear < 10) ? ("0" + String.valueOf(mYear)) : String.valueOf(mYear));
                      mMonthStr =
                          ((mMon < 10) ? ("0" + String.valueOf(mMon)) : String.valueOf(mMon));
                      mDayStr = ((mDay < 10) ? ("0" + String.valueOf(mDay)) : String.valueOf(mDay));
                      eYearStr =
                          ((eYear < 10) ? ("0" + String.valueOf(eYear)) : String.valueOf(eYear));
                      eMonthStr =
                          ((eMon < 10) ? ("0" + String.valueOf(eMon)) : String.valueOf(eMon));
                      eDayStr = ((eDay < 10) ? ("0" + String.valueOf(eDay)) : String.valueOf(eDay));
                      // 创建InaccountDAO对象
                      vmc_logDAO logDAO = new vmc_logDAO(LogOpt.this);
                      String start = mYearStr + "-" + mMonthStr + "-" + mDayStr;
                      String end = eYearStr + "-" + eMonthStr + "-" + eDayStr;
                      logDAO.detele(start, end);
                      // 弹出信息提示
                      Toast.makeText(LogOpt.this, "记录删除成功!", Toast.LENGTH_SHORT).show();
                    }
                  })
              .setNegativeButton(
                  "取消",
                  new DialogInterface.OnClickListener() // 取消按钮,点击后调用监听事件
                  {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      // TODO Auto-generated method stub
                    }
                  })
              .create(); // 创建一个对话框
      alert.show(); // 显示对话框

    } else {
      Toast.makeText(LogOpt.this, "请输入正确查询时间!", Toast.LENGTH_SHORT).show();
    }
  }
Esempio n. 6
0
  // 查询报表
  private void loggrid() {
    ToolClass.Log(
        ToolClass.INFO,
        "EV_JNI",
        "APP<<start:"
            + ToolClass.getDayOfMonth(mYear, mMon, mDay)
            + "end:"
            + ToolClass.getDayOfMonth(eYear, eMon, eDay)
            + "时间大小="
            + ToolClass.dateCompare(
                ToolClass.getDayOfMonth(mYear, mMon, mDay),
                ToolClass.getDayOfMonth(eYear, eMon, eDay)),
        "log.txt");
    if ((!edtloggridstart.getText().toString().isEmpty())
        && (!edtloggridend.getText().toString().isEmpty())
        && (ToolClass.dateCompare(
                ToolClass.getDayOfMonth(mYear, mMon, mDay),
                ToolClass.getDayOfMonth(eYear, eMon, eDay))
            < 0)) {
      String mYearStr = null, mMonthStr = null, mDayStr = null;
      String eYearStr = null, eMonthStr = null, eDayStr = null;

      mYearStr = ((mYear < 10) ? ("0" + String.valueOf(mYear)) : String.valueOf(mYear));
      mMonthStr = ((mMon < 10) ? ("0" + String.valueOf(mMon)) : String.valueOf(mMon));
      mDayStr = ((mDay < 10) ? ("0" + String.valueOf(mDay)) : String.valueOf(mDay));
      eYearStr = ((eYear < 10) ? ("0" + String.valueOf(eYear)) : String.valueOf(eYear));
      eMonthStr = ((eMon < 10) ? ("0" + String.valueOf(eMon)) : String.valueOf(eMon));
      eDayStr = ((eDay < 10) ? ("0" + String.valueOf(eDay)) : String.valueOf(eDay));
      // 创建InaccountDAO对象
      vmc_logDAO logDAO = new vmc_logDAO(LogOpt.this);
      String start = mYearStr + "-" + mMonthStr + "-" + mDayStr;
      String end = eYearStr + "-" + eMonthStr + "-" + eDayStr;
      List<Tb_vmc_log> listinfos = logDAO.getScrollPay(start, end);
      String[] strInfos = new String[listinfos.size()];
      logID = new String[listinfos.size()];
      logType = new String[listinfos.size()];
      logDesc = new String[listinfos.size()];
      logTime = new String[listinfos.size()];
      int m = 0;
      // 遍历List泛型集合
      for (Tb_vmc_log tb_inaccount : listinfos) {
        // 总支付订单
        logID[m] = tb_inaccount.getLogID();
        logType[m] = ToolClass.typestr(3, tb_inaccount.getLogType());
        logDesc[m] = tb_inaccount.getLogDesc();
        logTime[m] = tb_inaccount.getLogTime();
        m++; // 标识加1
      }

      int x = 0;
      this.listMap.clear();
      for (x = 0; x < listinfos.size(); x++) {
        Map<String, String> map = new HashMap<String, String>(); // 定义Map集合,保存每一行数据
        map.put("logID", logID[x]);
        map.put("logType", logType[x]);
        map.put("logDesc", logDesc[x]);
        map.put("logTime", logTime[x]);
        this.listMap.add(map); // 保存数据行
      }
      // 将这个构架加载到data_list中
      this.simpleada =
          new SimpleAdapter(
              this,
              this.listMap,
              R.layout.loglist,
              new String[] {"logID", "logType", "logDesc", "logTime"}, // Map中的key名称
              new int[] {R.id.txtlogID, R.id.txtlogType, R.id.txtlogDesc, R.id.txtlogTime});
      this.lvlog.setAdapter(this.simpleada);

    } else {
      Toast.makeText(LogOpt.this, "请输入正确查询时间!", Toast.LENGTH_SHORT).show();
    }
  }