使用CookComputing.XmlRpc读取方法声明

时间:2019-05-27 11:26:20

标签: c# integration odoo

无法读取员工数据。我的读取方法在这里不起作用。

protected void login_Click(object sender, EventArgs e)
{
    //Login to openerp

    IOpenErpLogin rpcClientLogin = XmlRpcProxyGen.Create<IOpenErpLogin>(); //add  XmlRpcProxyGen.CS File from src folder if required,

    int userid = rpcClientLogin.login("abc", "sidragill298@gmail.com", "admin");
    Label1.Text = userid.ToString();

    IOpenErpAddFields rpcField = XmlRpcProxyGen.Create<IOpenErpAddFields>();
    object[] filter = new object[1];
    filter[0] = new object[3] { "name", "=", "sidra" };
    int[] model = rpcField.search("abc", userid, "admin", "hr.employee", "search", filter);
    Label2.Text = Convert.ToString(model);
    // int[] search(string dbName, int userId, string dbPwd, string model, string method, object[] filter);

    // IOpenErpAddFields rField = XmlRpcProxyGen.Create<IOpenErpAddFields>();
    object rd = new object[1];
    rd[0] = new object[2] { "name","work_email" };

    object[] resAdd = rpcField.read("abc", userid, "admin", "hr.employee", "read",model, rd);

    Label3.Text=Convert.ToString(resAdd[0]);     

    // object[] resAdd= rField.get_data("abc", userid,"admin", "hr.employee", "get_data" , rd);
    // Object [] get_data (string dbName, int userId, string pwd, string model, string method, object [] ids);
    // object[] read(string dbName, int userId, string dbPwd, string model, string method, int[] ids, object[] fields);                
}
  

错误5无法将带有[]的索引应用于类型的表达式   “对象”

     

错误6的最佳最佳重载方法匹配   'odooLogin.WebForm1.IOpenErpAddFields.read(string,int,string,   字符串,字符串,整数[],对象[])'包含一些无效的参数

     

错误7参数7:无法从'object'转换为'object []'

0 个答案:

没有答案