예제 #1
0
 // Spinner MAU_VTU
 public void set_spinner_mau_vattu() {
   Variables.list_mau_vattu = mdb.set_spn_mau_vattu();
   Variables.list_mau_vattu.add(0, "Tất cả mẫu");
   if (Variables.list_mau_vattu != null) {
     Tht_add_data.set_spinner(Ac_xem_vattu.this, Variables.list_mau_vattu, spn_MAU_VTU);
   }
 }
예제 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Tht_Screen.hide_title(this);
    setContentView(R.layout.ac_xem_vattu);
    Tht_Screen.hide_keyboard(this);
    lv_vattu = (ListView) findViewById(R.id.lv_vattu_xem_vattu);
    spn_MAU_VTU = (Spinner) findViewById(R.id.spn_mau_xem_vattu);
    edt_search = (EditText) findViewById(R.id.edt_search_ac_xem_vat_tu);
    edt_search.setHint(getString(R.string.tim_kiem_vat_tu));
    mdb = new DBAdapter(this);
    mdb.open();
    list_vattu = mdb.get_list_all_vattu(Variables.DNV.getMaDV());
    mAdapter = new Adapter_D_VATTU_BY_MAU(list_vattu, Ac_xem_vattu.this);
    lv_vattu.setAdapter(mAdapter);
    set_spinner_mau_vattu();
    spn_MAU_VTU.setOnItemSelectedListener(
        new OnItemSelectedListener() {

          @Override
          public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            if (arg2 != 0) {
              mdb.open();
              MAU_CHON = Variables.list_mau_vattu.get(arg2);
              list_mau = mdb.get_ARR_VATTU_BY_MAU(MAU_CHON);
              if (list_vattu_mau != null) {
                list_vattu_mau.clear();
              }
              list_vattu_mau = new ArrayList<Obj_D_VATTU>();
              try {
                for (Obj_D_MAU DM : list_mau) {
                  if (DM.getMA_VTU() != null) {
                    for (Obj_D_VATTU DVT : list_vattu) {
                      if (DVT.getMA_VTU().equals(DM.getMA_VTU())) {
                        list_vattu_mau.add(DVT);
                      }
                    }
                  }
                }
              } catch (Exception e) {
                ThtShow.show_crouton_toast(Ac_xem_vattu.this, e.toString(), Style.ALERT);
              }

              mAdapter = new Adapter_D_VATTU_BY_MAU(list_vattu_mau, Ac_xem_vattu.this);
            } else {
              MAU_CHON = "null";
              mAdapter = new Adapter_D_VATTU_BY_MAU(list_vattu, Ac_xem_vattu.this);
            }
            lv_vattu.setAdapter(mAdapter);
          }

          @Override
          public void onNothingSelected(AdapterView<?> arg0) {
            // TODO Auto-generated method stub

          }
        });
    edt_search.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {
            mAdapter.get_search_vattu(s.toString());
            mAdapter.notifyDataSetChanged();
          }

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void afterTextChanged(Editable s) {
            // TODO Auto-generated method stub

          }
        });
  }
예제 #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    Tht_Screen.hide_title(this);
    setContentView(R.layout.tab_chiettinh);
    mdb = new DBAdapter(this);
    if (HS == null) {
      HS = Variables.HSCT_CHON;
    }
    list_vattu_chitiet = mdb.get_list_vattu_chitiet_khachhang(HS.getMA_YCAU_KNAI());

    tv_TIEN_VAT_LIEU = (TextView) findViewById(R.id.tv_TIEN_VAT_LIEU_tab_thongtin);
    tv_TIEN_NHAN_CONG = (TextView) findViewById(R.id.tv_TIEN_NHAN_CONG_tab_thongtin);
    tv_TIEN_VAN_CHUYEN = (TextView) findViewById(R.id.tv_TIEN_VAN_CHUYEN_tab_thongtin);
    tv_TIEN_THI_CONG = (TextView) findViewById(R.id.tv_TIEN_THI_CONG_tab_thongtin);

    tv_T = (TextView) findViewById(R.id.tv_T_tab_thongtin);
    tv_TT = (TextView) findViewById(R.id.tv_TT_tab_thongtin);
    tv_C = (TextView) findViewById(R.id.tv_C_tab_thongtin);
    tv_TL = (TextView) findViewById(R.id.tv_TL_tab_thongtin);
    tv_K = (TextView) findViewById(R.id.tv_K_tab_thongtin);
    tv_Gtt = (TextView) findViewById(R.id.tv_Gtt_tab_thongtin);
    tv_VAT = (TextView) findViewById(R.id.tv_VAT_tab_thongtin);
    tv_G = (TextView) findViewById(R.id.tv_G_tab_thongtin);

    tv_TIEN_VAT_LIEU_KH = (TextView) findViewById(R.id.tv_TIEN_VAT_LIEU_KH_tab_thongtin);
    tv_TIEN_NHAN_CONG_KH = (TextView) findViewById(R.id.tv_TIEN_NHAN_CONG_KH_tab_thongtin);
    tv_TIEN_VAN_CHUYEN_KH = (TextView) findViewById(R.id.tv_TIEN_VAN_CHUYEN_KH_tab_thongtin);
    tv_TIEN_THI_CONG_KH = (TextView) findViewById(R.id.tv_TIEN_THI_CONG_KH_tab_thongtin);

    tv_T_KH = (TextView) findViewById(R.id.tv_T_KH_tab_thongtin);
    tv_TT_KH = (TextView) findViewById(R.id.tv_TT_KH_tab_thongtin);
    tv_C_KH = (TextView) findViewById(R.id.tv_C_KH_tab_thongtin);
    tv_TL_KH = (TextView) findViewById(R.id.tv_TL_KH_tab_thongtin);
    tv_K_KH = (TextView) findViewById(R.id.tv_K_KH_tab_thongtin);
    tv_Gtt_KH = (TextView) findViewById(R.id.tv_Gtt_KH_tab_thongtin);
    tv_VAT_KH = (TextView) findViewById(R.id.tv_VAT_KH_tab_thongtin);
    tv_G_KH = (TextView) findViewById(R.id.tv_G_KH_tab_thongtin);
    try {
      tv_TIEN_VAT_LIEU.setText(null_value);
      tv_TIEN_NHAN_CONG.setText(null_value);
      tv_TIEN_VAN_CHUYEN.setText(null_value);
      tv_TIEN_THI_CONG.setText(null_value);
      tv_T.setText(null_value);
      tv_TT.setText(null_value);
      tv_C.setText(null_value);
      tv_TL.setText(null_value);
      tv_K.setText(null_value);
      tv_Gtt.setText(null_value);
      tv_VAT.setText(null_value);
      tv_G.setText(null_value);
      tv_TIEN_VAT_LIEU_KH.setText(null_value);
      tv_TIEN_NHAN_CONG_KH.setText(null_value);
      tv_TIEN_VAN_CHUYEN_KH.setText(null_value);
      tv_TIEN_THI_CONG_KH.setText(null_value);
      tv_T_KH.setText(null_value);
      tv_TT_KH.setText(null_value);
      tv_C_KH.setText(null_value);
      tv_TL_KH.setText(null_value);
      tv_K_KH.setText(null_value);
      tv_Gtt_KH.setText(null_value);
      tv_VAT_KH.setText(null_value);
      tv_G_KH.setText(null_value);
    } catch (Exception e) {

    }
    try {
      TINH_CHI_PHI_DL();
      ;
      TINH_CHI_PHI_KH();
    } catch (Exception e) {

    }
  }