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"); } }
public F_clientes(F_main f) { InitializeComponent(); f_main = f; }
public F_funcionarios(F_main f) { InitializeComponent(); f_main = f; }
public F_financas(F_main f) { InitializeComponent(); f_main = f; }
public F_produtos(F_main f) { InitializeComponent(); f_main = f; }