Exemplo n.º 1
0
        //User Category
        private void btn_Category_Add_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Category newCat = new Category();

                newCat.CategoryId          = Convert.ToInt32(textBox_Category_ID.Text);
                newCat.CategoryName        = textBox_Category_Name.Text;
                newCat.CategoryDescription = textBox_Category_Description.Text;

                int rowsAffected = Category_BL.AddCategory_BL(newCat);
                if (rowsAffected > 0)
                {
                    MessageBox.Show("Category Added !!");
                }
                else
                {
                    MessageBox.Show("Error!!! Category Record not Added");
                }
            }
            catch (HRMSException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }