Example #1
0
        private void cmbCategoryType_DropDown(object sender, EventArgs e)
        {
            CComboBoxItem oItem1 = new CComboBoxItem(1, "Food");

            CComboBoxItem oItem2 = new CComboBoxItem(0, "Non Food");

            oItem2.Display = "Non Food";

            oItem2.Value = 0;

            cmbCategoryType.Items.Clear();

            cmbCategoryType.Items.Add(oItem1);

            cmbCategoryType.Items.Add(oItem2);

            cmbCategoryType.DisplayMember = "Display";

            cmbCategoryType.ValueMember = "Value";
        }
Example #2
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;
            }
        }
Example #3
0
        private void LoadExistingData()
        {
            CCategoryManager oManager = new CCategoryManager();

            CResult oResult = oManager.GetCategory2(m_categoryID);
            CCategory2 oCat = new CCategory2();

            if (oResult.IsSuccess && oResult.Data != null)
            {
                oCat = (CCategory2)oResult.Data;
                txtCategoryName.Text = oCat.Category2Name;
                txtCatOrder.Text = oCat.Category2Order.ToString();

                m_cattegoryOrder = oCat.Category2Order;

                txtColorName.Text = oCat.Category2Color.ToString();

                if (oCat.Category2ViewTable == 1)
                {
                    chkTable.Checked = true;
                }
                if (oCat.Category2ViewBar == 1)
                {
                    chkBar.Checked = true;
                }
                if (oCat.Category2ViewTakeAway == 1)
                {
                    chkTakeAway.Checked = true;
                }
            }

            oResult = oManager.GetCategoryAncestors(m_categoryID, 2);
            CCategoryAncestor oCatAnc = (CCategoryAncestor)oResult.Data;

            if (oResult.IsSuccess && oResult.Data != null)
            {
                int tmpCat2ID = oCatAnc.Category2ID;
                int tmpCat1ID = oCatAnc.Category1ID;
                int tmpParentCatID = oCatAnc.ParentCategoryID;

                FillParentCategory();

                FillFoodType(tmpParentCatID);

                cmbParent.SelectedValue = tmpParentCatID;

                cmbFoodType.SelectedValue = tmpCat1ID;

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

                CComboBoxItem oItem2 = new CComboBoxItem(0, "Non Food");

                cmbCategoryType.Items.Add(oItem1);

                cmbCategoryType.Items.Add(oItem2);

                cmbCategoryType.DisplayMember = "Display";

                cmbCategoryType.ValueMember = "Value";

                if (oCat.Category2Type == 1)
                {

                    cmbCategoryType.SelectedIndex = 0;
                }
                else if (oCat.Category2Type == 0)
                {
                    cmbCategoryType.SelectedIndex = 1;

                }
            }
        }