Exemple #1
0
 private void txtErrMsg_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (true == VOP.MainWindow.m_bLocationIsChina)
     {
         if (((byte)m_currentStatus >= (byte)EnumStatus.PolygomotorOnTimeoutError &&
              (byte)m_currentStatus <= (byte)EnumStatus.CTL_PRREQ_NSignalNoCome) ||
             m_currentStatus == EnumStatus.ScanMotorError ||
             m_currentStatus == EnumStatus.ScanDriverCalibrationFail ||
             m_currentStatus == EnumStatus.NetWirelessDongleCfgFail)
         {
             MaintainWindow mw = new MaintainWindow();
             mw.Owner = App.Current.MainWindow;
             mw.ShowDialog();
         }
     }
 }
Exemple #2
0
        private void OnBtnClick(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            if (btn.Name == "btnLogon")
            {
                LoginWindow loginWnd = new LoginWindow();
                loginWnd.Owner         = App.Current.MainWindow;
                loginWnd.ShowActivated = true;
                Nullable <bool> dialogResult = loginWnd.ShowDialog();

                if (dialogResult == true)
                {
                    VOP.MainWindow.m_bLogon         = true;
                    VOP.MainWindow.m_strPhoneNumber = loginWnd.m_strPhoneNumber;

                    UserInformation userInformation = new UserInformation();
                    string          strResult       = "";
                    UserInformation.GetUserInfo(VOP.MainWindow.m_strPhoneNumber, ref userInformation, ref strResult);

                    if (userInformation.m_strRealName.Length > 0)
                    {
                        tbUserName.Text = userInformation.m_strRealName + String.Format("({0})", VOP.MainWindow.m_strPhoneNumber);
                    }
                    else
                    {
                        tbUserName.Text = VOP.MainWindow.m_strPhoneNumber;
                    }

                    tbUserName.Visibility = Visibility.Visible;
                    btnLogon.Visibility   = Visibility.Hidden;

                    ((MainWindow)App.Current.MainWindow).UpdateLogonBtnStatus(true);
                    btnModifyUserInfo.IsEnabled = true;
                }
            }
            else if (btn.Name == "btnModifyUserInfo")
            {
                ((MainWindow)App.Current.MainWindow).ShowModifyUserInfoView();
            }
            else if (btn.Name == "btnConsumable")
            {
                PurchaseWindow win = new PurchaseWindow();
                win.Owner = App.Current.MainWindow;
                win.ShowDialog();
            }
            else if (btn.Name == "btnRewardPoints")
            {
            }
            else if (btn.Name == "btnMaintainStation")
            {
                MaintainWindow mw = new MaintainWindow();
                mw.Owner = App.Current.MainWindow;
                mw.ShowDialog();
            }
            else if (btn.Name == "btnFWDownload")
            {
                try
                {
                    System.Diagnostics.Process.Start(@"http://function.iprintworks.cn/downapp/down.html");
                }
                catch
                {
                }
            }
            else if (btn.Name == "btnAbout")
            {
                AboutWindow wnd = new AboutWindow();
                wnd.Owner = App.Current.MainWindow;
                wnd.ShowDialog();
            }
            else if (btn.Name == "btnBack")
            {
                ((MainWindow)App.Current.MainWindow).ShowUserCenterView(false);
            }
            else if (btn.Name == "btnImprovePlan")
            {
                ((MainWindow)App.Current.MainWindow).ShowCRMAgreementWindow();
            }
        }