コード例 #1
0
    private bool check_validate_is_ok()
    {
        string v_form_mode = get_form_mode(m_hdf_form_mode);

        //Kiểm tra nhập trùng mã đơn hàng
        if (v_form_mode.Equals(LOAI_FORM.THEM))
        {
            if (m_us_gd_don_dat_hang.check_is_having_ma_don_hang(m_lbl_hien_thi_so_phieu.Text.Trim()))
            {
                thong_bao("Mã đơn hàng này đã tồn tại! ", true);
                return false;
            }
        }
        if (v_form_mode.Equals(LOAI_FORM.SUA))
        {
            US_GD_DON_DAT_HANG v_us = new US_GD_DON_DAT_HANG(CIPConvert.ToDecimal(m_hdf_id_don_hang.Value));
            if (!m_lbl_hien_thi_so_phieu.Text.Equals(v_us.strMA))
            {
                if (v_us.check_is_having_ma_don_hang(m_lbl_hien_thi_so_phieu.Text))
                {
                    thong_bao("Mã đơn hàng này đã tồn tại! ", true);
                    return false;
                }
            }
        }
        if (m_lbl_hien_thi_so_phieu.Text == null || m_lbl_hien_thi_so_phieu.Text == "") { thong_bao("Chưa nhập mã đơn hàng! "); return false; }
        //if (m_txt_nguoi_nhan.Text == null || m_txt_nguoi_nhan.Text == "") { thong_bao("Chưa nhập người nhận! "); m_txt_nguoi_nhan.Focus(); return false; }
        //if (m_txt_noi_nhan.Text == null || m_txt_noi_nhan.Text == "") { thong_bao("Chưa nhập nơi nhận! "); m_txt_noi_nhan.Focus(); return false; }
        return true;
    }