public void CloseCustomerForm()
 {
     ActiveForm.Close();
 }
Exemple #2
0
 public void trackBarSize_MouseUp(object sender, MouseEventArgs e)
 {
     MainForm.ActiveForm.Width  = trackBarSize.Value * 160;
     MainForm.ActiveForm.Height = trackBarSize.Value * 120;
     ActiveForm.Refresh();
 }
Exemple #3
0
 private void fermerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
 private void button3_Click(object sender, EventArgs e)
 {
     ActiveForm.Hide();
     Admin.Меню_Администратора mm = new Admin.Меню_Администратора(email);
     mm.Show();
 }
 private void AdvancedExport_OK(object sender, EventArgs e)
 {
     ActiveForm.Close();
     return;
 }
Exemple #7
0
 private void button1_Click(object sender, EventArgs e)
 {
     Visible = false;
     ActiveForm.Activate();
 }
Exemple #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                textBox1.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.username = textBox1.Text;
            }
            if (textBox2.Text == "")
            {
                textBox2.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.password = textBox2.Text;
            }

            if (textBox3.Text == "")
            {
                textBox3.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.latitute = double.Parse(textBox3.Text.Replace(',', '.'), cords, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            if (textBox4.Text == "")
            {
                textBox4.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.longitude = double.Parse(textBox4.Text.Replace(',', '.'), cords, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            if (textBox5.Text == "")
            {
                textBox5.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.altitude = double.Parse(textBox5.Text.Replace(',', '.'), cords, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            if (textBox6.Text == "")
            {
                textBox6.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.speed = double.Parse(textBox6.Text.Replace(',', '.'), cords, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            if (textBox7.Text == "")
            {
                textBox7.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.radius = int.Parse(textBox7.Text);
            }

            if (textBox8.Text == "")
            {
                textBox8.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.duplicate = int.Parse(textBox8.Text);
            }

            if (textBox9.Text == "")
            {
                textBox9.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.maxCp = int.Parse(textBox9.Text);
            }

            Globals.transfer = checkBox2.Checked;
            Globals.defLoc   = checkBox1.Checked;
            Globals.evolve   = checkBox3.Checked;

            if (textBox10.Text == "")
            {
                textBox10.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.pokeball = int.Parse(textBox10.Text);
            }

            if (textBox11.Text == "")
            {
                textBox11.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.greatball = int.Parse(textBox11.Text);
            }

            if (textBox12.Text == "")
            {
                textBox12.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.ultraball = int.Parse(textBox12.Text);
            }

            if (textBox13.Text == "")
            {
                textBox13.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.revive = int.Parse(textBox13.Text);
            }

            if (textBox14.Text == "")
            {
                textBox14.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.potion = int.Parse(textBox14.Text);
            }

            if (textBox15.Text == "")
            {
                textBox15.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.superpotion = int.Parse(textBox15.Text);
            }

            if (textBox16.Text == "")
            {
                textBox16.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.hyperpotion = int.Parse(textBox16.Text);
            }

            if (textBox17.Text == "")
            {
                textBox17.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.berry = int.Parse(textBox17.Text);
            }

            if (textBox18.Text != "")
            {
                Globals.telAPI = textBox18.Text;
            }

            if (textBox19.Text != "")
            {
                Globals.telName = textBox19.Text;
            }

            if (textBox20.Text == "")
            {
                textBox20.BackColor = Color.Red;
                return;
            }
            else
            {
                Globals.telDelay = int.Parse(textBox20.Text);
            }

            if (textBox21.Text == "")
            {
                textBox21.BackColor = Color.Red;
            }
            else
            {
                Globals.toppotion = int.Parse(textBox21.Text);
            }

            if (textBox22.Text == "")
            {
                textBox22.BackColor = Color.Red;
            }
            else
            {
                Globals.masterball = int.Parse(textBox22.Text);
            }

            if (textBox23.Text == "")
            {
                textBox23.BackColor = Color.Red;
            }
            else
            {
                Globals.toprevive = int.Parse(textBox23.Text);
            }

            if (textBox24.Text == "")
            {
                textBox24.BackColor = Color.Red;
            }
            else
            {
                Globals.ivmaxpercent = int.Parse(textBox24.Text);
            }

            Globals.gerNames   = checkBox8.Checked;
            Globals.useincense = checkBox9.Checked;
            Globals.pokeList   = checkBox10.Checked;

            foreach (string pokemon in checkedListBox1.CheckedItems)
            {
                if (checkBox8.Checked)
                {
                    Globals.noTransfer.Add((PokemonId)Enum.Parse(typeof(PokemonId), gerEng[pokemon]));
                }
                else
                {
                    Globals.noTransfer.Add((PokemonId)Enum.Parse(typeof(PokemonId), pokemon));
                }
            }
            foreach (string pokemon in checkedListBox2.CheckedItems)
            {
                if (checkBox8.Checked)
                {
                    Globals.noCatch.Add((PokemonId)Enum.Parse(typeof(PokemonId), gerEng[pokemon]));
                }
                else
                {
                    Globals.noCatch.Add((PokemonId)Enum.Parse(typeof(PokemonId), pokemon));
                }
            }
            foreach (string pokemon in checkedListBox3.CheckedItems)
            {
                if (checkBox8.Checked)
                {
                    Globals.doEvolve.Add((PokemonId)Enum.Parse(typeof(PokemonId), gerEng[pokemon]));
                }
                else
                {
                    Globals.doEvolve.Add((PokemonId)Enum.Parse(typeof(PokemonId), pokemon));
                }
            }

            string[] accFile =
            {
                Globals.acc.ToString(),
                Globals.username,
                Globals.password,
                Globals.latitute.ToString(),
                Globals.longitude.ToString(),
                Globals.altitude.ToString(),
                Globals.speed.ToString(),
                Globals.radius.ToString(),
                Globals.defLoc.ToString(),
                Globals.transfer.ToString(),
                Globals.duplicate.ToString(),
                Globals.evolve.ToString(),
                Globals.maxCp.ToString(),
                Globals.telAPI,
                Globals.telName,
                Globals.telDelay.ToString(),
                Globals.navigation_option.ToString(),
                Globals.useluckyegg.ToString(),
                Globals.gerNames.ToString(),
                Globals.useincense.ToString(),
                Globals.ivmaxpercent.ToString(),
                Globals.pokeList.ToString()
            };
            System.IO.File.WriteAllLines(@Program.account, accFile);

            string[] itemsFile =
            {
                Globals.pokeball.ToString(),
                Globals.greatball.ToString(),
                Globals.ultraball.ToString(),
                Globals.revive.ToString(),
                Globals.potion.ToString(),
                Globals.superpotion.ToString(),
                Globals.hyperpotion.ToString(),
                Globals.berry.ToString(),
                Globals.masterball.ToString(),
                Globals.toppotion.ToString(),
                Globals.toprevive.ToString()
            };
            System.IO.File.WriteAllLines(@Program.items, itemsFile);

            string[] temp = new string[200];
            int      i    = 0;

            foreach (PokemonId pokemon in Globals.noTransfer)
            {
                if (checkBox8.Checked)
                {
                    temp.SetValue(StringUtils.getPokemonNameGer(pokemon), i);
                }
                else
                {
                    temp.SetValue(pokemon.ToString(), i);
                }
                i++;
            }
            string[] noTransFile = temp.Where(x => !String.IsNullOrEmpty(x)).ToArray();
            System.IO.File.WriteAllLines(Program.@keep, noTransFile);

            i = 0;
            Array.Clear(temp, 0, temp.Length);
            foreach (PokemonId pokemon in Globals.noCatch)
            {
                if (checkBox8.Checked)
                {
                    temp.SetValue(StringUtils.getPokemonNameGer(pokemon), i);
                }
                else
                {
                    temp.SetValue(pokemon.ToString(), i);
                }
                i++;
            }
            string[] noCatchFile = temp.Where(x => !String.IsNullOrEmpty(x)).ToArray();
            System.IO.File.WriteAllLines(@Program.ignore, noCatchFile);

            Array.Clear(temp, 0, temp.Length);
            i = 0;
            foreach (PokemonId pokemon in Globals.doEvolve)
            {
                if (checkBox8.Checked)
                {
                    temp.SetValue(StringUtils.getPokemonNameGer(pokemon), i);
                }
                else
                {
                    temp.SetValue(pokemon.ToString(), i);
                }
                i++;
            }
            string[] EvolveFile = temp.Where(x => !String.IsNullOrEmpty(x)).ToArray();
            File.WriteAllLines(@Program.evolve, EvolveFile);

            ActiveForm.Dispose();
        }
        public void Run(Form f)
        {
            Terminal.SetScreenSize(ScreenSize.Width, ScreenSize.Height);

start:

            try
            {
                MainForm = f;

                _show(f);

                Terminal.Clear();
                PerformPaint();

                // Start the message loop
                Message msg = null;
                _currentApp = this;

                while ((MessageQueue.GetMessage(ref msg)))
                {
                    if (msg.MessageType == WM_MessageType.WM_KEY)
                    {
                        var key_info = (KeyInfo)msg.Parameter;
                        ActiveForm.SendKey(key_info);
                    }
                    else if (msg.MessageType == WM_MessageType.WM_SHOW_FORM)
                    {
                        var form = (Form)msg.Parameter;
                        _show(form);
                    }
                    else if (msg.MessageType == WM_MessageType.WM_RESIZE)
                    {
                        ActiveForm.OnResize(new EventArgs());
                    }
                    else if (msg.MessageType == WM_MessageType.WM_TIMER)
                    {
                        var timer = (Timer)msg.Parameter;
                        timer.OnTick(EventArgs.Empty);
                    }
                    else if (msg.MessageType == WM_MessageType.WM_QUIT)
                    {
                        break;
                    }

                    PerformPaint();
                }
            }
            catch (Exception ex)
            {
                var error_form = new ErrorForm();
                error_form.ErrorText = ex.ToString();
                var old_size = error_form.Size;
                error_form.Size = ScreenSize;
                error_form.PerformAnchoring(old_size, error_form.Size);
                Terminal.Clear();
                Show(error_form);
                PerformPaint();

                goto start;
            }

            Terminal.Clear();
        }
 private void FormCloser_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #11
0
        private void Send_btn_Click(object sender, EventArgs e)
        {
            string to = to = label10.Text;
            string failure_message = fm_tb.Text;
            string project_Name    = "abc";
            int    attempts        = Convert.ToInt32(label18.Text);
            string serverName      = label2.Text;
            int    portNo          = Convert.ToInt32(label4.Text);
            string emailId         = label8.Text;
            string password        = label14.Text;
            string body            = body_tb.Text;
            string cc              = label6.Text;
            string bcc             = label12.Text;
            string enable_ssl      = label16.Text;
            string enable_password = label20.Text;
            string displayName     = "";
            string timer_path      = string.Empty;
            string timer           = string.Empty;

            timer_path = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + "\\Config\\Webconfig.xml";
            XDocument xmldoc = XDocument.Load(timer_path);

            timer = xmldoc.Descendants("timer").First().Value;
            Int32    time            = Int32.Parse(timer);
            DateTime curr_time       = DateTime.Now;
            Int32    time_difference = ((Int32)curr_time.Subtract(start_time).TotalMinutes);

            if (time_difference >= time)
            {
                attempts--;
                start_time = DateTime.Now;
            }
            try
            {
                MailMessage mail = new MailMessage();
                SmtpClient  smtp = new SmtpClient(serverName, portNo);
                smtp.DeliveryMethod = SmtpDeliveryMethod.Network;

                smtp.EnableSsl = false;

                if (password != null)
                {
                    smtp.EnableSsl   = true;
                    smtp.Credentials = new System.Net.NetworkCredential(emailId, password);
                }
                else
                {
                    smtp.UseDefaultCredentials = false;
                }

                enable_ssl = smtp.EnableSsl.ToString();

                smtp.Timeout = Convert.ToInt32(500000);
                mail.From    = new MailAddress(emailId, displayName);
                string[] toEmails = to.Split(';');
                if (toEmails.Length > 0)
                {
                    foreach (string singleEmail in toEmails)
                    {
                        mail.To.Add(singleEmail);
                    }
                }
                else
                {
                    mail.To.Add(to);
                }

                if (attachments.Length > 0)
                {
                    foreach (string singleAttachment in attachments)
                    {
                        if (attachment != string.Empty)
                        {
                            mail.Attachments.Add(new Attachment(singleAttachment));
                        }
                    }
                }

                mail.Subject = subject;

                mail.IsBodyHtml = true;

                mail.Body = body;


                smtp.Send(mail);

                Email_details.Class1.Update(Eid, serverName, portNo, emailId, password, to, body, subject, "Y", "", DateTime.Now, project_Name, enable_ssl, enable_password, 0, attachment, cc, bcc, start_time);
                fnWriteErrorLog("Mail Sent and Database is updated", " ***SUCCESS*** ");
                DialogResult dialog = MessageBox.Show("Mail Sent successfully");
                if (dialog == DialogResult.OK)
                {
                    ActiveForm.Close();
                }
                return;
            }
            catch (InvalidOperationException ie)
            {
                if (ie.InnerException != null)
                {
                    fm_tb.Text      = ie.Message + Environment.NewLine + ie.InnerException;
                    failure_message = "To_Email: " + to + "\n InvalidOperationException " + ie.Message + Environment.NewLine + ie.InnerException;
                }
                else
                {
                    fm_tb.Text      = ie.Message;
                    failure_message = "To_Email: " + to + "\n InvalidOperationException " + ie.Message + Environment.NewLine + ie.StackTrace;
                }
            }
            catch (SmtpFailedRecipientsException sre)
            {
                if (sre.InnerException != null)
                {
                    fm_tb.Text      = sre.Message + Environment.NewLine + sre.InnerException;
                    failure_message = "To_Email: " + to + "\n SmtpFailedRecipientsException " + sre.Message + Environment.NewLine + sre.InnerException;
                }
                else
                {
                    fm_tb.Text      = sre.Message;
                    failure_message = "To_Email: " + to + "\n SmtpFailedRecipientsException " + sre.Message + Environment.NewLine + sre.StackTrace;
                }
            }
            catch (SmtpException se)
            {
                if (se.InnerException != null)
                {
                    fm_tb.Text      = se.Message + Environment.NewLine + se.InnerException;
                    failure_message = "To_Email: " + to + "\n SMTPException " + se.Message + Environment.NewLine + se.InnerException;
                }
                else
                {
                    fm_tb.Text      = se.Message;
                    failure_message = "To_Email: " + to + "\n SMTPException " + se.Message + Environment.NewLine + se.StackTrace;
                }
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    fm_tb.Text      = ex.Message + Environment.NewLine + ex.InnerException;
                    failure_message = "To_Email: " + to + "\n" + ex.Message + Environment.NewLine + ex.InnerException;
                }
                else
                {
                    fm_tb.Text      = ex.Message;
                    failure_message = "To_Email: " + to + "\n" + ex.Message + Environment.NewLine + ex.StackTrace;
                }
            }
            MessageBox.Show("Mail NOT sent");
            Email_details.Class1.Update(Eid, serverName, portNo, emailId, password, to, body, subject, "N", failure_message, DateTime.Now, project_Name, enable_ssl, enable_password, attempts, attachment, cc, bcc, start_time);
            fnWriteErrorLog("Email NOT sent", " Database record is updated for failure email...");
        }
Exemple #12
0
 private void butt_service_close_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #13
0
 private void txtbtnOk_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #14
0
 private void NoExitButton_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
 public static void Exit_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #16
0
 void btn_exit_Click(object sender, EventArgs e)
 {
     Properties.Settings.Default.id = 0;
     ActiveForm.Close();
 }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            bool error = false;

            if (txtCiudadOrigen.Text == "")
            {
                error = true;
            }

            if (txtCiudadDestino.Text == "")
            {
                error = true;
            }

            if (txtSeleccionarVehiculo.Text == "")
            {
                error = true;
            }

            if (dtpFechaViaje.Value <= DateTime.Today)
            {
                error = true;
            }

            if (cbxCantidadPasajeros.SelectedIndex == -1)
            {
                error = true;
            }

            if (cbxTipoVehiculo.SelectedIndex == -1)
            {
                error = true;
            }
            else if (cbxCantidadPasajeros.SelectedIndex != -1)
            {
                int cantPas = Convert.ToInt16(cbxCantidadPasajeros.Text);

                if ((cbxTipoVehiculo.SelectedIndex == 0) && (cantPas < 10))
                {
                    error = true;
                }

                if (cbxTipoVehiculo.SelectedIndex == 1)
                {
                    if (cantPas > 5)
                    {
                        error = true;
                    }

                    if (mskCantidadKm.Text == "")
                    {
                        error = true;
                    }
                }
                if ((cbxTipoVehiculo.SelectedIndex == 2) && (cantPas > 50))
                {
                    error = true;
                }
            }

            if (error)
            {
                MessageBox.Show("Hay campos incerrectos o sin completar.", "Advertencia", MessageBoxButtons.OK);
            }
            else
            {
                string   origen  = txtCiudadOrigen.Text;
                string   detino  = txtCiudadDestino.Text;
                DateTime fecha   = dtpFechaViaje.Value;
                int      cantPas = Convert.ToInt16(cbxCantidadPasajeros.Text);
                int      id      = Convert.ToInt16(txtSeleccionarVehiculo.Text);
                tipo = cbxTipoVehiculo.SelectedIndex;
                string tipoVh    = ((tipo == 0) ? "Avión" : (tipo == 1) ? "Auto" : "Colectivo");
                int    cantPasKm = cantPas;

                if (tipo == 1)
                {
                    cantPasKm = Convert.ToInt16(mskCantidadKm.Text);
                }

                float costo = CalcularCostoTotal(tipo, id, cantPasKm);
                Viaje = new Viaje(origen, detino, fecha, cantPas, id, tipoVh, costo);
                MessageBox.Show("Viaje registrado correctamente: el costo total es $" + costo, "Información", MessageBoxButtons.OK);

                estado = true;
                ActiveForm.Close();
            }
        }
Exemple #18
0
 private void btnCancelar_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
 private void btn_validation_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
 private void AdvancedExport_Cancel(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #21
0
 private void btnReturn_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #22
0
        private void BT_OK_Click(object sender, EventArgs e)
        {
            if (TB_Pergunta.Text != "" && TB_RespostaCerta.Text != "")
            {
                if (CB_ConhecimentoMatematico.Checked)
                {
                    conhecimentoMatematico = 1;
                }
                if (CB_Ancoragem.Checked)
                {
                    ancoragem = 1;
                }
                if (CB_Representatividade.Checked)
                {
                    representatividade = 1;
                }
                if (CB_AutoConfianca.Checked)
                {
                    autoconfianca = 1;
                }
                if (CB_Disponibilidade.Checked)
                {
                    disponibilidade = 1;
                }
                if (CB_CalibraFirnimo.Checked)
                {
                    calibraFirmino = 1;
                }
                if (CB_CalibraDireto.Checked)
                {
                    calibraDireto = 1;
                }
                if (CB_CalibraBissecao.Checked)
                {
                    calibraBissecao = 1;
                }
                if (CB_AplicaFirmino.Checked)
                {
                    aplicaFirmino = 1;
                }
                if (CB_AplicaDireto.Checked)
                {
                    aplicaDireto = 1;
                }
                if (CB_AplicaBisseção.Checked)
                {
                    aplicaBissecao = 1;
                }
                if (CB_AplicaScoringRules.Checked)
                {
                    aplicaScoringRules = 1;
                }
                if (CB_AplicaScoringRules.Checked)
                {
                    aplicaScoringRules = 1;
                }
                if (CB_SerahUsada.Checked)
                {
                    serahUsada = 1;
                }
                if (CB_VariavelNominal.Checked)
                {
                    variavelNominal = 1;
                }
                caminhoImagem = TB_CaminhoImagem.Text;
                pergunta      = TB_Pergunta.Text;
                respostaCerta = TB_RespostaCerta.Text;
                distribuicao  = CB_Distribuicao.Text;
                comentarios   = RTB_Comentarios.Text;

                InterfaceBanco banco = InterfaceBanco.getInstance();
                banco.inserirPergunta(pergunta, respostaCerta, conhecimentoMatematico,
                                      ancoragem, representatividade, autoconfianca, disponibilidade, calibraFirmino,
                                      calibraDireto, calibraBissecao, aplicaFirmino, aplicaDireto, aplicaBissecao,
                                      aplicaScoringRules, serahUsada, distribuicao, caminhoImagem, variavelNominal, comentarios);

                string q2 = TB_Alterantivas.Text;
                alternativas = q2.Split(new char[] { ';' });
                banco.inserirAlternativas(alternativas);
                banco.inseriProjetoPergunta(CB_ProjetoVinculado.Text);
                ActiveForm.Close();
            }
            else
            {
                ifPrincipal.DisplayMessage(DefaultConfig.ST_TXT_FILL_ALL_FIELDS_QUESTIONS, true);
            }
        }
 private void btnExit_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
     this.Dispose(true);
 }
 private void BtnCerrar_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #25
0
 private void MainForm_Resize(object sender, EventArgs e)
 {
     ActiveForm.Refresh();
 }
Exemple #26
0
 private void botonSalir_Click(object sender, EventArgs e)
 {
     ActiveForm.Close();
 }
Exemple #27
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     apiKey = apiInput.Text;
     ActiveForm.Hide();
 }