コード例 #1
0
        public void GetSchema(ChromiumWebBrowser cbrowser, LoginInfo val)
        {
            /*string script = @"var responseobj;
             * jQuery.ajax({
             * data: {'client_identifier':'" + val.oem_identifier + @"','user_key':'" + val.user_key + @"','user_id':'" + val.user_id + @"','update_number':'" + 0 + @"'},
             * method: 'POST',
             * url:'http://develop.aipsoft.in/common/sync_table/get_table_details',
             * success: function(response) {
             *
             * console.log(response);
             *
             * },
             * error: function(error) {
             *
             * },
             * beforeSend: function() {
             *
             * },
             * complete: function() {
             *
             * }
             * });";*/

            APIConnection api = new APIConnection();

            api.MyWebRequest("http://develop.aipsoft.in/common/sync_table/get_table_details");
            api.MyWebRequest("http://develop.aipsoft.in/common/sync_table/get_table_details", "POST");
            api.MyWebRequest("http://develop.aipsoft.in/common/sync_table/get_table_details", "POST", $"client_identifier={val.oem_identifier}&user_key={val.user_key}&user_id={val.user_id}&update_number={0}");
            string response = api.GetResponse();
            var    result   = JObject.Parse(response);
            var    dt       = objdb.GetDataTable(@"SELECT * FROM aip_product_category WHERE STATUS='1' AND show_on_pos='1';");

            if (dt.Rows.Count != 0)
            {
                cbrowser.Load(@"file:///D:\POSDATA\DOTNETPOS\dotnet_pos.html");
            }

            /*if (cbrowser.CanExecuteJavascriptInMainFrame && script != null)
             * {
             *  JavascriptResponse resp = await cbrowser.EvaluateScriptAsync(script);
             *  if (resp.Success == true)
             *  {
             *      if (resp.Success.ToString() != null)
             *      {
             *          //cbrowser.Load(@"file:///C:/Users/userpc/source/repos/POS/POS/POSWEB/index.html");
             *      }
             *  }
             *  else
             *  {
             *      MessageBox.Show(resp.Message);
             *  }
             * }*/
        }
コード例 #2
0
        public void Redirect(ChromiumWebBrowser Cbrowser, string[] val)
        {
            APIConnection api = new APIConnection();

            api.MyWebRequest("http://develop.aipsoft.in/common/sync_table/login_action");
            api.MyWebRequest("http://develop.aipsoft.in/common/sync_table/login_action", "POST");
            api.MyWebRequest("http://develop.aipsoft.in/common/sync_table/login_action", "POST", $"username={val[0]}&password={val[1]}");
            string response = api.GetResponse();
            var    result   = JObject.Parse(response);

            if (result["message"].ToString() == "Login Successfull")
            {
                string logindata = result["data"].ToString();
                string str       = logindata;
                var    result1   = JsonConvert.DeserializeObject <LoginInfo>(str);
                GetSchema(Cbrowser, result1);
            }

            /*if (result != null)
             * {
             *  IDictionary<string, object> dict = (IDictionary<string, object>)result["data"].ToObject(dict);
             *  IEnumerable<object> values = dict.Select(m => m.Value);
             *  var txt = values.ToList();
             *  if (txt.Count != 0)
             *  {
             *      object msg = txt.ElementAt(13);
             *      string[] arr = ((IEnumerable)txt).Cast<object>()
             *           .Select(x => x.ToString())
             *           .ToArray();
             *      string data = arr[13].ToString();
             *      string[] newa = data.Split(',', ':');
             *      string oemid = newa[6].ToString().Replace(@"""", "");
             *      string userid = newa[8].ToString().Replace(@"""", "");
             *      string userkey = newa[10].ToString().Replace(@"""", "");
             *      string[] passData = { oemid, userid, userkey, "0" };
             *  }
             * }*/
        }