當前位置: 首頁>>代碼示例>>Java>>正文


Java ODataRow.getInt方法代碼示例

本文整理匯總了Java中com.odoo.core.orm.ODataRow.getInt方法的典型用法代碼示例。如果您正苦於以下問題:Java ODataRow.getInt方法的具體用法?Java ODataRow.getInt怎麽用?Java ODataRow.getInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.odoo.core.orm.ODataRow的用法示例。


在下文中一共展示了ODataRow.getInt方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPostExecute

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
@Override
protected void onPostExecute(ODataRow row) {
    super.onPostExecute(row);
    if (row != null) {
        ONotificationBuilder.cancelNotification(mContext, row.getInt(OColumn.ROW_ID));
        ONotificationBuilder builder = new ONotificationBuilder(mContext,
                row.getInt(OColumn.ROW_ID));
        builder.allowVibrate(true);
        builder.withRingTone(true);
        builder.setTitle(row.getString("name"));
        builder.setText("Download Complete");
        builder.setBigText("Download Complete");
        if (row.getString("file_type").contains("image")) {
            Bitmap bmp = getBitmapFromURI(Uri.parse(row.getString("file_uri")));
            builder.setBigPicture(bmp);
        }
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.parse(row.getString("file_uri")), row.getString("file_type"));
        builder.setResultIntent(intent);
        builder.build().show();
    } else {
        ONotificationBuilder.cancelNotification(mContext);
    }
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:25,代碼來源:OFileManager.java

