Ejemplo n.º 1
0
        private async void sendProduct()
        {
            DBConn_Product dbp         = new DBConn_Product();
            List <Product> productList = dbp.GetAllProduct();

            Uri     requestUri  = new Uri("http://" + ip + "/action_refreshProduct.php");
            dynamic dynamicJson = new ExpandoObject();

            dynamicJson.Product = productList;

            string json = "";

            json = "{\"PosId\":\"" + POS_main.PosId + "\"," + Newtonsoft.Json.JsonConvert.SerializeObject(dynamicJson).Substring(1);

            var objClint = new HttpClient();
            HttpResponseMessage respon = objClint.PostAsync(requestUri, new StringContent(json, System.Text.Encoding.UTF8, "application/json")).Result;

            String strRespon = await respon.Content.ReadAsStringAsync();

            if (!strRespon.Equals("1"))
            {
                MessageDialog messageDialog = new MessageDialog("상품들의 정보가 정상적으로 전송되지 않았습니다.");
                await messageDialog.ShowAsync();
            }
        }
Ejemplo n.º 2
0
        /*카테고리 별 상품들 업데이트하는 함수*/
        private void POS_SalePro_Refresh()
        {
            DBConn_Product dbPros = new DBConn_Product();

            //list초기화
            DB_ProList             = dbPros.GetProductForAssessment(cb_select_cate);
            lb_Product.ItemsSource = DB_ProList.OrderBy(i => i.Id).ToList();  //리스트 값을 오름차순으로 정렬
        }
Ejemplo n.º 3
0
        private void btn_Send_Click(object sender, RoutedEventArgs e)
        {
            DBConn_Product dbp         = new DBConn_Product();
            List <Product> productList = dbp.GetAllProduct();

            Uri     requestUri  = new Uri("http://localhost/actionTest.php");
            dynamic dynamicJson = new ExpandoObject();
            Random  r           = new Random();

            dynamicJson.product = productList;

            string json = "";

            json = Newtonsoft.Json.JsonConvert.SerializeObject(dynamicJson);
            var objClint = new HttpClient();
            //HttpResponseMessage respon = objClint.PostAsync(requestUri, new StringContent(json, System.Text.Encoding.UTF8, "application/json")).Result;
        }
Ejemplo n.º 4
0
        private void POS_product_Refresh()
        {
            DBConn_Product dbPros = new DBConn_Product();

            //list초기화
            DB_ProList = dbPros.GetProductForAssessment(cb_select_cate);

            if (DB_ProList.Count > 0)
            {
                btn_ProductDelete.IsEnabled = true;
            }
            else
            {
                btn_ProductDelete.IsEnabled = false;
            }

            lv_Product.ItemsSource = DB_ProList.OrderBy(i => i.Id).ToList();  //리스트 값을 오름차순으로 정렬
        }