public Update(walangforeverRestaurant.Domain.Model.Category category, Category.List sender)
 {
     InitializeComponent();
     this.txtboxName.Text = category.Name;
     this._category       = category;
     this._sender         = sender;
 }
        private void btnUpdate_Click_1(object sender, RoutedEventArgs e)
        {
            if (Validate() == false)
            {
                return;
            }

            if (CategoryBLL.GetDuplicateName(txtboxName.Text, this._category.Id) != null)
            {
                MessageBox.Show("Categoryname is already used");
            }
            else
            {
                walangforeverRestaurant.Domain.Model.Category category = new walangforeverRestaurant.Domain.Model.Category();
                category.Id   = Guid.NewGuid();
                category.Name = txtboxName.Text;



                category.Id = this._category.Id;
                CategoryBLL.Update(category);
                MessageBox.Show("User successfully Updated.");
                this._sender.showList();
                this.Close();
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (Validate() == false)
            {
                return;
            }

            if (CategoryBLL.GetCategoryByName(txtboxName.Text) != null)
            {
                MessageBox.Show("Categoryname is already used");
            }
            else
            {
                walangforeverRestaurant.Domain.Model.Category category = new walangforeverRestaurant.Domain.Model.Category();
                category.Id       = Guid.NewGuid();
                category.ParentId = this._sender.parentId;
                category.Name     = txtboxName.Text;


                MessageBox.Show("CategoryName successfully created.");
                CategoryBLL.Create(category);
                this._sender.showList();
                this.Close();
            }
        }