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(); } } }
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(); } }
public void RunLink(String strTableName, ViewMode mode, bool isShowDialog, Guid iMainID, ABCScreenAction action) { STViewsInfo viewResult = null; STViewsController viewCtrl = new STViewsController(); String strViewNo = VoucherProvider.GetViewNo(strTableName, iMainID); if (!String.IsNullOrWhiteSpace(strViewNo)) { viewResult = viewCtrl.GetObjectByNo(strViewNo) as STViewsInfo; } if (viewResult == null) { #region Without Voucher BusinessObjectController controller = BusinessControllerFactory.GetBusinessController(strTableName); if (controller == null) { return; } BusinessObject obj = controller.GetObjectByID(iMainID); if (obj == null) { return; } 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)) { object objValue = ABCBusinessEntities.ABCDynamicInvoker.GetValue(obj, viewIfo.MainFieldName); if (objValue != null && objValue.ToString().ToUpper().Trim() == viewIfo.MainValue.ToUpper()) { viewResult = viewIfo; break; } } } if (viewResult == null && lstViews.Count > 0) { viewResult = lstViews[0] as STViewsInfo; } #endregion } if (viewResult != null) { ABCScreenManager.Instance.RunLink(viewResult, mode, isShowDialog, iMainID, action); } }