private async Task NextPage(object param = null)
 {
     try
     {
         this.IsHomeButtonActive = false;
         this.IsBackButtonActive = false;
         if (!IsCustomLoadingScreen)
         {
             IsLoadingMenu = !IsLoadingMenu;
         }
         Ex.Log($"VM => Logic NextPage() param={param};");
         FillWithLookupsVM();
         FillWithAttrInputVM();
         Ex.Try(false, () => PayrecToSend.Summa = PayrecToSend.Summa.Replace(",", "."));
         EripToSend.ResponseReq.PayRecord       = new List <PayRecord>()
         {
             PayrecToSend
         };
         Responce = await StaticMain.NextPage(param ?? EripToSend);
     }
     catch (Exception ex)
     {
         Exception = ex;
     }
 }
 public MainWindow()
 {
     InitializeComponent();
     PostGetHTTP.WriteTextBox += WriteToTextbox;
     try
     {
         StaticMain.LoadSettings();
     }
     catch (Exception)
     {
         throw;
     }
 }
        private async void BackPage()
        {
            try
            {
                this.IsBackButtonActive = false;
                IsLoadingMenu           = !IsLoadingMenu;
                Ex.Log($"VM => Logic BackPage()");
                var temp = await StaticMain.BackPage();

                SetBackHeader(temp);
                Responce = temp;
            }
            catch (Exception ex)
            {
                Exception = ex;
            }
        }
Beispiel #4
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            MDIMaster mdi = this.MdiParent as MDIMaster;

            StaticMain.ServerName         = (String)this.cmbServer.SelectedItem;
            StaticMain.AuthenticationMode = this.cmbAuthenticationMode.SelectedIndex;
            StaticMain.UserName           = this.txtUserName.Text;
            StaticMain.Password           = this.txtPassword.Text;
            StaticMain.goMain();

            SqlConnection objConnection = StaticMain.Connection;

            try
            {
                objConnection.Open();

                if (objConnection.State == ConnectionState.Open)
                {
                    mdi.ConnectionState(true);
                    MessageBox.Show("Successfully Connection!",
                                    "Session",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                    this.Close();
                }
                else
                {
                    mdi.ConnectionState(false);
                    MessageBox.Show("Failed Connection!",
                                    "Session",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                mdi.ConnectionState(false);
                MessageBox.Show("Failed Connection!",
                                "Session",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }

            objConnection.Close();
        }
        private async void HomePage()
        {
            try
            {
                this.IsHomeButtonActive = false;
                this.IsBackButtonActive = false;
                IsLoadingMenu           = !IsLoadingMenu;
                Ex.Log($"VM => Logic HomePage()");
                Responce = await StaticMain.HomePage();

                string HomeHeader = Responce?.ResponseReq?.PayRecord?.FirstOrDefault()?.GroupRecord?.Name;
                LabelCurrent = $"Оплата услуг: {HomeHeader}";
                HeaderHistory.Home(HomeHeader);
            }
            catch (Exception ex)
            {
                Exception = ex;
            }
        }