示例#1
0
        static void Main()
        {
            string[] NM = { "DANI",  "DINA",   "NADI", "DIAN",  "ANDI",
                            "BONAR", "HENI",   "BINA", "JOGI",  "FANI",
                            "INDAH", "ERNI",   "IRMA", "ERIKA", "EDI",
                            "CITRA", "JULITA", "GEA",  "SIMA",  "ASMI",
                            "RISA",  "SARI",   "IRSA", "BORIS", "FERDI",
                            "ARDI",  "IRA",    "CITA", "IRDA",  "DIAR",
                            "FIA",   "RITA",   "TIAR", "GINA",  "TRIA",
                            "LINA",  "NILA",   "ALIN", "ALIN",  "DELANI" };
            double[] NL = new double[20]; int F;
            string[] NR = new string[20]; string NO;
            Random   R = new Random();

            for (int X = 0; X < 20; X++)
            {
                NO    = ((X + 101).ToString());
                NR[X] = NO.Substring(1, 2);
                NL[X] = R.Next(70, 99) + R.NextDouble();
            }

            Program P1 = new Program(); P1.DISPLAY(NR, NL, NM);

loop:
            Write(" Sort by [0/1/2] "); F = int.Parse(ReadLine());
            Program P2 = new Program(); P2.SELECTION(NR, NL, NM, F);
            Program P3 = new Program(); P3.DISPLAY(NR, NL, NM);

            if (F >= 0 && F <= 2)
            {
                goto loop;
            }
            ReadKey();
        }
示例#2
0
        public IEnumerable <NO> Get()
        {
            List <NO>     lista = new List <NO>();
            SqlConnection conn  = new SqlConnection(CONNSTRING);

            try
            {
                conn.Open();

                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "SELECT * FROM NO2";
                cmd.Connection  = conn;

                SqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    NO n = new NO();
                    n.value = (int)reader["value"];
                    n.date  = (DateTime)reader["date"];
                    n.local = (string)reader["local"];
                        << << << < HEAD

                        == == == =

                            >> >> >> > 29802e09e4080cf1f0c9b55b25512b2a138dbc27

                            lista.Add(n);
                }
示例#3
0
文件: Main.cs 项目: Taiizor/TCNO
        private void Kontrol(string TXT, bool EXEC = false)
        {
            try
            {
                if (!string.IsNullOrEmpty(TXT) && !string.IsNullOrWhiteSpace(TXT) && TXT.Length == 11 && !TXT.Contains(" "))
                {
                    ulong Count = Convert.ToUInt64(TXT);
                    if (NO.Check(TXT))
                    {
                        poisonLabel2.Visible = true;
                        poisonLabel3.Visible = false;
                        if (EXEC)
                        {
                            listBox1.SelectedIndex++;
                        }
                    }
                    else
                    {
                        poisonLabel2.Visible = false;
                        poisonLabel3.Visible = true;
                        Kontrol2();
                    }
                }
                else
                {
                    if (timer1.Enabled)
                    {
                        Kontrol2();
                    }

                    PoisonMessageBox.Show(this, "Kontrol Edilecek TC NO Belirtiniz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch
            {
                if (timer1.Enabled)
                {
                    Kontrol2();
                }

                PoisonMessageBox.Show(this, "Hatalı Bir TC NO Girdiniz!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#4
0
文件: Main.cs 项目: Taiizor/TCNO
        private void Job_Work(object sender, DoWorkEventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(poisonTextBox1.Text) && !string.IsNullOrWhiteSpace(poisonTextBox1.Text) && !poisonTextBox1.Text.StartsWith("0") && !poisonTextBox1.Text.Contains(" "))
                {
                    poisonButton3.Enabled = false;
                    poisonButton4.Enabled = false;
                    int    Count = Convert.ToInt32(poisonTextBox1.Text);
                    Random RNDM  = new();
                    for (int C = 0; C < Count; C++)
                    {
                        string GTCN = NO.Create(RNDM);
                        if (!listBox1.Items.Contains(GTCN))
                        {
                            listBox1.Items.Add(GTCN);
                            poisonLabel1.Text      = "Eleman Sayısı: " + listBox1.Items.Count;
                            listBox1.SelectedIndex = listBox1.Items.Count - 1;
                        }
                        else
                        {
                            C--;
                        }
                    }

                    poisonButton3.Enabled = true;
                    poisonButton4.Enabled = true;
                }
                else
                {
                    PoisonMessageBox.Show(this, "Üretilecek TC NO Sayısını Belirtiniz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch
            {
                PoisonMessageBox.Show(this, "Hatalı Bir TC NO Sayısı Girdiniz!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#5
0
        public void carregaArvore()
        {
            NO no0 = new NO(0);
            NO no1 = new NO(1);
            NO no2 = new NO(2);
            NO no3 = new NO(3);
            NO no4 = new NO(4);
            NO no5 = new NO(5);
            NO no6 = new NO(6);
            NO no7 = new NO(7);
            NO no8 = new NO(8);

            //no.noEsquerda = no;
            //no.noDireita = no;

            no0.noEsquerda = no1;
            no0.noDireita  = no2;

            no1.noEsquerda = no3;
            no1.noDireita  = no4;

            no2.noEsquerda = no5;
            no2.noDireita  = no6;
        }
示例#6
0
 public editDialog(string content)
 {
     InitializeComponent();
     pageInit(content);
     NO.Focus();
 }