private void SaveButton_Click(object sender, EventArgs e) { Item item = new Item(); string cat = CategoryComboBox.SelectedItem.ToString(); string com = CompanyComboBox.SelectedItem.ToString(); if (!String.IsNullOrEmpty(nameTextBox.Text) && !String.IsNullOrEmpty(cat) && !String.IsNullOrEmpty(com)) { item.CategoryId = categoryBll.GetCategoryByName(cat).Id; item.CompanyId = companyBll.GetCompanyByName(com).Id; item.Name = nameTextBox.Text; item.ReorderLebel = Convert.ToInt32(reorderLablelTextBox.Text); if (itemBll.AddItem(item)) { MessageBox.Show("Item created successfully..."); } else { MessageBox.Show("Item Creation failed..."); } } else { MessageBox.Show("Please fill the fields properly..."); } }