Example #1
0
        private void LoadExistingData()
        {
            CCategoryManager oManager = new CCategoryManager();

            CResult    oResult            = oManager.GetCategory4(m_selectionItemCategoryID);
            CCategory4 objSelectionOfItem = new CCategory4();

            if (oResult.IsSuccess && oResult.Data != null)
            {
                objSelectionOfItem = (CCategory4)oResult.Data;
                txtItemName.Text   = objSelectionOfItem.Category4Name;
                txtOrder.Text      = objSelectionOfItem.Category4Order.ToString();

                m_selectionItemOrder = objSelectionOfItem.Category4Order;

                txtDescription.Text     = objSelectionOfItem.Category4Description;
                txtTablePrice.Text      = objSelectionOfItem.Category4TablePrice.ToString("F02");
                txtTakeawayPrice.Text   = objSelectionOfItem.Category4TakeAwayPrice.ToString("F02");
                txtBarPrice.Text        = objSelectionOfItem.Category4BarPrice.ToString("F02");
                txtVateRate.Text        = objSelectionOfItem.vatRate.ToString();
                chkVateIncluded.Checked = objSelectionOfItem.vatIncluded;

                if (objSelectionOfItem.UnlimitStatus > 0)
                {
                    chkunlimited.Checked = true;
                    txtInitialQuantity.Clear();
                }
                else
                {
                    txtInitialQuantity.Text = objSelectionOfItem.InitialItemQuantity.ToString();
                }

                m_iRank = objSelectionOfItem.Rank;


                if (objSelectionOfItem.Category4ViewTable == 1)
                {
                    chkTable.Checked = true;
                }
                if (objSelectionOfItem.Category4ViewBar == 1)
                {
                    chkBar.Checked = true;
                }
                if (objSelectionOfItem.Category4ViewTakeAway == 1)
                {
                    chkTakeAway.Checked = true;
                }
            }

            oResult = oManager.GetCategoryAncestors(m_selectionItemCategoryID, 4);


            if (oResult.IsSuccess && oResult.Data != null)
            {
                CCategoryAncestor oCatAnc = (CCategoryAncestor)oResult.Data;

                int tmpCat4ID      = oCatAnc.Category4ID;
                int tmpCat3ID      = oCatAnc.Category3ID;
                int tmpCat2ID      = oCatAnc.Category2ID;
                int tmpCat1ID      = oCatAnc.Category1ID;
                int tmpParentCatID = oCatAnc.ParentCategoryID;

                CComboBoxItem oItem1 = new CComboBoxItem(1, "Active");

                CComboBoxItem oItem2 = new CComboBoxItem(0, "InActive");


                if (objSelectionOfItem.Category4OrderStatus == 1)
                {
                    rdoActive.Checked = true;
                }
                else if (objSelectionOfItem.Category4OrderStatus == 0)
                {
                    rdoInactive.Checked = true;
                }
                cmbParent.SelectedValue   = tmpParentCatID;
                cmbFoodType.SelectedValue = tmpCat1ID;
                cmbCategory.SelectedValue = tmpCat2ID;
                cmbFoodItem.SelectedValue = tmpCat3ID;
            }
        }