Example #1
0
        private void btnAddSelectionItems_Click(object sender, EventArgs e)
        {
            try
            {
                string sParentCategoryText = cmbParent.Text;
                string sFoodTypeText       = cmbFoodType.Text;
                string sCategoryText       = cmbCategory.Text;
                string sFoodItem           = cmbFoodItem.Text;

                AddSelectionItemCtl objAddFoodType = new AddSelectionItemCtl(sParentCategoryText, sFoodTypeText, sCategoryText, sFoodItem);
                objAddFoodType.Parent = this.ParentForm;
                UserControlManager.UserControls.Push(this);
                Panel pnl = (Panel)this.ParentForm.Controls["pnlContext"];

                string s = pnl.Name;

                objAddFoodType.ParentForm.Controls[s].Controls.Clear();
                objAddFoodType.ParentForm.Controls[s].Controls.Add(objAddFoodType);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
Example #2
0
        private void btnAddSelectionItems_Click(object sender, EventArgs e)
        {
            try
            {
                string sParentCategoryText = cmbParent.Text;
                string sFoodTypeText = cmbFoodType.Text;
                string sCategoryText = cmbCategory.Text;
                string sFoodItem = cmbFoodItem.Text;

                AddSelectionItemCtl objAddFoodType = new AddSelectionItemCtl(sParentCategoryText, sFoodTypeText, sCategoryText, sFoodItem);
                objAddFoodType.Parent = this.ParentForm;
                UserControlManager.UserControls.Push(this);
                Panel pnl = (Panel)this.ParentForm.Controls["pnlContext"];

                string s = pnl.Name;

                objAddFoodType.ParentForm.Controls[s].Controls.Clear();
                objAddFoodType.ParentForm.Controls[s].Controls.Add(objAddFoodType);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }