public static string GetView(long dataIndex, string templateSuffix) { long id = 0; long pageNo = 1; long itemsPerPage = UtilsGeneric.DefaultItemsPerPage; #region Save View string htmlSaveView = GetSaveView(id, pageNo, itemsPerPage, dataIndex, templateSuffix); //htmlSaveView += InfoSectionView.GetView(0, dataIndex + 1, templateSuffix, false, false, true, true); htmlSaveView += InfoSectionView.GetScript(true, true); #endregion #region List View string htmlListView = GetListView(pageNo, itemsPerPage, dataIndex, templateSuffix); #endregion var templateMain = new TemplateInfoPage { //SaveExpand = (id == 0) ? "true" : "false", SaveDetail = htmlSaveView, //ListExpand = (id == 0) ? "false" : "true", ListDetail = htmlListView, }; string message = ""; string html = templateMain.GetFilled(templateSuffix, UtilsGeneric.Validate, UtilsGeneric.ThrowException, out message); return(html); }
private static string GetListSingleItemView(LTD_InfoPage ltdInfoPage, long pageNo, long itemsPerPage, long dataIndex, string templateSuffix, long recordIndex, bool asyncLoading) { string htmlTextItem = ""; if (ltdInfoPage != null) { string message; List <TemplateInfoPageListDetailItem.EditAction> editActionList = new List <TemplateInfoPageListDetailItem.EditAction>(); List <TemplateInfoPageListDetailItem.AsyncAction> asyncActionList = new List <TemplateInfoPageListDetailItem.AsyncAction>(); if (((UtilsSecurity.HaveAdminRole() == true) && (UtilsSecurity.HaveAuthorRoleEnabled() == true)) || ((UtilsSecurity.HaveAuthorRoleEnabled() == true) && (ltdInfoPage.UserID == UtilsSecurity.GetUserId()))) { editActionList.Add(new TemplateInfoPageListDetailItem.EditAction { Id = ltdInfoPage.InfoPageID.ToString(), DataIndex = dataIndex.ToString(), PageNo = pageNo.ToString(), ItemsPerPage = itemsPerPage.ToString(), TemplateSuffix = templateSuffix }); } string infoCategoryName = ""; LTD_InfoCategory ltdInfoCategory = DataInfoList.GetLtdInfoCategory(ltdInfoPage.InfoCategoryID); if (ltdInfoCategory != null) { infoCategoryName = ltdInfoCategory.InfoCategoryName; } string infoSectionListView = ""; string infoSectionSaveView = ""; if ((ltdInfoPage.AsyncLoading == false) || ((ltdInfoPage.AsyncLoading == true) && (asyncLoading == false))) { infoSectionListView = InfoSectionView.GetView(ltdInfoPage.InfoPageID, dataIndex + 1, templateSuffix, false, true, true, false); } else { asyncActionList.Add(new TemplateInfoPageListDetailItem.AsyncAction { DataIndex = dataIndex.ToString(), PageNo = pageNo.ToString(), ItemsPerPage = itemsPerPage.ToString(), TemplateSuffix = templateSuffix, AsyncLoading = asyncLoading.ToString().ToLower(), InfoPageId = ltdInfoPage.InfoPageID.ToString(), }); infoSectionSaveView = InfoSectionView.GetView(ltdInfoPage.InfoPageID, dataIndex + 1, templateSuffix, false, false, false, false); } List <TemplateInfoPageListDetailItem.CommentView> commentViewList = new List <TemplateInfoPageListDetailItem.CommentView>(); if ((ltdInfoPage.Commentable == true) && (UtilsSecurity.IsAuthenticated() == true)) { if ((UtilsSecurity.HaveRole(ltdInfoPage.CommentorRoleList, false) == true)) //|| ((ltdInfoPage.IsPublic == true) && (ltdInfoPage.CommentorRoleList.Contains(UtilsSecurity.GuestRole) == true))) { bool allowPublicComments = false; string commentViewHtml = DataView.GetView(true, ltdInfoPage.InfoPageID, templateSuffix, false, CommonRefType.PageInfo, ltdInfoPage.InfoPageID, CommonDataType.CommentData, "Comment", false, false, false, false, false, false, false, true, true, "Add Comment", "Edit Comment", "Reply", allowPublicComments); commentViewList.Add(new TemplateInfoPageListDetailItem.CommentView { CommentViewDetail = commentViewHtml, }); } } var templateListDetailItem = new TemplateInfoPageListDetailItem { InfoPageName = ltdInfoPage.InfoPageName, InfoPageDescription = ltdInfoPage.InfoPageDescription, InfoCategoryName = infoCategoryName, CreatedBy = UtilsSecurity.GetUserName(ltdInfoPage.CreatedUserID), LastUpdateDate = ltdInfoPage.LastUpdateDate.ToString(UtilsGeneric.DefaultDateFormat), //ExpiryDate = ltdInfoPage.ExpiryDate.ToString(AppCommon.DateFormat), IsInActive = !ltdInfoPage.IsActive, IsDeleted = ltdInfoPage.IsDeleted, EditActionList = editActionList, AsyncActionList = asyncActionList, InfoSectionView = infoSectionSaveView + infoSectionListView, CommentViewList = commentViewList, }; htmlTextItem = templateListDetailItem.GetFilled(templateSuffix, UtilsGeneric.Validate, UtilsGeneric.ThrowException, out message); } return(htmlTextItem); }