Example #1
0
        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();
            }
        }