private void Button_Click(object sender, RoutedEventArgs e) { try { //button for creating new employee string Address; TBikeDAL MyDal = new TBikeDAL(); //String Builder StringBuilder striBuild = new StringBuilder(); striBuild.AppendLine(TBAddress1.Text); striBuild.AppendLine(TBAddress2.Text); striBuild.AppendLine(TBAddress3.Text); striBuild.Append(TBCity.Text); striBuild.Append(" , " + TBZipCode.Text); Address = striBuild.ToString().Trim(); MyDal.AddNewEmployeeDetails(TBEmpName.Text, DOBText.SelectedDate.Value.Date, TBEmail.Text, TBPhoneNo.Text, Address, "Tommy"); CreateNewUser emp = new CreateNewUser(); this.Close(); emp.PopulateDataFromLogin(username); emp.Show(); PopWindow pop = new PopWindow(ImageType.Information, "Congratulations", "Create New User Success!!!", "OK"); } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", ex.Message, "OK"); pop.ShowDialog(); } }
private void Add_Click(object sender, RoutedEventArgs e) { if (RankID >= 3) { CreateNewUser newer = new CreateNewUser(); newer.PopulateDataFromLogin(username); newer.Show(); this.Close(); } else { PopWindow pop = new PopWindow(ImageType.Error, "Error", "You are not authorised to use this process","OK"); } }
private async void create_Click(object sender, RoutedEventArgs e) { Notification(); if (RankID <= 2) { var res = await this.ShowMessageAsync("Error", "You have no access to this current Service"); } else { Framework.Visibility = Visibility.Visible; CreateNewUser emp = new CreateNewUser(); emp.PopulateDataFromLogin(username); Framework.Content = emp.Content; } }