Exemple #1
0
 public ZamowienieMaterialu(KWZP_PROJEKTEntities db, int id)
 {
     this.id = id;
     this.db = db;
     InitializeComponent();
     comboBoxNrZlecenia.DataSource  = db.AKTUALNY_STATUS_ZLECEN.Where(a => a.ID_ZLECENIA == id).ToList();
     comboBoxNrZlecenia.ValueMember = "ID_ZLECENIA";
     BtnShow.Hide();
     uzupelnijListe();
     BtnNoweZam.Hide();
     uzupelnijNoweZamowienie();
 }
Exemple #2
0
        void ReleaseDesignerOutlets()
        {
            if (ActivityIndicatorAlignmentSegementControl != null)
            {
                ActivityIndicatorAlignmentSegementControl.Dispose();
                ActivityIndicatorAlignmentSegementControl = null;
            }

            if (BtnDismiss != null)
            {
                BtnDismiss.Dispose();
                BtnDismiss = null;
            }

            if (BtnPrint != null)
            {
                BtnPrint.Dispose();
                BtnPrint = null;
            }

            if (BtnShow != null)
            {
                BtnShow.Dispose();
                BtnShow = null;
            }

            if (ContentView != null)
            {
                ContentView.Dispose();
                ContentView = null;
            }

            if (coverNavBarSwitch != null)
            {
                coverNavBarSwitch.Dispose();
                coverNavBarSwitch = null;
            }

            if (DismissibleWithTapSwitch != null)
            {
                DismissibleWithTapSwitch.Dispose();
                DismissibleWithTapSwitch = null;
            }

            if (ForceUserInteractionSwitch != null)
            {
                ForceUserInteractionSwitch.Dispose();
                ForceUserInteractionSwitch = null;
            }

            if (ImageAlignmentSegmentedControl != null)
            {
                ImageAlignmentSegmentedControl.Dispose();
                ImageAlignmentSegmentedControl = null;
            }

            if (ImageTintEnabledSwitch != null)
            {
                ImageTintEnabledSwitch.Dispose();
                ImageTintEnabledSwitch = null;
            }

            if (ImageTintSlider != null)
            {
                ImageTintSlider.Dispose();
                ImageTintSlider = null;
            }

            if (InAnimationTypeSegmentedControl != null)
            {
                InAnimationTypeSegmentedControl.Dispose();
                InAnimationTypeSegmentedControl = null;
            }

            if (LblDuration != null)
            {
                LblDuration.Dispose();
                LblDuration = null;
            }

            if (LblPadding != null)
            {
                LblPadding.Dispose();
                LblPadding = null;
            }

            if (NavigationBarSwitch != null)
            {
                NavigationBarSwitch.Dispose();
                NavigationBarSwitch = null;
            }

            if (OutAnimationTypeSegmentedControl != null)
            {
                OutAnimationTypeSegmentedControl.Dispose();
                OutAnimationTypeSegmentedControl = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }

            if (SegAlignment != null)
            {
                SegAlignment.Dispose();
                SegAlignment = null;
            }

            if (SegFromDirection != null)
            {
                SegFromDirection.Dispose();
                SegFromDirection = null;
            }

            if (SegSubtitleAlignment != null)
            {
                SegSubtitleAlignment.Dispose();
                SegSubtitleAlignment = null;
            }

            if (SegToDirection != null)
            {
                SegToDirection.Dispose();
                SegToDirection = null;
            }

            if (ShowActivityIndicatorSwitch != null)
            {
                ShowActivityIndicatorSwitch.Dispose();
                ShowActivityIndicatorSwitch = null;
            }

            if (ShowImageSwitch != null)
            {
                ShowImageSwitch.Dispose();
                ShowImageSwitch = null;
            }

            if (SlideOverSwitch != null)
            {
                SlideOverSwitch.Dispose();
                SlideOverSwitch = null;
            }

            if (SliderDuration != null)
            {
                SliderDuration.Dispose();
                SliderDuration = null;
            }

            if (SliderPadding != null)
            {
                SliderPadding.Dispose();
                SliderPadding = null;
            }

            if (SlideUnderSwitch != null)
            {
                SlideUnderSwitch.Dispose();
                SlideUnderSwitch = null;
            }

            if (StatusBarSwitch != null)
            {
                StatusBarSwitch.Dispose();
                StatusBarSwitch = null;
            }

            if (Toolbar != null)
            {
                Toolbar.Dispose();
                Toolbar = null;
            }

            if (TxtNotificationMessage != null)
            {
                TxtNotificationMessage.Dispose();
                TxtNotificationMessage = null;
            }

            if (TxtSubtitleMessage != null)
            {
                TxtSubtitleMessage.Dispose();
                TxtSubtitleMessage = null;
            }
        }
