private void ReloadMenuSetTree() { trvMenu.SuspendLayout(); try { MenuRegisterUIDM model = m_menuRegisterController.LoadMenuList(); trvMenu.Nodes.Clear(); for (int i = 0; i < model.ListMenuHierachy.Count; i++) { MenuRegisterUIDM.MenuSet menuSet = model.ListMenuHierachy[i]; TreeNode rootNode = new TreeNode(); rootNode.Text = menuSet.MENU_SET_NAME.StrongValue; rootNode.Tag = menuSet; for (int iChild = 0; iChild < menuSet.ListMenuSub.Count; iChild++) { MenuRegisterUIDM.MenuSub menuSub = menuSet.ListMenuSub[iChild]; TreeNode childNode = new TreeNode(); childNode.Text = menuSub.MENU_SUB_DESC.NVL(String.Empty); childNode.Tag = menuSub; rootNode.Nodes.Add(childNode); } trvMenu.Nodes.Add(rootNode); } } finally { trvMenu.ResumeLayout(false); } }
private void mnuRemoveScreen_Click(object sender, EventArgs e) { if (MessageDialog.ShowConfirmation(this, Message.LoadMessage(Messages.eConfirm.CFM9002.ToString()), MessageDialogButtons.YesNo) == MessageDialogResult.No) { return; } List <NZString> listSCREEN_CD = new List <NZString>(); for (int i = 0; i < shtScreen.RowCount; i++) { object objSEL = shtScreen.GetValue(i, (int)eColScreen.SEL); if (objSEL == null || Convert.ToBoolean(objSEL) == false) { continue; } listSCREEN_CD.Add(new NZString(null, shtScreen.GetValue(i, (int)eColScreen.SCREEN_CD).ToString())); } MenuRegisterUIDM.MenuSub menuSub = trvMenu.SelectedNode.Tag as MenuRegisterUIDM.MenuSub; if (menuSub == null) { return; } try { m_menuRegisterController.RemoveScreen(menuSub.MENU_SUB_CD, listSCREEN_CD.ToArray()); LoadScreens(menuSub.MENU_SUB_CD); } catch (Exception err) { MessageDialog.ShowBusiness(this, err.Message); } UpdateButtonMoveEnable(); }
public MenuRegisterUIDM LoadMenuList() { MenuRegisterUIDM model = new MenuRegisterUIDM(); MenuSetMaintenanceBIZ bizMenuSet = new MenuSetMaintenanceBIZ(); MenuSubMaintenanceBIZ bizMenuSub = new MenuSubMaintenanceBIZ(); NZString langCD = CommonLib.Common.CurrentUserInfomation.LanguageCD; // Load All MenuSet List <MenuSetDTO> listMenuSetDTO = bizMenuSet.LoadAllMenuSet(); for (int i = 0; i < listMenuSetDTO.Count; i++) { MenuSetDTO menuSetDTO = listMenuSetDTO[i]; MenuRegisterUIDM.MenuSet menuSet = new MenuRegisterUIDM.MenuSet(); menuSet.MENU_SET_CD.Value = menuSetDTO.MENU_SET_CD.Value; menuSet.MENU_SET_NAME.Value = menuSetDTO.MENU_SET_NAME.Value; // Load MenuSub which is child of MenuSet. List <MenuSetDetailDTO> listMenuSetDetail = bizMenuSet.LoadAllMenuSubByMenuSetCD(menuSet.MENU_SET_CD.StrongValue); for (int iDetail = 0; iDetail < listMenuSetDetail.Count; iDetail++) { MenuSetDetailDTO menuSetDetailDTO = listMenuSetDetail[iDetail]; // Load description of each MenuSub DataTable dtMenuSubDescription = bizMenuSub.LoadMenuSubWithLang(menuSetDetailDTO.MENU_SUB_CD, langCD); MenuRegisterUIDM.MenuSub menuSub = new MenuRegisterUIDM.MenuSub(menuSet); menuSub.MENU_SUB_CD.Value = menuSetDetailDTO.MENU_SUB_CD.Value; if (dtMenuSubDescription.Rows.Count > 0) { menuSub.MENU_SUB_NAME.Value = dtMenuSubDescription.Rows[0][(int)MenuSubDTO.eColumns.MENU_SUB_NAME]; menuSub.MENU_SUB_DESC.Value = dtMenuSubDescription.Rows[0][(int)MenuSubLangDTO.eColumns.MENU_SUB_DESC]; } // Add menuSub object into MenuSet object. menuSet.ListMenuSub.Add(menuSub); } model.ListMenuHierachy.Add(menuSet); } return(model); }
private void mnuRegisterScreen_Click(object sender, EventArgs e) { MenuRegisterUIDM.MenuSub menuSub = trvMenu.SelectedNode.Tag as MenuRegisterUIDM.MenuSub; if (menuSub == null) { return; } SFM0101_ScreenList form = new SFM0101_ScreenList(menuSub.MENU_SUB_CD); if (form.ShowDialog(this) == DialogResult.OK) { m_menuRegisterController.RegisterScreen(menuSub.MENU_SUB_CD, form.SelectedScreenList.ToArray()); LoadScreens(menuSub.MENU_SUB_CD); } UpdateButtonMoveEnable(); }
private void btnMoveDown_Click(object sender, EventArgs e) { MenuRegisterUIDM.MenuSub menuSub = trvMenu.SelectedNode.Tag as MenuRegisterUIDM.MenuSub; if (menuSub == null) { return; } int colIndex = shtScreen.ActiveColumnIndex; int rowIndex = shtScreen.ActiveRowIndex; AdjustScreenSequence("DOWN", menuSub.MENU_SUB_CD, rowIndex); LoadScreens(menuSub.MENU_SUB_CD); shtScreen.SetActiveCell(rowIndex + 1, colIndex); shtScreen.AddSelection(rowIndex + 1, colIndex, 1, 1); UpdateButtonMoveEnable(); }
private void trvMenu_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.Tag is MenuRegisterUIDM.MenuSub) { // Show screen list of selected MenuSub. MenuRegisterUIDM.MenuSub menuSub = e.Node.Tag as MenuRegisterUIDM.MenuSub; LoadScreens(menuSub.MENU_SUB_CD); shtScreen.SetActiveCell(0, 0); shtScreen.AddSelection(0, 0, 1, 1); UpdateButtonMoveEnable(); } else { // Clear screen list. fpScreen.ActiveSheet.RowCount = 0; fpScreen.DataSource = null; UpdateButtonMoveEnable(); CtrlUtil.EnabledControl(false, fpScreen); } }