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

            CResult    oResult     = oManager.GetCategory3(m_foodItemID);
            CCategory3 objFoodItem = new CCategory3();

            if (oResult.IsSuccess && oResult.Data != null)
            {
                objFoodItem         = (CCategory3)oResult.Data;
                txtProductName.Text = objFoodItem.Category3Name;
                txtOrder.Text       = objFoodItem.Category3Order.ToString();

                m_iCat3Order = objFoodItem.Category3Order;

                txtDescription.Text   = objFoodItem.Category3Description;
                txtTablePrice.Text    = objFoodItem.Category3TablePrice.ToString("F02");
                txtTakeawayPrice.Text = objFoodItem.Category3TakeAwayPrice.ToString("F02");
                txtBarPrice.Text      = objFoodItem.Category3BarPrice.ToString("F02");
                cmbSellingIn.Text     = objFoodItem.ItemSellingIn;
                txtVateRate.Text      = objFoodItem.vatRate.ToString();
                selectarealabel.Text  = objFoodItem.PrintArea;

                tblCost.Text      = objFoodItem.TableCost.ToString("F02");
                takeawayCost.Text = objFoodItem.TakeAwayCost.ToString("F02");
                barCost.Text      = objFoodItem.BarCost.ToString("F02");

                try
                {
                    chkVateIncluded.Checked = objFoodItem.vatIncluded;
                }
                catch { }
                if (objFoodItem.UnlimitStatus == 1)
                {
                    txtInitialQuantity.Clear();
                    chkUnlimited.Checked = true;
                }
                else
                {
                    txtInitialQuantity.Text = objFoodItem.InitialItemQuantity.ToString();
                }

                m_iRank = objFoodItem.Rank;

                if (objFoodItem.Category3ViewTable == 1)
                {
                    chkTable.Checked = true;
                }
                if (objFoodItem.Category3ViewBar == 1)
                {
                    chkBar.Checked = true;
                }
                if (objFoodItem.Category3ViewTakeAway == 1)
                {
                    chkTakeAway.Checked = true;
                }
            }

            oResult = oManager.GetCategoryAncestors(m_foodItemID, 3);
            CCategoryAncestor oCatAnc = (CCategoryAncestor)oResult.Data;

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


                if (objFoodItem.Category3OrderStatus == 1)
                {
                    m_activeStatus    = true;
                    rdoActive.Checked = true;
                }
                else if (objFoodItem.Category3OrderStatus == 0)
                {
                    rdoInActive.Checked = true;
                    m_activeStatus      = false;
                }

                cmbParent.SelectedValue   = tmpParentCatID;
                cmbFoodType.SelectedValue = tmpCat1ID;
                cmbCategory.SelectedValue = tmpCat2ID;
            }
        }
Example #2
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;
                }
            }
        }
Example #3
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;
            }
        }