//Flower delete
        private void xuiSuperButton4_Click(object sender, EventArgs e)
        {
            try
            {
                //value passs to business layer Logclass variable to
                FlowerClass obj = new FlowerClass();
                //check text box empty or not
                if (textBoxFlowerCode.Text != "")
                {
                    obj.flowerId = textBoxFlowerCode.Text;


                    //  ExecuteNonQuery() if worked return value=truee return value=0 CtegoryClass in BusinessLayer
                    if (obj.flowerDelete() == 1)
                    {
                        String x;
                        x = obj.flowerId;

                        MessageBox.Show("---Deleted Flower---" + x);
                    }
                    else
                    {
                        MessageBox.Show("---Can not  Delete Flower  !---");
                    }
                }
                else
                {
                    MessageBox.Show("---please enter values !---");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("---ERROR IN SQL CONNECTION---" + '\n' + ex);
            }
        }
        public void Generate(Enum.Itemtype item)
        {
            switch (item)
            {
            case Enum.Itemtype.Star:
                IItem star = new StarClass(Mygame, new Vector2(rectangle.X, rectangle.Y));
                Mygame.World.AddItem(star);
                break;

            case Enum.Itemtype.GreenMushroom:
                IItem GreenMushroom = new GreenMushroomClass(Mygame, new Vector2(rectangle.X, rectangle.Y));
                Mygame.World.AddItem(GreenMushroom);
                break;

            case Enum.Itemtype.RedMushroom:
                IItem RedMushroom = new RedMushroomClass(Mygame, new Vector2(rectangle.X, rectangle.Y));
                Mygame.World.AddItem(RedMushroom);
                break;

            case Enum.Itemtype.Coin:
                IItem Coin = new CoinClass(Mygame, new Vector2(rectangle.X, rectangle.Y));
                Mygame.World.AddItem(Coin);
                break;

            case Enum.Itemtype.Flower:
                IItem Flower = new FlowerClass(Mygame, new Vector2(rectangle.X, rectangle.Y));
                Mygame.World.AddItem(Flower);
                break;
            }
            this.ItemNumber--;
        }
 //Flower table refresh Dtabase Table Data
 private void RefreshFlower_Click(object sender, EventArgs e)
 {
     try
     {
         FlowerClass oobj = new FlowerClass();
         //Datas Set obj put to the Dtaview grid auto rende all the colums and values.
         ///you dont create custom table colums in Data grid grid
         //variable of data grid view+daat source
         dataGridViewFlower.DataSource = oobj.flowerViewAll().Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        //flower search butoon
        private void flowerSearchBtn_Click(object sender, EventArgs e)
        {
            try
            {
                //value passs to business layer Logclass variable to
                FlowerClass obj = new FlowerClass();

                //check text box empty or not
                if (textBoxFlowerCode.Text != "")
                {
                    //set value to search
                    obj.flowerId = textBoxFlowerCode.Text;
                    //obj.CategoryName = textBox2.Text;

                    //  ExecuteNonQuery() if worked return value=truee return value=0 CtegoryClass in BusinessLayer
                    if (obj.flowerSearch() == 1)
                    {
                        //out put values
                        textBoxFlowerCode.Text     = obj.flowerId;
                        textBoxFlowerName.Text     = obj.flowerName;
                        textBoxFlowerPriceOne.Text = obj.flowerPriceone;
                        textBoxFlowerQuentity.Text = obj.flowerQuentity;
                        //CategoryFbox.Text = obj.flowerCategory;
                        richTextBoxFlowerDiscription.Text = obj.flowerDescription;



                        //Bitmap Imag = obj.flowerSearch();
                        //pictureBoxFlower.Image = Imag;
                    }
                    else
                    {
                        MessageBox.Show("---Can not  Search category  !---");
                    }
                }
                else
                {
                    MessageBox.Show("---please enter values !---");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("---ERROR IN SQL CONNECTION---" + '\n' + ex);
            }
        }
        //Flower ADD
        private void xuiSuperButton5_Click(object sender, EventArgs e)
        {
            try
            {
                //value passs to business layer Logclass variable to
                FlowerClass obj = new FlowerClass();
                //check text box empty or not
                if ((textBoxFlowerCode.Text != "") && (textBoxFlowerName.Text != "") && (textBoxFlowerPriceOne.Text != ""))
                {
                    obj.flowerId       = textBoxFlowerCode.Text;
                    obj.flowerName     = textBoxFlowerName.Text;
                    obj.flowerPriceone = textBoxFlowerPriceOne.Text;;
                    obj.flowerQuentity = textBoxFlowerQuentity.Text;
                    //  obj.flowerCategory = "category";
                    obj.flowerDescription = richTextBoxFlowerDiscription.Text;
                    obj.flowerCategory    = flowerCombo.SelectedItem.ToString();

                    Image          img = pictureBoxFlower.Image;
                    byte[]         arr;
                    ImageConverter converter = new ImageConverter();
                    arr = (byte[])converter.ConvertTo(img, typeof(byte[]));

                    obj.flowerImageFile = arr;


                    //  ExecuteNonQuery() if worked return value=truee return value=0 CtegoryClass in BusinessLayer
                    if (obj.flowerAdd() == 1)
                    {
                        MessageBox.Show("---Added new Flower---" + obj.flowerName);
                    }
                    else
                    {
                        MessageBox.Show("---Can not Add same Flower name again !---");
                    }
                }
                else
                {
                    MessageBox.Show("---please enter values !---");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("---ERROR IN SQL CONNECTION---" + '\n' + ex);
            }
        }
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            Response.Redirect("Order.aspx");//move to the next link i.e Order.aspx

            try
            {
                //value passs to business layer Logclass variable to
                FlowerClass obj = new FlowerClass();

                //check text box empty or not
                if (flowerOrderTxt.Text != "")
                {
                    //set value to search
                    obj.flowerId = flowerOrderTxt.Text;


                    //  ExecuteNonQuery() if worked return value=truee return value=0 CtegoryClass in BusinessLayer
                    if (obj.flowerSearch() == 1)
                    {
                        //out put values
                        fcode     = obj.flowerId;
                        fname     = obj.flowerName;
                        fprice    = obj.flowerPriceone;
                        fqentity  = obj.flowerQuentity;
                        fcategory = obj.flowerCategory;

                        //Bitmap Imag = obj.flowerSearch();
                        //pictureBoxFlower.Image = Imag;
                    }
                    else
                    {
                    }
                }
                else
                {
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }