private void textBox1_TextChanged(object sender, EventArgs e) { try { string number = cardnumber_textbox.Text; int x = odb.Code(String.Format("Select Kartya_szama from Credit_card where Kartya_szama = {0}", number)); switch (x) { case 0: break; default: //object sender = new object(); //EventArgs e = new EventArgs(); CardTipus(sender, e); break; } string elso; string masodik; string harmadik; string negyedik; //string otodik; if (cardnumber_textbox.Text.Length == 16) { elso = number.Substring(0, 4); masodik = number.Substring(5, 4); harmadik = number.Substring(8, 4); negyedik = number.Substring(12, 4); CardNumber_Label.Text = string.Format("{0} {1} {2} {3}", elso, masodik, harmadik, negyedik); } else { elso = number.Substring(0, 4); masodik = number.Substring(5, 4); harmadik = number.Substring(8, 4); negyedik = number.Substring(12, 3); CardNumber_Label.Text = string.Format("{0} {1} {2} {3}", elso, masodik, harmadik, negyedik); } Card4N_label.Text = cardnumber_textbox.Text.Substring(0, 4); if (gen.Valódi(cardnumber_textbox.Text)) { Valódi_checkbox.Checked = true; } //ApplyStyleTo(CardNumber_Label); } catch (Exception) { throw; } }
private void Szamlakod() { Random rnd = new Random(); ushort Azonkod = Convert.ToUInt16((ncdv).ToString() + rnd.Next(100).ToString()); int x = alap.Code(String.Format("Select Szamla_kod from Számla_reg where Szamla_kod = {0}", Azonkod)); if (x == 0) { Account_code_text.Text = Convert.ToString(Azonkod); } else { Szamlakod(); } }
private void kodszam(int rad) { int x = alap.Code(String.Format("Select Azonosito from Alkalmazott_reg where Azonosito = {0}", rad)); switch (x) { case 0: Kodszam_text.Text = Convert.ToString(rad); break; default: object sender = new object(); EventArgs e = new EventArgs(); Radbutton_CheckedChanged(sender, e); break; } /* if (x == 0) { Kodszam_text.Text = Convert.ToString(rad); } //Switch * else * { * object sender = new object(); * EventArgs e = new EventArgs(); * Radbutton_CheckedChanged(sender,e); * MessageBox.Show("Van már ilyen kód!"); * }*/ }