private void SaveSelfOrder(object sender, EventArgs e)
        {
            try
            {
                SelfOrder selfOrder = new SelfOrder();
                selfOrder.BName = booknameTextbox.Text;
                selfOrder.BWriter = writernameTextbox.Text;
                selfOrder.BEdition = editionTextbox.Text;
                selfOrder.Quantity = Convert.ToInt16(quantityTextbox.Text);
                if (selfOrder.BName.Equals(""))
                {
                    MessageBox.Show("Enter the Book name.","Message",MessageBoxButtons.OK,MessageBoxIcon.Warning);

                }
                else if(selfOrder.BWriter.Equals(""))
                {
                    MessageBox.Show("Enter the writer name.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);  
                }
                else if (selfOrder.BEdition.Equals(""))
                {
                    MessageBox.Show("Enter the book edition.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    SelfOrderGateway gateway = new SelfOrderGateway();

                    gateway.SaveSelfOrder(selfOrder);
                }
                
            }
            catch (FormatException)
            {
                
                
            }


        }
        private void SaveSelfOrder(object sender, EventArgs e)
        {
            try
            {
                SelfOrder selfOrder = new SelfOrder();
                selfOrder.BName = booknameTextbox.Text;
                selfOrder.BWriter = writernameTextbox.Text;
                selfOrder.BEdition = editionTextbox.Text;
                selfOrder.BType = typeTextBox.Text;
                selfOrder.BPrint = printTexBox.Text;
                selfOrder.Quantity = Convert.ToInt16(quantityTextbox.Text);
                selfOrder.MemoNo = memoNumver;
                if (selfOrder.BName.Equals(""))
                {
                    MessageBox.Show("Enter the Book name.","Message",MessageBoxButtons.OK,MessageBoxIcon.Warning);

                }
                else if(selfOrder.BWriter.Equals(""))
                {
                    MessageBox.Show("Enter the writer name.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);  
                }
                else if (selfOrder.BEdition.Equals(""))
                {
                    MessageBox.Show("Enter the book edition.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    SelfOrderGateway gateway = new SelfOrderGateway();

                    gateway.SaveSelfOrder(selfOrder);
                }
                
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 
                
            }


        }