Exemplo n.º 1
0
        public void RunLink(STViewsInfo viewIfo, ViewMode mode, bool isShowDialog, Guid iMainID, ABCScreenAction action)
        {
            if (viewIfo != null)
            {
                ABCHelper.ABCWaitingDialog.Show("", "Đang mở  . . .!");

                ABCScreen.ABCBaseScreen scr = ABCScreenFactory.GetABCScreen(viewIfo, mode);
                if (scr != null)
                {
                    scr.InvalidateData(iMainID);

                    ABCHelper.ABCWaitingDialog.Close();

                    if (action != ABCScreenAction.None)
                    {
                        scr.DoAction(action, true);
                    }
                    if (action == ABCScreenAction.Disable)
                    {
                        scr.UIManager.View.ShowToolbar = false;
                    }

                    if (isShowDialog)
                    {
                        scr.ShowDialog();
                    }
                    else
                    {
                        scr.Show();
                    }
                }

                ABCHelper.ABCWaitingDialog.Close();
            }
        }
Exemplo n.º 2
0
        public void RunLink(String strScreenName, ViewMode mode, bool isShowDialog, ABCScreenAction action, params object[] objParams)
        {
            ABCHelper.ABCWaitingDialog.Show("", "Đang mở . . .!");

            ABCScreen.ABCBaseScreen scr = ABCScreenFactory.GetABCScreen(strScreenName, mode);
            if (scr != null)
            {
                scr.InvalidateData(objParams);
            }

            ABCHelper.ABCWaitingDialog.Close();

            if (scr != null)
            {
                if (action != ABCScreenAction.None)
                {
                    scr.DoAction(action, true);
                }
                if (action == ABCScreenAction.Disable)
                {
                    scr.UIManager.View.ShowToolbar = false;
                }

                if (isShowDialog)
                {
                    scr.ShowDialog();
                }
                else
                {
                    scr.Show();
                }
            }
        }
Exemplo n.º 3
0
        public void OpenScreenForNew(String strTableName, ViewMode mode, bool isShowDialog)
        {
            #region Get View
            STViewsInfo           viewResult = null;
            STViewsController     viewCtrl   = new STViewsController();
            List <BusinessObject> lstViews   = viewCtrl.GetListFromDataset(viewCtrl.GetDataSet(String.Format("SELECT * FROM STViews WHERE [MainTableName] = '{0}' ", strTableName)));
            foreach (STViewsInfo viewIfo in lstViews)
            {
                if (String.IsNullOrWhiteSpace(viewIfo.MainFieldName) == false && DataStructureProvider.IsTableColumn(strTableName, viewIfo.MainFieldName))
                {
                    viewResult = viewIfo;
                    break;
                }
            }
            if (viewResult == null && lstViews.Count > 0)
            {
                viewResult = lstViews[0] as STViewsInfo;
            }

            #endregion

            if (viewResult != null)
            {
                ABCHelper.ABCWaitingDialog.Show("", "Đang mở . . .!");

                ABCScreen.ABCBaseScreen scr = ABCScreenFactory.GetABCScreen(viewResult, mode);
                scr.DoAction(ABCScreenAction.New, true);

                ABCHelper.ABCWaitingDialog.Close();

                if (isShowDialog)
                {
                    scr.ShowDialog();
                }
                else
                {
                    scr.Show();
                }
            }
        }