public List<customer> login(string salesmanname, string usercode) { List<customer> customers = new List<customer>(); con.Open(); using (SqlCommand cmd = new SqlCommand("Select Id, CompanyRefId from SalesMan where salesmanname=@salesmanname and code=@usercode", con)) { cmd.Parameters.AddWithValue("@salesmanname", salesmanname); cmd.Parameters.AddWithValue("@usercode", usercode); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { customer c1 = new customer(); c1.id = (int)reader["Id"]; c1.companyrefid = (Guid)reader["CompanyRefId"]; customers.Add(c1); } return customers; } } }
string username = salesmannames.SelectedItem.ToString(); string password = textBox1.Text.ToString(); proxy.loginAsync(username, password); proxy.loginCompleted += new EventHandler<loginCompletedEventArgs>(loginfn); void loginfn(object sender, loginCompletedEventArgs e) { if (e.Result != null) { customer ad = new customer(); NavigationService.Navigate(new Uri("/customernames.xaml", UriKind.Relative)); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)