public void login(String url, String database, String username, String password) { try { odooConnector = OdooRPC.InstanceCreation(url); App.userid = odooConnector.login(database, username, password); //object[] domain = new object[] { "id", "=", App.userid }; //JArray userData = odooConnector.odooSearchReadCall<JArray>("res.users", domain, new string[] { "name", "email", "partner_id","groups_id","image_medium" }, false); //string partnerName="", partnerRole="", partnerImage=""; //int partnerId=0; //foreach (JObject obj in userData) //{ // partnerId = obj["partner_id"][0].ToObject<int>(); // partnerName = obj["name"].ToString(); // partnerRole = "Manager"; // partnerImage = obj["image_medium"].ToString(); //} //Settings.PrefKeyIsLocked = "True"; //UserAccount data = new UserAccount(url, database, App.userid,partnerId,partnerName,password,partnerImage,partnerRole); //Settings.PrefKeyUserDetails = JsonConvert.SerializeObject(data); } catch (Exception ea) { throw; } }
public string[] getDatabases(string url) { try { OdooRPC con = OdooRPC.InstanceCreation(url); return(con.getDatabases()); } catch (Exception ex) { throw ex; } }
public String login(String url, String database, String username, String password) { try { odooConnector = OdooRPC.InstanceCreation(url); App.userid = odooConnector.login(database, username, password); return("true"); } catch (Exception ea) { return("false"); } }
public List <SalesQuotation> GetSalesQuotations() { odooConnector = OdooRPC.InstanceCreation(Settings.UserUrlName); List <SalesQuotation> quotList = new List <SalesQuotation>(); App.filterdict["range"] = false; App.filterdict["days"] = false; App.filterdict["month"] = true; App.filterdict["sale_order"] = false; quotList = odooConnector.odooMethodCall_getsalequotations <JArray>("sale.order", "get_sales_data"); // tarList = result.ToObject<List<SalesQuotation>>(); return(quotList); }
public List <CRMLead> GetCrmLeads() { if (!App.lead_filter) { App.filterdict["range"] = false; App.filterdict["days"] = false; App.filterdict["month"] = true; } App.filterdict["lead"] = true; odooConnector = OdooRPC.InstanceCreation(Settings.UserUrlName); List <CRMLead> quotList = new List <CRMLead>(); quotList = odooConnector.odooMethodCall_crmleads <JArray>("crm.lead", "get_crm_lead_data"); // tarList = result.ToObject<List<SalesQuotation>>(); return(quotList); App.lead_filter = false; }
public String login(String url, String database, String username, String password) { try { odooConnector = OdooRPC.InstanceCreation(url); App.userid = odooConnector.login(database, username, password); Settings.UserUrlName = url; //object[] domain = new object[] { "id", "=", App.userid }; //JArray userData = odooConnector.odooSearchReadCall<JArray>("res.users", domain, new string[] { "name", "email", "partner_id","groups_id","image_medium" }, false); //string partnerName="", partnerRole="", partnerImage=""; //int partnerId=0; //foreach (JObject obj in userData) //{ // partnerId = obj["partner_id"][0].ToObject<int>(); // partnerName = obj["name"].ToString(); // partnerRole = "Manager"; // partnerImage = obj["image_medium"].ToString(); //} //Settings.PrefKeyIsLocked = "True"; //UserAccount data = new UserAccount(url, database, App.userid,partnerId,partnerName,password,partnerImage,partnerRole); //Settings.PrefKeyUserDetails = JsonConvert.SerializeObject(data); if (App.userid == -1) { return("false"); } else { return("true"); } } catch (Exception ea) { // return "server"; return("false"); //System.Diagnostics.Debug.WriteLine("SYSTEMRES???????????????" + ea.Message); } }
public String login(String url, String database, String username, String password) { try { odooConnector = OdooRPC.InstanceCreation(url); App.userid = odooConnector.login(database, username, password); if (App.userid == -1) { return("false"); } else { return("true"); } } catch (Exception ea) { // return "server"; return("false"); //System.Diagnostics.Debug.WriteLine("SYSTEMRES???????????????" + ea.Message); } }