private void add_btn_Click(object sender, EventArgs e) { /*if (avail_lbl.Text != "Available") * { * MessageBox.Show("දහම්පාසල් අංකය පරික්ෂා කර බලන්න!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); * } * else*/ if (!(mobphone_txtbox.TextLength == 10 || mobphone_txtbox.TextLength == 0)) { MessageBox.Show("ජංගම දුරකථන අංකය පරික්ෂා කර බලන්න!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (!(landphone_txtbox.TextLength == 10 || landphone_txtbox.TextLength == 0)) { MessageBox.Show("ස්ථාවර දුරකථන අංකය පරික්ෂා කර බලන්න!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MySqlCommand cmd1 = new MySqlCommand("delete from dahampasaltable where Name='" + selectedID + "';", SqlCon.con); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = SqlCon.con; cmd.CommandText = "INSERT INTO `dahampasaltable`(`Name`, `Telephone_Mobile`, `Telephone_Home`) VALUES ('" + dhmpslName_txtbox.Text.ToString() + "','" + mobphone_txtbox.Text + "','" + landphone_txtbox.Text + "'); "; SqlCon.con.Open(); cmd1.ExecuteNonQuery(); cmd.ExecuteNonQuery(); SqlCon.con.Close(); MessageBox.Show("දත්ත ඇතුලත් කරන ලදී!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); ViewDahamPasalList.getInstance().updateDatagridview(); //dhmpasalNo_nud.ResetText(); dhmpslName_txtbox.ResetText(); mobphone_txtbox.ResetText(); landphone_txtbox.ResetText(); this.Close(); } }
private void ලකනයToolStripMenuItem_Click(object sender, EventArgs e) { ViewDahamPasalList dpl = ViewDahamPasalList.getInstance(); dpl.MdiParent = this; dpl.Show(); dpl.WindowState = FormWindowState.Maximized; dpl.FormBorderStyle = FormBorderStyle.FixedSingle; }
public static ViewDahamPasalList getInstance() { if (inst3 == null || inst3.IsDisposed) { inst3 = new ViewDahamPasalList(); return(inst3); } else { return(inst3); } }
private void edit_dahampasala_FormClosed(object sender, FormClosedEventArgs e) { ViewDahamPasalList vdl = ViewDahamPasalList.getInstance(); vdl.Enabled = true; }