private void button3_Click(object sender, EventArgs e) { try { int flag = 0; int id = Convert.ToInt32(txt_cid.Text); int mno = Convert.ToInt32(txt_cmno.Text); class_customer ss = new class_customer(); flag = ss.update(txt_cfnme.Text, txt_cmnme.Text, txt_clnme.Text, txt_add1.Text, txt_add2.Text, txt_add3.Text, mno, txt_cemail.Text, id); if (flag > 0) { // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier(); popup.Image = Properties.Resources.Information_Bubble_48; popup.ContentText = "Success"; // popup.BodyColor.ToString(); popup.Popup(); } else { MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception) { MessageBox.Show("Error"); } toClearText(); }
private void button4_Click(object sender, EventArgs e) { try { int flag = 0; int id = Convert.ToInt32(txt_cid.Text); class_customer cs = new class_customer(); flag = cs.delete(id); if (flag > 0) { // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier(); popup.Image = Properties.Resources.Information_Bubble_48; popup.ContentText = "Success"; // popup.BodyColor.ToString(); popup.Popup(); } else { MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } setDataGride2(); } catch (Exception) { MessageBox.Show("Error"); } toClearText(); }
private void button2_Click(object sender, EventArgs e) { try { if (txt_cfnme.Text.Length > 0) { errorProvider1.Clear(); if (txt_cmnme.Text.Length > 0) { if (txt_clnme.Text.Length > 0) { errorProvider3.Clear(); if (txt_add1.Text.Length > 0) { errorProvider4.Clear(); if (txt_add2.Text.Length > 0) { errorProvider5.Clear(); if (txt_add3.Text.Length > 0) { errorProvider6.Clear(); if (txt_cmno.Text.Length != 10) { errorProvider7.Clear(); if (txt_cemail.Text.Length > 0) { errorProvider8.Clear(); } else { errorProvider8.SetError(txt_cemail, "You should fiil required data"); } } else { errorProvider7.SetError(txt_cmno, "You should fiil required data"); } } else { errorProvider6.SetError(txt_add3, "You should fiil required data"); } } else { errorProvider5.SetError(txt_add2, "You should fiil required data"); } } else { errorProvider4.SetError(txt_add1, "You should fiil required data"); } } else { errorProvider3.SetError(txt_clnme, "You should fiil required data"); } } else { errorProvider2.SetError(txt_cmnme, "You should fiil required data"); } } else { errorProvider1.SetError(txt_cfnme, "You should fiil required data"); } int flag = 0; int mno = Convert.ToInt32(txt_cmno.Text); class_customer ss = new class_customer(); flag = ss.add(txt_cfnme.Text, txt_cmnme.Text, txt_clnme.Text, txt_add1.Text, txt_add2.Text, txt_add3.Text, mno, txt_cemail.Text); if (flag > 0) { // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier(); popup.Image = Properties.Resources.Information_Bubble_48; popup.ContentText = "Success"; // popup.BodyColor.ToString(); popup.Popup(); } else { MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } setDataGride(); } catch (Exception) { MessageBox.Show("Error"); } toClearText(); }