public void LoadData(int menuId, bool showId) { // clear UI Clear(); // set up parameters var data = new MenuDataModel(); data.MenuId = menuId; // get data var items = MenuDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); // should only have single match -- should log exception. if (items.Count != 1) { return; } var item = items[0]; txtDescription.Value = item.Description; txtName.Text = item.Name; txtSortOrder.Text = item.SortOrder.ToString(); txtDisplayName.Text = item.MenuDisplayName; txtNavigateURL.Text = item.NavigateURL; txtParentMenuId.Text = item.ParentMenuId.ToString(); txtApplicationId.Text = item.ApplicationId.ToString(); txtPrimaryDeveloper.Text = item.PrimaryDeveloper; txtSortOrder.Text = item.SortOrder.ToString(); txtApplicationModule.Text = item.ApplicationModule; if (item.ParentMenuId != null) { var parentMenu = new MenuDataModel(); parentMenu.ParentMenuId = item.ParentMenuId; parentMenu.Name = item.Name; parentMenu.PrimaryDeveloper = item.PrimaryDeveloper; var parentMenudata = MenuDataManager.GetDetails(parentMenu, SessionVariables.RequestProfile); drpParentMenu.SelectedItem.Value = parentMenudata.ToString(); } if (!showId) { txtMenuId.Text = item.MenuId.ToString(); //PlaceHolderAuditHistory.Visible = true; // only show Audit History in case of Update page, not for Clone. oHistoryList.Setup(PrimaryEntity, menuId, PrimaryEntityKey); } else { txtMenuId.Text = String.Empty; } oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction); }
protected override DataTable GetData() { try { SuperKey = ApplicationCommon.GetSuperKey(); SetId = ApplicationCommon.GetSetId(); var selectedrows = new DataTable(); var menudata = new MenuDataModel(); selectedrows = MenuDataManager.GetDetails(menudata, SessionVariables.RequestProfile).Clone(); if (!string.IsNullOrEmpty(SuperKey)) { var systemEntityTypeId = (int)PrimaryEntity; var lstEntityKeys = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey); foreach (var entityKey in lstEntityKeys) { menudata.MenuId = entityKey; var result = MenuDataManager.GetDetails(menudata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } } else { menudata.MenuId = SetId; var result = MenuDataManager.GetDetails(menudata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } return(selectedrows); } catch (Exception ex) { Response.Write(ex.Message); } return(null); }