Ejemplo n.º 1
0
        private void button9_Click(object sender, EventArgs e)
        {
            try
            {
                int            flag = 0;
                int            id   = Convert.ToInt32(txt_sid.Text);
                class_supplier cs   = new class_supplier();
                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");
            }
            toClearTextField_sup();
        }
Ejemplo n.º 2
0
        private void button7_Click(object sender, EventArgs e)
        {
            try
            {
                if (txt_sfnme.Text.Length > 0)
                {
                    errorProvider1.Clear();

                    errorProvider3.Clear();
                    if (txt_sadd1.Text.Length > 0)
                    {
                        errorProvider4.Clear();
                        if (txt_sadd2.Text.Length > 0)
                        {
                            errorProvider5.Clear();
                            if (txt_sadd3.Text.Length > 0)
                            {
                                errorProvider6.Clear();
                                if (txt_smno.Text.Length != 0)
                                {
                                    errorProvider7.Clear();
                                    if (txt_semail.Text.Length > 0)
                                    {
                                        errorProvider8.Clear();
                                        if (txt_c_nme.Text.Length > 0)
                                        {
                                            errorProvider2.Clear();
                                        }
                                        else
                                        {
                                            errorProvider2.SetError(txt_c_nme, "You should fiil  required data");
                                        }
                                    }
                                    else
                                    {
                                        errorProvider8.SetError(txt_semail, "You should fiil  required data");
                                    }
                                }
                                else
                                {
                                    errorProvider7.SetError(txt_smno, "You should fiil  required data");
                                }
                            }
                            else
                            {
                                errorProvider6.SetError(txt_sadd3, "You should fiil  required data");
                            }
                        }
                        else
                        {
                            errorProvider5.SetError(txt_sadd2, "You should fiil  required data");
                        }
                    }
                    else
                    {
                        errorProvider4.SetError(txt_sadd1, "You should fiil  required data");
                    }
                }
                else
                {
                    errorProvider1.SetError(txt_sfnme, "You should fiil  required data");
                }

                int flag = 0;
                int mno  = Convert.ToInt32(txt_smno.Text);

                class_supplier ss = new class_supplier();

                flag = ss.add(txt_sfnme.Text, txt_sadd1.Text, txt_sadd2.Text, txt_sadd3.Text, mno, txt_semail.Text, txt_c_nme.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);
                }

                setDataGride2();
            }
            catch (Exception)
            {
            }
            toClearTextField_sup();
        }