private void addUserBtn_Click(object sender, RoutedEventArgs e) { if (checkDetailsAddTab() == "") { IJSService client = new JSServiceClient(); PopulateUser populate = new PopulateUser(); List <DbUser> userList = populate.GetUserList(this); int streamId = streamCombox.SelectedIndex + 1; //firstnameTxtbox.Text = userList.ToString(); if (client.InsertUser(userList, streamId)) { //ClearFields clear = new ClearFields(); //clear.ClearNewJob(this); // dgRecentJobs.Items.Refresh(); MessageBox.Show("User " + userList[0].Username + " has been added", "New User", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Adding User failed. Please fill all the fields", "NewUser", MessageBoxButton.OK, MessageBoxImage.Error); } } else { InfoLbl.Content = checkDetailsAddTab(); InfoLbl.Visibility = Visibility.Visible; } // client.Close(); }
private void addUserBtn_Click(object sender, RoutedEventArgs e) { if (checkDetailsAddTab() == "") { IJSService client = new JSServiceClient(); PopulateUser populate = new PopulateUser(); List<DbUser> userList = populate.GetUserList(this); int streamId = streamCombox.SelectedIndex + 1; //firstnameTxtbox.Text = userList.ToString(); if (client.InsertUser(userList, streamId)) { //ClearFields clear = new ClearFields(); //clear.ClearNewJob(this); // dgRecentJobs.Items.Refresh(); MessageBox.Show("User " + userList[0].Username + " has been added", "New User", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Adding User failed. Please fill all the fields", "NewUser", MessageBoxButton.OK, MessageBoxImage.Error); } } else { InfoLbl.Content = checkDetailsAddTab(); InfoLbl.Visibility = Visibility.Visible; } // client.Close(); }
private void addUserBtn_Click(object sender, RoutedEventArgs e) { if (checkDetailsAddTab() == "") { InfoLbl.Visibility = Visibility.Hidden; PopulateUser populate = new PopulateUser(); List <DbUser> userList = populate.GetUserList(this); int streamId = 0; if (userList[0].TypeId == 2) { streamId = streamCombox.SelectedIndex + 1; } if (client.InsertUser(userList, streamId)) { var result = MessageBox.Show("User " + userList[0].Username + " has been added", "New User", MessageBoxButton.OK, MessageBoxImage.Information); if (result == MessageBoxResult.OK) { clearAddUserDetails(); autoFillUserName.Add(userList[0].Username); } } else { MessageBox.Show("Adding user failed. Please try again", "New User", MessageBoxButton.OK, MessageBoxImage.Error); } } else { InfoLbl.Content = checkDetailsAddTab(); InfoLbl.Visibility = Visibility.Visible; } }
private void addUserBtn_Click(object sender, RoutedEventArgs e) { if (checkDetailsAddTab() == "") { InfoLbl.Visibility = Visibility.Hidden; PopulateUser populate = new PopulateUser(); List<DbUser> userList = populate.GetUserList(this); int streamId = 0; if (userList[0].TypeId == 2) { streamId = streamCombox.SelectedIndex + 1; } if (client.InsertUser(userList, streamId)) { var result = MessageBox.Show("User " + userList[0].Username + " has been added", "New User", MessageBoxButton.OK, MessageBoxImage.Information); if (result == MessageBoxResult.OK) { clearAddUserDetails(); autoFillUserName.Add(userList[0].Username); } } else { MessageBox.Show("Adding user failed. Please try again", "New User", MessageBoxButton.OK, MessageBoxImage.Error); } } else { InfoLbl.Content = checkDetailsAddTab(); InfoLbl.Visibility = Visibility.Visible; } }