private void button2_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show(Classone.echo_darshi("er_1001"), "Please Confirm", MessageBoxButtons.YesNo); string conn_t0 = "Data Source=" + textBox4.Text.ToString() + ";Initial Catalog=" + textBox5.Text.ToString() + ";Persist Security Info=True;User ID=" + textBox2.Text.ToString() + ";Password="******""; switch (dr) { case DialogResult.Yes: Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath); config.AppSettings.Settings.Remove("Port"); config.AppSettings.Settings.Add("Port", textBox1.Text.ToString()); config.AppSettings.Settings.Remove("Port2"); config.AppSettings.Settings.Add("Port2", textBox18.Text.ToString()); config.AppSettings.Settings.Remove("username"); config.AppSettings.Settings.Add("username", textBox2.Text.ToString()); config.AppSettings.Settings.Remove("password"); config.AppSettings.Settings.Add("password", textBox3.Text.ToString()); config.AppSettings.Settings.Remove("serverurl"); config.AppSettings.Settings.Add("serverurl", textBox4.Text.ToString()); config.AppSettings.Settings.Remove("database"); config.AppSettings.Settings.Add("database", textBox5.Text.ToString()); config.AppSettings.Settings.Remove("timeout"); config.AppSettings.Settings.Add("timeout", textBox6.Text.ToString()); config.AppSettings.Settings.Remove("language"); config.AppSettings.Settings.Add("language", textBox7.Text.ToString()); config.AppSettings.Settings.Remove("language_file"); config.AppSettings.Settings.Add("language_file", textBox8.Text.ToString()); config.AppSettings.Settings.Remove("data_folder"); config.AppSettings.Settings.Add("data_folder", textBox11.Text.ToString()); config.AppSettings.Settings.Remove("printer"); config.AppSettings.Settings.Add("printer", PrintCombo.Text.ToString()); config.AppSettings.Settings.Remove("conn"); config.AppSettings.Settings.Add("conn", conn_t0); config.Save(ConfigurationSaveMode.Modified); updateConfigFile(conn_t0); break; case DialogResult.No: break; } }
private bool validate_blance(string id) { Classone cls = new Classone(); double val = cls.check_bal(id); if (val > price) { return(true); } else { MessageBox.Show("Please Recharge Your Account"); return(false); } }
private bool validate(string id) { Classone cls = new Classone(); string UID = cls.rfid2system(id); //MessageBox.Show(UID + " - " + id); //validate using ucs if (UID.Substring(0, 3) == "UCS") { MessageBox.Show("This Proximity Card is Already in The System"); return(false); } else { return(true); } }
private bool validate(string idf) { Classone cls = new Classone(); string UID = cls.rfid2system(idf); //MessageBox.Show(UID + " - " + id); //validate using ucs if (UID.Substring(0, 3) == "UCS") { id = UID; this.Show(); return(true); } else { MessageBox.Show("Wrong user ID Sorry!"); return(false); } }