Пример #1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (progressBar_splsh.Value < 100)
     {
         progressBar_splsh.Value = progressBar_splsh.Value + 4;
     }
     else
     {
         String         emty    = "SELECT*FROM tbl_Admin_Accounts";
         SqlDataAdapter iigemty = new SqlDataAdapter(emty, ConnectionDB.Connection());
         DataTable      iemty   = new DataTable();
         iigemty.Fill(iemty);
         if (0 != iemty.Rows.Count) // does not exist
         {
             timer_splh.Enabled = false;
             Log_main start = new Log_main();
             start.Show();
             this.Visible = false;
         }
         else
         {
             timer_splh.Enabled = false;
             Main_account start = new Main_account();
             start.Show();
             Main_account.tx_unmmee.Focus();
             this.Visible = false;
         }
     }
 }
Пример #2
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(txt_User_Name, "");
            errorProvider2.SetError(txt_Password, "");
            errorProvider3.SetError(txt_Con_Password, "");
            errorProvider4.SetError(cbx_security_q, "");
            errorProvider5.SetError(txt_Sec_q_Ans, "");


            if (txt_User_Name.Text != "" && txt_Password.Text != "" && txt_Sec_q_Ans.Text != "" && cbx_security_q.Text != "")
            {
                if (txt_Password.Text == txt_Con_Password.Text)
                {
                    user_op.Insert_Onwer_Acc(txt_User_Name.Text, txt_Password.Text, txt_Con_Password.Text, cbx_security_q.Text, txt_Sec_q_Ans.Text);
                    if (MessageBox.Show("Owner Account Created Sucessfuly", "Sharp Creation", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
                    {
                        accCreat     = true;
                        this.Visible = false;
                        Log_main logg = new Log_main();
                        logg.Show();
                    }
                }
                else
                {
                    toolTip1.Show("Passwords does not Match", btn_OK);
                    errorProvider2.SetError(txt_Password, "Passwords does not Match Password");
                    errorProvider3.SetError(txt_Con_Password, "Passwords does not Match Password");
                }
            }
            else
            {
                if (txt_User_Name.Text == "")
                {
                    errorProvider1.SetError(txt_User_Name, "Enter Owner Name");
                }
                if (txt_Password.Text == "")
                {
                    errorProvider2.SetError(txt_Password, "Enter Password");
                }
                if (txt_Con_Password.Text == "")
                {
                    errorProvider3.SetError(txt_Con_Password, "Conform Password");
                }
                if (cbx_security_q.Text == "")
                {
                    errorProvider4.SetError(cbx_security_q, "Chosse Question");
                }
                if (txt_Sec_q_Ans.Text == "")
                {
                    errorProvider5.SetError(txt_Sec_q_Ans, "Enter Awnser ");
                }
            }
        }