当前位置: 首页>>代码示例>>Java>>正文


Java ODataRow.getString方法代码示例

本文整理汇总了Java中com.odoo.core.orm.ODataRow.getString方法的典型用法代码示例。如果您正苦于以下问题:Java ODataRow.getString方法的具体用法?Java ODataRow.getString怎么用?Java ODataRow.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.odoo.core.orm.ODataRow的用法示例。


在下文中一共展示了ODataRow.getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
private void init() {
    TextView recordName = (TextView) findViewById(R.id.recordName);
    parent = (View) recordName.getParent().getParent();
    ODataRow record = mModel.browse(mModel.selectRowId(server_id));
    String name = record.getString(mModel.getDefaultNameColumn());
    findViewById(R.id.dialogHeader)
            .setBackgroundColor(OStringColorUtil.getStringColor(this, name));
    if (mType == MessageType.Message) {
        edtSubject.setText("Re: " + name);
        recordName.setText(String.format(OResource.string(this, R.string.message_to), name));
    } else {
        recordName.setText(R.string.add_internal_note);
        edtSubject.setVisibility(View.GONE);
        edtBody.setHint(R.string.internal_note_hint);
        OControls.setText(parent, R.id.btnSend, R.string.label_log_note);
    }
    edtBody.requestFocus();
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:19,代码来源:MailChatterCompose.java

示例2: addAttachment

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
private void addAttachment(ODataRow values) {
    View attachmentView = LayoutInflater.from(this)
            .inflate(R.layout.base_attachment_item, horizontalScrollView, false);
    String fileName = values.getString("name");
    String type = values.getString("file_type");
    ImageView imgPreview = (ImageView) attachmentView.findViewById(R.id.attachmentPreview);
    if (type.contains("image")) {
        if (!values.getString("file_uri").equals("false")) {
            Uri uri = Uri.parse(values.getString("file_uri"));
            imgPreview.setImageBitmap(fileManager.getBitmapFromURI(uri));
        } else
            imgPreview.setImageResource(R.drawable.image);
    } else if (type.contains("audio")) {
        imgPreview.setImageResource(R.drawable.audio);
    } else if (type.contains("video")) {
        imgPreview.setImageResource(R.drawable.video);
    } else {
        imgPreview.setImageResource(R.drawable.file);
    }
    OControls.setText(attachmentView, R.id.attachmentFileName, fileName);
    attachmentView.setTag(values);
    attachmentView.findViewById(R.id.btnRemoveAttachment).setVisibility(View.GONE);
    attachmentView.setOnClickListener(this);
    horizontalScrollView.addView(attachmentView);
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:26,代码来源:MailDetailDialog.java

示例3: addAttachment

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
private void addAttachment(ODataRow values) {
    View attachmentView = LayoutInflater.from(this)
            .inflate(R.layout.base_attachment_item, horizontalScrollView, false);
    String fileName = values.getString("name");
    String type = values.getString("file_type");
    ImageView imgPreview = (ImageView) attachmentView.findViewById(R.id.attachmentPreview);
    if (type.contains("image")) {
        if (!values.getString("file_uri").equals("false")) {
            Uri uri = Uri.parse(new File(values.getString("file_uri")).toString());
            imgPreview.setImageBitmap(fileManager.getBitmapFromURI(uri));
        } else
            imgPreview.setImageResource(R.drawable.image);
    } else if (type.contains("audio")) {
        imgPreview.setImageResource(R.drawable.audio);
    } else if (type.contains("video")) {
        imgPreview.setImageResource(R.drawable.video);
    } else {
        imgPreview.setImageResource(R.drawable.file);
    }
    OControls.setText(attachmentView, R.id.attachmentFileName, fileName);
    attachmentView.setTag(values);
    attachmentView.findViewById(R.id.btnRemoveAttachment).setVisibility(View.GONE);
    attachmentView.setOnClickListener(this);
    horizontalScrollView.addView(attachmentView);
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:26,代码来源:MailDetailDialog.java

示例4: 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

示例5: init

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
private void init() {
    recordName = (TextView) findViewById(R.id.recordName);
    parent = (View) recordName.getParent();
    ODataRow row = mailMessage.browse(extra.getInt(OColumn.ROW_ID));
    attachments.addAll(row.getM2MRecord("attachment_ids").browseEach());
    if (attachments.size() > 0) {
        loadAttachments = new LoadAttachments();
        loadAttachments.execute();
    }
    horizontalScrollView = (LinearLayout) findViewById(R.id.attachmentsList);
    baseModel = OModel.get(this, row.getString("model"), mailMessage.getUser().getAndroidName());
    ODataRow record = baseModel.browse(baseModel.selectRowId(row.getInt("res_id")));
    String name = record.getString(baseModel.getDefaultNameColumn());
    recordName.setText(name);
    recordName.setBackgroundColor(OStringColorUtil.getStringColor(this, name));

    if (!row.getString("subject").equals("false"))
        OControls.setText(parent, R.id.messageSubject, row.getString("subject"));
    else
        OControls.setGone(parent, R.id.messageSubject);

    WebView messageBody = (WebView) findViewById(R.id.messageBody);
    messageBody.setBackgroundColor(Color.TRANSPARENT);
    messageBody.loadData(row.getString("body"), "text/html; charset=UTF-8", "UTF-8");

    Bitmap author_image = BitmapUtils.getAlphabetImage(this, row.getString("author_name"));
    String author_img = mailMessage.getAuthorImage(row.getInt(OColumn.ROW_ID));
    if (!author_img.equals("false")) {
        author_image = BitmapUtils.getBitmapImage(this, author_img);
    }
    OControls.setImage(parent, R.id.author_image, author_image);
    OControls.setText(parent, R.id.authorName, row.getString("author_name"));
    String date = ODateUtils.convertToDefault(row.getString("date"),
            ODateUtils.DEFAULT_FORMAT, "MMM dd, yyyy hh:mm a");
    OControls.setText(parent, R.id.messageDate, date);
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:37,代码来源:MailDetailDialog.java

示例6: getContact

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
public static String getContact(Context context, int row_id) {
    ODataRow row = new ResPartner(context).browse(row_id);
    String contact;
    if (row.getString("mobile").equals("false")) {
        contact = row.getString("phone");
    } else {
        contact = row.getString("mobile");
    }
    return contact;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:11,代码来源:ResPartner.java

示例7: getAddress

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
public String getAddress(ODataRow row) {
    String add = "";
    if (!row.getString("street").equals("false"))
        add += row.getString("street") + ", ";
    if (!row.getString("street2").equals("false"))
        add += "\n" + row.getString("street2") + ", ";
    if (!row.getString("city").equals("false"))
        add += row.getString("city");
    if (!row.getString("zip").equals("false"))
        add += " - " + row.getString("zip") + " ";
    return add;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:13,代码来源:ResPartner.java

示例8: 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

示例9: onItemSelected

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position,
                           long id) {
    if (mResourceArray != -1) {
        mValue = position;
    } else if (mCol.getType().isAssignableFrom(OSelection.class)) {
        ODataRow row = mAdapter.getItem(position);
        mValue = row.getString("key");
    } else {
        mValue = items.get(position).get(OColumn.ROW_ID);
    }
    setValue(mValue);
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:14,代码来源:OSelectionField.java

示例10: getContact

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
public static String getContact(Context context, int row_id) {
    ODataRow row = new ResPartner(context, null).browse(row_id);
    String contact;
    if (row.getString("mobile").equals("false")) {
        contact = row.getString("phone");
    } else {
        contact = row.getString("mobile");
    }
    return contact;
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:11,代码来源:ResPartner.java

示例11: _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

示例12: getSymbol

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
public static String getSymbol(Context context, int row_id) {
    ResCurrency resCurrency = new ResCurrency(context);
    ODataRow row = resCurrency.browse(row_id);
    return (row != null) ? row.getString("symbol") : "";
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:6,代码来源:ResCurrency.java

示例13: shareContact

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
public static void shareContact(Context context, ODataRow row, Boolean view) {
        try {
            File vcfFile = new File(OStorageUtils.getDirectoryPath("file"), row.getString("name") + ".vcf");
            FileWriter fw = new FileWriter(vcfFile);
            fw.write("BEGIN:VCARD\r\n");
            fw.write("VERSION:3.0\r\n");
            fw.write("N:" + row.getString("name") + ";\r\n");
            fw.write("FN:" + row.getString("name") + "\r\n");
            if (row.get("parent_id") instanceof Integer) {
                fw.write("ORG:" + row.getM2ORecord("parent_id").browse().getString("name") + "\r\n");
            }
            if (!row.getString("phone").equals("false"))
                fw.write("TEL;TYPE=WORK,VOICE:" + row.getString("phone") + "\r\n");
            if (!row.getString("mobile").equals("false"))
                fw.write("TEL;TYPE=HOME,VOICE:" + row.getString("mobile") + "\r\n");
            String country = "";
            if (row.get("country_id") instanceof Integer) {
                country = row.getM2ORecord("country_id").browse().getString("name");
            }
//            if (!row.getString("street").equals("false") && !row.getString("street").equals("")) {
//            fw.write("ADR;TYPE=WORK:;;" + row.getString("street"));
            fw.write("ADR;TYPE=WORK:;;" + row.getString("street") + " " + row.getString("street2") + ";" +
                    row.getString("city") + ";" + row.getString("zip") + ";" + country + "\r\n");
//            }
//            if (!row.getString("street2").equals("false") && !row.getString("street2").equals(""))
//                fw.write("ADR;TYPE=WORK:;;" + " " + row.getString("street2"));
//            if (!row.getString("city").equals("false") && !row.getString("city").equals(""))
//                fw.write("ADR;TYPE=WORK:;;" + " " + row.getString("city"));
//            if (!row.getString("zip").equals("false") && !row.getString("zip").equals(""))
//                fw.write("ADR;TYPE=WORK:;;" + " " + row.getString("zip") + ";" + country);

//            if (!row.getString("email").equals("false") && !row.getString("email").equals(""))
            fw.write("EMAIL;TYPE=PREF,INTERNET:" + row.getString("email") + "\r\n");
            fw.write("END:VCARD\r\n");
            fw.close();

            Intent i = new Intent();
            if (view) {
                i.setAction(Intent.ACTION_SEND);
                i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(vcfFile));
                i.setType("text/x-vcard");
            } else {
                i.setAction(Intent.ACTION_VIEW);
                i.setDataAndType(Uri.fromFile(vcfFile), "text/x-vcard");
            }
            context.startActivity(i);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:51,代码来源:ShareUtil.java

示例14: onViewBind

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
@Override
public void onViewBind(int position, View view, Object data) {
    ODataRow row = (ODataRow) data;

    if (currency == null && !row.getString("company_id").equals("false")) {
        currency = row.getM2ORecord("company_id")
                .browse().getM2ORecord("currency_id").browse();
    }

    if (!row.getString("image_medium").equals("false")) {
        OControls.setImage(view, R.id.productImage,
                BitmapUtils.getBitmapImage(getActivity(), row.getString("image_medium")));
    } else {
        OControls.setImage(view, R.id.productImage, R.drawable.no_image);
    }
    OControls.setText(view, R.id.productName, row.getString("name"));
    String price = row.getString("list_price");
    float discountPrice = row.getFloat("price");

    if (discountPrice != row.getFloat("list_price")) {
        view.findViewById(R.id.discountView).setVisibility(View.VISIBLE);
        OControls.setTextViewStrikeThrough(view, R.id.productOriginalPrice);
        OControls.setText(view, R.id.productOriginalPrice, getPriceWithCurrency(price));
        float percent = Math.round(100 - (discountPrice / row.getFloat("list_price") * 100));
        OControls.setText(view, R.id.productDiscount, percent + "% off");
        price = discountPrice + "";
    } else {
        view.findViewById(R.id.discountView).setVisibility(View.INVISIBLE);
    }
    OControls.setText(view, R.id.productPrice, getPriceWithCurrency(price));
    toggleFavIcon(favouriteProducts.isFavourite(row.getInt(OColumn.ROW_ID)),
            view.findViewById(R.id.favorite_layout));
    view.findViewById(R.id.favorite_layout).setTag(row);
    view.findViewById(R.id.favorite_layout).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ODataRow r = (ODataRow) v.getTag();
            boolean isFav = favouriteProducts.toggleFavourite(r.getInt(OColumn.ROW_ID));
            toggleFavIcon(isFav, v);
            String message = (isFav) ? _s(R.string.toast_added_to_favourite_list) :
                    _s(R.string.toast_removed_from_favourite_list);
            Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show();
        }
    });
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:46,代码来源:FavouriteProductView.java

示例15: getSymbol

import com.odoo.core.orm.ODataRow; //导入方法依赖的package包/类
public static String getSymbol(Context context, int row_id) {
    ResCurrency resCurrency = new ResCurrency(context, null);
    ODataRow row = resCurrency.browse(row_id);
    return (row != null) ? row.getString("symbol") : "";
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:6,代码来源:ResCurrency.java


注:本文中的com.odoo.core.orm.ODataRow.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。