当前位置: 首页>>代码示例>>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;未经允许,请勿转载。