Ejemplo n.º 1
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            //get typed informactions
            string workid = tb_workid.Text.Trim();
            string pass   = tb_password.Text;
            //validation

            string         sql = "SELECT * FROM SPORT_SHOP.Funcionario WHERE work_ID =" + workid + "AND [password] = '" + pass + "'";
            SqlDataAdapter da  = null;
            DataTable      dt  = new DataTable();
            var            cmd = cn.CreateCommand();

            try
            {
                cmd.CommandText = sql;
                da = new SqlDataAdapter(cmd.CommandText, cn);
                da.Fill(dt);
            }
            catch (Exception ex)
            {
            }

            if (dt.Rows.Count == 1)
            {
                cn.Close();
                F_main f_main = new F_main(this, workid);
                f_main.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Login ou Senha incorretos");
            }
        }
Ejemplo n.º 2
0
 public F_clientes(F_main f)
 {
     InitializeComponent();
     f_main = f;
 }
Ejemplo n.º 3
0
 public F_funcionarios(F_main f)
 {
     InitializeComponent();
     f_main = f;
 }
Ejemplo n.º 4
0
 public F_financas(F_main f)
 {
     InitializeComponent();
     f_main = f;
 }
Ejemplo n.º 5
0
 public F_produtos(F_main f)
 {
     InitializeComponent();
     f_main = f;
 }