示例#1
0
        /// <summary>
        /// Enregistre le texte d'une langue, sur le serveur OpenERP
        /// </summary>
        /// <param name="clientOpenERP">Client OpenERP déjà connecté</param>
        /// <param name="codeLangue">Code de la langue à enregistrer</param>
        /// <returns></returns>
        public bool sauveLangue(Clients.clientOpenERP clientOpenERP, string codeLangue)
        {
            if (!_changed.ContainsKey(codeLangue))
            {
                return(false);
            }

            string libelle;
            bool   retour;

            [email protected] context;
            [email protected] fields;
            if ((bool)_changed[codeLangue])
            {
                libelle = (string)_listeChaines[codeLangue];
                fields  = new [email protected]();
                fields.add(_nomChamps, libelle);
                context = new [email protected]();
                context.add("lang", codeLangue);
                retour = clientOpenERP.update(fields, _classeParente.GetType(), (int)(_classeParente.listProperties.value("id", [email protected]_TYPE.INTEGER)), context);
                if (!retour)
                {
                    throw new Exception("Update return False");
                }

                _changed[codeLangue] = false;
            }
            return(true);
        }
示例#2
0
 private void lblReadCli_Click(object sender, EventArgs e)
 {
     IMDEV.OpenERP.EG.models.res.res_partner cli;
     cli = IMDEV.OpenERP.EG.datatables.listPartner.aPartner(3031, _monClient);
     if (cli == null)
     {
         richTextBox1.AppendText("No client\r\n");
     }
     else
     {
         richTextBox1.AppendText("Client : " + cli.name + "\r\n");
     }
     IMDEV.OpenERP.EG.models.product.product_product p1, p2;
     [email protected]       context = new [email protected]();
     context.add("company_id", 1);
     p1      = IMDEV.OpenERP.EG.datatables.listProduct.aProduct("G_CRCHAEXTUNL10", _monClient, context);
     context = new [email protected]();
     context.add("company_id", 2);
     p2 = IMDEV.OpenERP.EG.datatables.listProduct.aProduct("G_CRCHAEXTUNL10", _monClient, context);
     richTextBox1.AppendText("p1 : " + p1.property_account_income.id + "\r\n");
     richTextBox1.AppendText("p2 : " + p2.property_account_income.id + "\r\n");
 }