Esempio n. 1
0
        public void sendPituresToAPI(UPCProductReference UPCRefereceListSelected, KinectScanConfig kinectScanConfig)
        {
            TensorIoTAPI TensorAPI  = new TensorIoTAPI();
            string       sendResult = TensorAPI.SendPicturesToAWS(UPCRefereceListSelected.UPCcode, UPCRefereceListSelected.RefNo);

            if (!string.IsNullOrEmpty(sendResult))
            {
                mw.ErrorPopup(sendResult, backToMainPage: true, fromAPI: true);
            }
        }
        private void UPCcode_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (allCamerasAvailable && UPCcode_TextBox.Text.EndsWith("\r\n"))
            {
                UPCcode_TextBox.Text = UPCcode_TextBox.Text.Replace("\r\n", "");
                mw.UPCRefereceList   = new ObservableCollection <UPCProductReference>();
                TensorIoTAPI TensorAPI = new TensorIoTAPI();
                Tuple <ObservableCollection <UPCProductReference>, string> APIresult = TensorAPI.GetReferenceCodes(UPCcode_TextBox.Text);
                mw.UPCRefereceList = APIresult.Item1;
                string errMsg = APIresult.Item2;
                if (!string.IsNullOrEmpty(errMsg))
                {
                    mw.ErrorPopup(errMsg, backToMainPage: true, fromAPI: true);
                    return;
                }
                bool UPCfound = mw.UPCRefereceList.Count != 0;
                if (UPCfound)
                {
                    UPCReferenceList_ComboBox.ItemsSource       = mw.UPCRefereceList;
                    UPCReferenceList_ComboBox.DisplayMemberPath = "comboboxDisp";
                    UPCnotfound_TextBlock.Visibility            = Visibility.Collapsed;
                    UPCReferenceList_ComboBox.Visibility        = Visibility.Visible;
                    RescanUPC_button.Visibility = Visibility.Visible;

                    StartInfoMsg.Visibility      = Visibility.Collapsed;
                    UPCcode_TextBox.IsEnabled    = false;
                    StartInfoMsgLabel.Visibility = Visibility.Visible;
                    UPCcode_TextBox.Width        = 100;
                }
                else
                {
                    mw.mwAllPicsSubmitted.Visibility  = Visibility.Collapsed;
                    mw.mwErrorDialog.Visibility       = Visibility.Collapsed;
                    mw.mwUPCnotFoundDialog.Visibility = Visibility.Visible;
                    mw.winDialog.IsOpen = true;
                    //UPCnotfound_TextBlock.Visibility = Visibility.Visible;
                    UPCcode_TextBox.Text = "";
                }
            }
        }