Exemple #3
0
        protected override void OnInit(QFramework.IUIData uiData)
        {
            mData = uiData as BindWIFIMessagePanelData ?? new BindWIFIMessagePanelData();

            if (Application.platform == RuntimePlatform.Android)
            {
                NativeGallery.RequestPermission((result, action) =>
                {
                    isSendMessage = true;
                    Log.I("RequestPermission: " + result);
                    if (result == (int)NativeGallery.Permission.Granted)
                    {
                        // InvokeRepeating("GetWifiInfo",1,1); 可以实时更新wifi,但无法修改wifi密码,暂时舍弃
                        NativeGallery.GetSomethingFromNative((json, action1) =>
                        {
                            if (json.IsNotNullAndEmpty())
                            {
                                isSSIDContains5G(json);
                                InputFieldSSID.text = json;
                                string pwd          = PlayerPrefsUtil.GetWiFiPWD(json);
                                if (pwd.IsNotNullAndEmpty())
                                {
                                    InputFieldPWD.text = pwd;
                                }
                                else
                                {
                                    InputFieldPWD.text = string.Empty;
                                }
                            }
                            Log.I("GetSomethingFromNative: " + json);
                        }, (int)NativeAction.Location);
                    }
                }, (int)NativeAction.Location);
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                if (NativeGallery.RequestIPhonePermission(2) == NativeGallery.Permission.Granted)
                {
                    NativeGallery.GetSomethingFromIPhone(result =>
                    {
                        if (result.IsNotNullAndEmpty())
                        {
                            InputFieldSSID.text = result;
                            isSSIDContains5G(result);
                            string pwd = PlayerPrefsUtil.GetWiFiPWD(result);
                            if (pwd.IsNotNullAndEmpty())
                            {
                                InputFieldPWD.text = pwd;
                            }
                            else
                            {
                                InputFieldPWD.text = String.Empty;
                            }
                        }
                    }, 1);
                }
            }

            var submit = Observable.Merge(
                InputFieldSSID.OnEndEditAsObservable().Where(_ => Input.GetKeyDown(KeyCode.Return)),
                BtnCommit.OnClickAsObservable().Select(_ => InputFieldSSID.text)
                );

            submit.Where(s => s != "")
            .Subscribe(s =>
            {
                AudioManager.PlaySound("Button_Audio");
                isSendMessage = false;
                if (saveWiFipwd)
                {
                    // 保存 WiFi ssid 和 pwd 到本地
                    PlayerPrefsUtil.SetWiFiSSIDPWD(InputFieldSSID.text, InputFieldPWD.text);
                }
                else
                {
                    PlayerPrefsUtil.SetWiFiSSIDPWD(InputFieldSSID.text, String.Empty);
                }

                Debug.Log("submit-确定 " + "ssid=" + s + "  pwd=" + InputFieldPWD.text);
                UIMgr.OpenPanel <BindDevicePanel>(new BindDevicePanelData()
                {
                    pwdStr  = InputFieldPWD.text,
                    ssidStr = InputFieldSSID.text
                }, UITransitionType.CIRCLE, this);
            }).AddTo(this);
            BtnClearPWD.OnClickAsObservable().Subscribe(_ =>
            {
                AudioManager.PlaySound("Button_Audio");
                InputFieldPWD.text = String.Empty;
            }).AddTo(this);
            BtnSSIDList.onClick.AddListener(() =>
            {
                AudioManager.PlaySound("Button_Audio");
#if UNITY_ANDROID
                NativeGallery.RequestPermission((result, action) =>
                {
                    Log.I("RequestPermission: " + result);
                    if (result == (int)NativeGallery.Permission.Granted)
                    {
                        NativeGallery.OpenWifiSettings();
                    }
                }, (int)NativeAction.Location);
#elif UNITY_IOS
                NativeGallery.OpenSettings();
#else
#endif
            });
            InputFieldSSID.OnValueChangedAsObservable().Subscribe((s =>
            {
                var texture2D = mResLoader.LoadSync <Texture2D>("ic_bindDetermine");
                if (s.Length > 0)
                {
                    texture2D = mResLoader.LoadSync <Texture2D>("ic_bindDetermine");
                }
                else
                {
                    texture2D = mResLoader.LoadSync <Texture2D>("btn_code_sel");
                }
                ImgDetermine.sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), Vector2.one * 0.5f);
            })).AddTo(this);

            BtnShow.OnClickAsObservable().Subscribe(_ =>
            {
                AudioManager.PlaySound("Button_Audio");
                var texture2D = mResLoader.LoadSync <Texture2D>("ic_savepwd");
                showWiFipwd   = !showWiFipwd;
                if (showWiFipwd)
                {
                    texture2D = mResLoader.LoadSync <Texture2D>("btn_show_pwd");
                    InputFieldPWD.contentType = InputField.ContentType.EmailAddress;
                }
                else
                {
                    texture2D = mResLoader.LoadSync <Texture2D>("btn_hide_pwd");
                    InputFieldPWD.contentType = InputField.ContentType.Password;
                }

                var image    = BtnShow.transform.Find("Image").GetComponent <Image>();
                image.sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), Vector2.one * 0.5f);
                InputFieldPWD.MyUpdateLabel();
            }).AddTo(this);

            BtnConnectTips.OnClickAsObservable().Subscribe(_ =>
            {
                AudioManager.PlaySound("Button_Audio");
                UIMgr.OpenPanel <BindCheckWIFIPanel>(new BindCheckWIFIPanelData(), UITransitionType.NULL);
            }).AddTo(this);

            BtnBack.OnClickAsObservable().Subscribe(_ =>
            {
                AudioManager.PlaySound("Button_Audio");
                Debug.Log("WiFi 返回");
                Back();
            }).AddTo(this);

            BtnSavepwd.OnClickAsObservable().Subscribe(_ =>
            {
                AudioManager.PlaySound("Button_Audio");
                Debug.Log("记住密码");
                saveWiFipwd   = !saveWiFipwd;
                var texture2D = mResLoader.LoadSync <Texture2D>("ic_savepwd");
                if (saveWiFipwd)
                {
                    texture2D = mResLoader.LoadSync <Texture2D>("ic_savepwd");
                }
                else
                {
                    texture2D = mResLoader.LoadSync <Texture2D>("ic_unsavepwd");
                }
                ImageSavePWD.sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), Vector2.one * 0.5f);
            }).AddTo(this);


            SimpleEventSystem.GetEvent <TipConfirmClick>()
            .Subscribe(_ =>
            {
                if (_.GetAction == TipAction.Contains5GAlter)
                {
                    if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        NativeGallery.RequestPermission((result, action) =>
                        {
                            Log.I("RequestPermission: " + result);
                            if (result == (int)NativeGallery.Permission.Granted)
                            {
                                NativeGallery.OpenWifiSettings();
                            }
                        }, (int)NativeAction.Location);
                    }
                    else if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        NativeGallery.OpenSettings();
                    }
                }
            }).AddTo(this);

            // please add init code here
        }