Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.txtBox_ItemName.Text.Trim() == "")
            {
                MessageBox.Show("Please insert 'Item Name' ", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtBox_ItemName.Focus();
            }
            else if (this.txtBox_Quantity.Text.Trim() == "")
            {
                MessageBox.Show("Please insert 'Quantity' ", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtBox_Quantity.Focus();
            }
            else
            {
                if (editMode == true)
                {
                    dao.EditItem(GetTxtBoxData(), itm);
                }
                else
                {
                    dao.AddNewItem(GetTxtBoxData());
                }

                this.Close();
            }
        }