示例2: getAttributes

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
private HashMap<String, List<ODataRow>> getAttributes(List<ODataRow> variants) {
    HashMap<String, List<ODataRow>> attributes = new HashMap<>();
    List<String> attValIds = new ArrayList<>();
    for (ODataRow variant : variants) {
        List<ODataRow> attrVals = variant.getM2MRecord("attribute_value_ids").browseEach();
        for (ODataRow attrVal : attrVals) {
            ODataRow attribute = attrVal.getM2ORecord("attribute_id").browse();
            String key = "attr_" + attribute.getInt(OColumn.ROW_ID);
            attributesItems.put(key, attribute);
            List<ODataRow> attValues = new ArrayList<>();
            if (attributes.containsKey(key)) {
                attValues.addAll(attributes.get(key));
            }
            if (!attValIds.contains("attr_val_" + attrVal.getString(OColumn.ROW_ID))) {
                attValues.add(attrVal);
                attValIds.add("attr_val_" + attrVal.getString(OColumn.ROW_ID));
            }
            attributes.put(key, attValues);
        }
    }
    return attributes;
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:23,代碼來源:ProductDetail.java

示例3: getPos

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
private int getPos() {
    if (mResourceArray != -1 && mValue != null) {
        return Integer.parseInt(mValue.toString());
    } else if (mCol.getType().isAssignableFrom(OSelection.class)) {
        if (items.size() <= 0) {
            createItems();
        }
        for (ODataRow item : items) {
            int index = items.indexOf(item);
            if (item.getString("key").equals(mValue.toString())) {
                return index;
            }
        }
    } else {
        ODataRow rec = getValueForM2O();
        if (rec != null) {
            return rec.getInt(OColumn.ROW_ID);
        }
    }
    return -1;
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:22,代碼來源:OSelectionField.java

示例4: onPostExecute

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
@Override
protected void onPostExecute(ODataRow row) {
    super.onPostExecute(row);
    if (row != null) {
        ONotificationBuilder.cancelNotification(mActivity, row.getInt(OColumn.ROW_ID));
        ONotificationBuilder builder = new ONotificationBuilder(mActivity,
                row.getInt(OColumn.ROW_ID));
        builder.allowVibrate(true);
        builder.withRingTone(true);
        builder.setTitle(row.getString("name"));
        builder.setText("Download Complete");
        builder.setBigText("Download Complete");
        if (row.getString("file_type").contains("image")) {
            Bitmap bmp = getBitmapFromURI(Uri.parse(row.getString("file_uri")));
            builder.setBigPicture(bmp);
        }
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.parse(row.getString("file_uri")), row.getString("file_type"));
        builder.setResultIntent(intent);
        builder.build().show();
    } else {
        ONotificationBuilder.cancelNotification(mActivity);
    }
}
 
開發者ID:Odoo-mobile,項目名稱:hr,代碼行數:25,代碼來源:OFileManager.java

示例5: getAuthorImage

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
public String getAuthorImage(int row_id) {
    ODataRow row = browse(new String[]{"author_id"}, row_id);
    if (row.getInt("author_id") != 0) {
        ODataRow author_id = row.getM2ORecord("author_id").browse();
        return author_id.getString("image_small");
    }
    return "false";
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:9,代碼來源:MailMessage.java

示例6: onCreate

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.base_mail_chatter_message_compose);
    getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    fileManager = new OFileManager(this);
    Bundle extra = getIntent().getExtras();
    mType = MessageType.valueOf(extra.getString("type"));
    mModel = OModel.get(this, extra.getString("model"), null);
    irAttachment = new IrAttachment(this);
    mailMessage = new MailMessage(this);
    server_id = extra.getInt("server_id");
    if (mModel.getModelName().equals("res.partner")) {
        partner_id = server_id;
    } else {
        ODataRow row = mModel.browse(mModel.selectRowId(server_id));
        for (OColumn col : mModel.getColumns(false)) {
            if (col.getType().isAssignableFrom(ResPartner.class)) {
                if (col.getRelationType() != null
                        && col.getRelationType() == OColumn.RelationType.ManyToOne) {
                    ODataRow partner = null;
                    if (!row.getString(col.getName()).equals("false")) {
                        partner = row.getM2ORecord(col.getName()).browse();
                    }
                    if (partner != null && partner.getInt("id") != 0) {
                        partner_id = partner.getInt("id");
                    }
                }
            }
        }
    }
    findViewById(R.id.btnAttachment).setOnClickListener(this);
    findViewById(R.id.btnSend).setOnClickListener(this);
    findViewById(R.id.btnCancel).setOnClickListener(this);
    edtSubject = (EditText) findViewById(R.id.messageSubject);
    edtBody = (EditText) findViewById(R.id.messageBody);
    horizontalScrollView = (LinearLayout) findViewById(R.id.attachmentsList);
    init();
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:41,代碼來源:MailChatterCompose.java

示例7: downloadAttachment

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
public void downloadAttachment(int attachment_id) {
    ODataRow attachment = irAttachment.browse(attachment_id);
    if (attachment != null) {
        String uri = attachment.getString("file_uri");
        if (uri.equals("false")) {
            // Downloading new file
            _download(attachment);
        } else {
            Uri file_uri = Uri.parse(uri);
            if (fileExists(file_uri)) {
                requestIntent(file_uri);
            } else if (atLeastKitKat()) {
                String file_path = getDocPath(file_uri);
                if (file_path != null) {
                    file_uri = Uri.fromFile(new File(file_path));
                    requestIntent(file_uri);
                } else if (attachment.getInt("id") != 0) {
                    // Downloading new file
                    _download(attachment);
                } else {
                    // Failed to get file
                    OAlert.showAlert(mContext, "Unable to find file !");
                }
            } else if (fileExists(file_uri)) {
                requestIntent(file_uri);
            } else {
                // Failed to get file
                OAlert.showAlert(mContext, "Unable to find file !");
            }
        }
    }
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:33,代碼來源:OFileManager.java

示例8: _download

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
private void _download(ODataRow attachment) {
    ONotificationBuilder builder = new ONotificationBuilder(mContext,
            attachment.getInt(OColumn.ROW_ID));
    builder.setTitle("Downloading " + attachment.getString("name"));
    builder.setText("Download in progress");
    builder.setOngoing(true);
    builder.setAutoCancel(true);
    DownloadManager downloader = new DownloadManager(builder);
    downloader.execute(attachment);
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:11,代碼來源:OFileManager.java

示例9: onAttributeValueSelect

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
@Override
public void onAttributeValueSelect(ODataRow attribute, ODataRow value) {
    ODataRow price = productAttrPrice.browse(null, "value_id = ? and product_tmpl_id = ?",
            new String[]{value.getInt(OColumn.ROW_ID) + "", product_tmpl_id + ""});
    String key = "key_" + value.getInt("attribute_id");
    float price_extra = 0;
    if (price != null) {
        price_extra = price.getFloat("price_extra");
    }
    price_extra_list.put(key, price_extra);
    calculatePrice();
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:13,代碼來源:ProductDetail.java

示例10: onClick

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    ODataRow attr = (ODataRow) v.getTag();
    if (selectedValue != -1 && selectedView != null) {
        selectedView.setBackgroundResource(R.drawable.attr_value_item);
    }
    selectedValue = attr.getInt(OColumn.ROW_ID);
    v.setBackgroundResource(R.drawable.attr_value_item_selected);
    selectedView = v;
    if (mOnAttributeSelectListener != null) {
        mOnAttributeSelectListener.onAttributeValueSelect(mAttr, attr);
    }
}
 
開發者ID:dpr-odoo,項目名稱:trainee-om-shop,代碼行數:14,代碼來源:ProductAttributeValuesView.java

示例11: onCreate

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.base_mail_chatter_message_compose);
    getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    fileManager = new OFileManager(this);
    Bundle extra = getIntent().getExtras();
    mType = MessageType.valueOf(extra.getString("type"));
    mModel = OModel.get(this, extra.getString("model"), null);
    irAttachment = new IrAttachment(this, null);
    mailMessage = new MailMessage(this, null);
    server_id = extra.getInt("server_id");
    if (mModel.getModelName().equals("res.partner")) {
        partner_id = server_id;
    } else {
        ODataRow row = mModel.browse(mModel.selectRowId(server_id));
        for (OColumn col : mModel.getColumns(false)) {
            if (col.getType().isAssignableFrom(ResPartner.class)) {
                if (col.getRelationType() != null
                        && col.getRelationType() == OColumn.RelationType.ManyToOne) {
                    ODataRow partner = null;
                    if (!row.getString(col.getName()).equals("false")) {
                        partner = row.getM2ORecord(col.getName()).browse();
                    }
                    if (partner != null && partner.getInt("id") != 0) {
                        partner_id = partner.getInt("id");
                    }
                }
            }
        }
    }
    findViewById(R.id.btnAttachment).setOnClickListener(this);
    findViewById(R.id.btnSend).setOnClickListener(this);
    findViewById(R.id.btnCancel).setOnClickListener(this);
    edtSubject = (EditText) findViewById(R.id.messageSubject);
    edtBody = (EditText) findViewById(R.id.messageBody);
    horizontalScrollView = (LinearLayout) findViewById(R.id.attachmentsList);
    init();
}
 
開發者ID:Odoo-mobile,項目名稱:hr,代碼行數:41,代碼來源:MailChatterCompose.java

示例12: _downloadAttachment

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
private void _downloadAttachment(int id) {
    ODataRow attachment = irAttachment.browse(id);
    if (attachment != null) {
        String uri = attachment.getString("file_uri");
        if (uri.equals("false")) {
            // Downloading new file
            _download(attachment);
        } else {
            Uri file_uri = Uri.parse(uri);
            if (fileExists(file_uri)) {
                requestIntent(file_uri);
            } else if (atLeastKitKat()) {
                String file_path = getDocPath(file_uri);
                if (file_path != null) {
                    file_uri = Uri.fromFile(new File(file_path));
                    requestIntent(file_uri);
                } else if (attachment.getInt("id") != 0) {
                    // Downloading new file
                    _download(attachment);
                } else {
                    // Failed to get file
                    OAlert.showAlert(mActivity, "Unable to find file !");
                }
            } else if (fileExists(file_uri)) {
                requestIntent(file_uri);
            } else {
                // Failed to get file
                OAlert.showAlert(mActivity, "Unable to find file !");
            }
        }
    }
}
 
開發者ID:Odoo-mobile,項目名稱:hr,代碼行數:33,代碼來源:OFileManager.java

示例13: _download

import com.odoo.core.orm.ODataRow; //導入方法依賴的package包/類
private void _download(ODataRow attachment) {
    ONotificationBuilder builder = new ONotificationBuilder(mActivity,
            attachment.getInt(OColumn.ROW_ID));
    builder.setTitle("Downloading " + attachment.getString("name"));
    builder.setText("Download in progress");
    builder.setOngoing(true);
    builder.setAutoCancel(true);
    DownloadManager downloader = new DownloadManager(builder);
    downloader.execute(attachment);
}
 
開發者ID:Odoo-mobile,項目名稱:hr,代碼行數:11,代碼來源:OFileManager.java


注:本文中的com.odoo.core.orm.ODataRow.getInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。