private void button1_Click(object sender, EventArgs e)
        {
            // string type = comboBox1.SelectedIndex.ToString();
            string un  = txt_un.Text;
            string pwd = txt_pwd.Text;
            string cnf = txt_cpwd.Text;

            if (txt_un.Text.Length > 0)
            {
                errorProvider3.Clear();
                if (txt_pwd.Text.Length > 0)
                {
                    errorProvider1.Clear();
                    if (txt_cpwd.Text.Length > 0)
                    {
                        errorProvider1.Clear();
                    }
                    else
                    {
                        errorProvider1.SetError(txt_un, "Required");
                    }
                }
                else
                {
                    errorProvider1.SetError(txt_cpwd, "Requierd");
                }
            }
            else
            {
                errorProvider3.SetError(txt_un, "Requierd");
            }
            int flag = 0;

            if (pwd == cnf)
            {
                errorProvider1.Clear();
                class_user u = new class_user();

                flag = u.add(un, pwd);
            }
            else
            {
                errorProvider1.SetError(txt_pwd, "Password not matching");
            }


            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);
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            int ff = 0;

            if (p.Text == cp.Text)
            {
                class_user h = new class_user();
                ff = h.updt_pwd(u.Text, p.Text);
                if (ff > 0)
                {
                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                    popup.Image       = Properties.Resources.Information_Bubble_48;
                    popup.ContentText = "Success";
                    // popup.BodyColor.ToString();
                    popup.Popup();
                }
                else
                {
                    MessageBox.Show("Error ", "Error Window", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Both Password Should be same ", "Error Window", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void button3_Click(object sender, EventArgs e)
 {
     if (txt_siz.Text.Length > 0)
     {
         errorProvider1.Clear();
         if (txt_clr.Text.Length > 0)
         {
             errorProvider3.Clear();
             if (txt_cat.Text.Length > 0)
             {
                 errorProvider1.Clear();
                 if (txt_mat.Text.Length > 0)
                 {
                     errorProvider1.Clear();
                     class_user u    = new class_user();
                     int        flag = 0;
                     flag = u.add(txt_cat.Text, txt_mat.Text, txt_clr.Text, txt_siz.Text);
                     setDataGride2();
                     clear();
                     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);
                     }
                 }
                 else
                 {
                     errorProvider1.SetError(txt_mat, "Required");
                 }
             }
             else
             {
                 errorProvider1.SetError(txt_cat, "Requierd");
             }
         }
         else
         {
             errorProvider3.SetError(txt_clr, "Requierd");
         }
     }
     else
     {
         errorProvider1.SetError(txt_siz, "Required");
     }
 }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            int        fg = 0;
            class_user h  = new class_user();

            fg = h.login(txt_un.Text, txt_pwd.Text);

            if (fg == 1)
            {
                frm_da hd = new frm_da();
                hd.ShowDialog();
                LOGDATA hhh = new LOGDATA();
                hhh.logsave(txt_un.Text);

                this.Hide();
            }
            else
            {
                MessageBox.Show("invalid pwd");
            }
        }
        private void button4_Click(object sender, EventArgs e)
        {
            int        id   = Convert.ToInt32(txt_ino.Text);
            int        flag = 0;
            class_user u    = new class_user();

            flag = u.delete(id);
            setDataGride2();
            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);
            }
        }