public bool addTaiKhoan(TaiKhoan tk) { String Sql = "INSERT INTO taikhoan(username,passwords,fullname,loai) VALUES(@username,@password,@fullname,@loai)"; SqlConnection conn = DBConnection.Instance.getConnection(); try { cmd = new SqlCommand(Sql, conn); conn.Open(); cmd.Parameters.Add("@username", SqlDbType.NVarChar).Value = tk.getUsername(); cmd.Parameters.Add("@password", SqlDbType.NVarChar).Value = tk.getPasswords(); cmd.Parameters.Add("@fullname", SqlDbType.NVarChar).Value = tk.getFullname(); cmd.Parameters.Add("@loai", SqlDbType.NVarChar).Value = tk.getLoai(); cmd.ExecuteNonQuery(); conn.Close(); }catch (Exception e) { return(false); } return(true); }