Exemple #1
0
        private void uiTab1_SelectedTabChanged(object sender, Janus.Windows.UI.Tab.TabEventArgs e)
        {
            try
            {
                if (tsbtnSave.Enabled == false)
                {
                    if (e.Page.Key == TAB_KEY_STORE)
                    {
                        tsbtnUpload.Enabled = false;
                    }
                    else
                    {
                        tsbtnUpload.Enabled = true;
                    }
                }

                BYamaya mBYamaya = new BYamaya();
                switch (e.Page.Key)
                {
                    case TAB_KEY_AREA:
                        if (dtArea == null || dtArea.GetChanges() == null)
                        {
                            refreshGrid(gridEXArea, dtArea = mBYamaya.getAreaDT(mConnString));
                        }
                        break;

                    case TAB_KEY_CATEGORY:
                        if (dtCategory == null || dtCategory.GetChanges() == null)
                        {
                            refreshGrid(gridEXCategory, dtCategory = mBYamaya.getCategoryDT(mConnString));
                        }
                        break;

                    case TAB_KEY_STORE:
                        if (dtStore == null || dtStore.GetChanges() == null)
                        {
                            refreshGrid(gridEXStore, dtStore = mBYamaya.getStoreDT(mConnString));
                        }
                        break;

                    case TAB_KEY_ITEM:
                        if (dtItem == null || dtItem.GetChanges() == null)
                        {
                            refreshGrid(gridEXItem, dtItem = mBYamaya.getItemDT(mConnString));
                        }
                        break;

                    case TAB_KEY_ITEM_DESC:
                        if (dtItemDesc == null || dtItemDesc.GetChanges() == null)
                        {
                            refreshGrid(gridEXItemDesc, dtItemDesc = mBYamaya.getItemDescDT(mConnString));
                        }
                        break;

                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                tsbtnUpload.Enabled = false;
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK);
            }
        }
Exemple #2
0
        private void refreshScreen(string module)
        {
            BYamaya mBYamaya = new BYamaya();
            switch (module)
            {
                case TAB_KEY_AREA:
                    if (dtArea == null || dtArea.GetChanges() == null)
                    {
                        refreshGrid(gridEXArea, dtArea = mBYamaya.getAreaDT(mConnString));

                        //if (!ds.Tables.Contains(TAB_KEY_AREA))
                        //    ds.Tables.Add(dtArea);
                    }
                    break;

                case TAB_KEY_CATEGORY:
                    if (dtCategory == null || dtCategory.GetChanges() == null)
                    {
                        refreshGrid(gridEXCategory, dtCategory = mBYamaya.getCategoryDT(mConnString));

                        //if (!ds.Tables.Contains(TAB_KEY_CATEGORY))
                        //    ds.Tables.Add(dtCategory);
                    }
                    break;

                case TAB_KEY_STORE:
                    if (dtStore == null || dtStore.GetChanges() == null)
                    {
                        refreshGrid(gridEXStore, dtStore = mBYamaya.getStoreDT(mConnString));

                        //if (!ds.Tables.Contains(TAB_KEY_STORE))
                        //    ds.Tables.Add(dtStore);
                    }
                    break;

                case TAB_KEY_ITEM:
                    if (dtItem == null || dtItem.GetChanges() == null)
                    {
                        refreshGrid(gridEXItem, dtItem = mBYamaya.getItemDT(mConnString));

                        //if (!ds.Tables.Contains(TAB_KEY_ITEM))
                        //    ds.Tables.Add(dtItem);
                    }
                    break;

                case TAB_KEY_ITEM_DESC:
                    if (dtItemDesc == null || dtItemDesc.GetChanges() == null)
                    {
                        refreshGrid(gridEXItemDesc, dtItemDesc = mBYamaya.getItemDescDT(mConnString));

                        //if (!ds.Tables.Contains(TAB_KEY_ITEM_DESC))
                        //    ds.Tables.Add(dtItemDesc);
                    }
                    break;

                default:
                    break;
            }
        }