Priya.InfoList.Views.InfoDetailView.GetView C# (CSharp) 메소드

GetView() 공개 정적인 메소드

public static GetView ( long infoSectionId, long dataIndex, string templateSuffix, bool showSave, bool showList, bool loadSaveScript, bool loadListScript ) : string
infoSectionId long
dataIndex long
templateSuffix string
showSave bool
showList bool
loadSaveScript bool
loadListScript bool
리턴 string
        public static string GetView(long infoSectionId, long dataIndex, string templateSuffix, bool showSave, bool showList, bool loadSaveScript, bool loadListScript)
        {
            long id = 0;
            long pageNo = 1;
            long itemsPerPage = UtilsGeneric.DefaultItemsPerPage;

            #region Save View

            string htmlSaveView = "";
            htmlSaveView = GetSaveView(id, pageNo, itemsPerPage, dataIndex, templateSuffix, infoSectionId, loadSaveScript, showSave);

            #endregion

            #region List View

            string htmlListView = "";
            htmlListView = GetListView(pageNo, itemsPerPage, dataIndex, templateSuffix, infoSectionId, loadListScript, showList);

            #endregion            

            var templateView = new TemplateInfoDetail
            {
                //SaveExpand = (id == 0) ? "true" : "false",
                SaveDetail = htmlSaveView,
                //ListExpand = (id == 0) ? "false" : "true",
                ListDetail = htmlListView,
            };

            string message = "";
            string html = templateView.GetFilled(templateSuffix, UtilsGeneric.Validate, UtilsGeneric.ThrowException, out message);
            return html;
        }

Usage Example

예제 #1
0
        private static string GetListSingleItemView(LTD_InfoSection ltdSection, long pageNo, long itemsPerSection, long dataIndex, string templateSuffix, long infoPageId, long recordCount, bool asyncLoading)
        {
            string       htmlTextItem = "";
            LTD_InfoPage ltdInfoPage  = DataInfoList.GetLtdInfoPage(infoPageId);

            if ((ltdSection != null) && (ltdInfoPage != null))
            {
                string message;
                List <TemplateInfoSectionListDetailItem.EditAction>  editActionList  = new List <TemplateInfoSectionListDetailItem.EditAction>();
                List <TemplateInfoSectionListDetailItem.AsyncAction> asyncActionList = new List <TemplateInfoSectionListDetailItem.AsyncAction>();

                if (((UtilsSecurity.HaveAdminRole() == true) && (UtilsSecurity.HaveAuthorRoleEnabled() == true)) || ((UtilsSecurity.HaveAuthorRoleEnabled() == true) && (ltdInfoPage.UserID == UtilsSecurity.GetUserId())))
                {
                    editActionList.Add(new TemplateInfoSectionListDetailItem.EditAction
                    {
                        Id             = ltdSection.InfoSectionID.ToString(),
                        DataIndex      = dataIndex.ToString(),
                        PageNo         = pageNo.ToString(),
                        ItemsPerPage   = itemsPerSection.ToString(),
                        TemplateSuffix = templateSuffix,
                        InfoPageId     = infoPageId.ToString(),
                    });
                }

                string infoDetailListView = "";
                string infoDetailSaveView = "";

                if ((ltdInfoPage.AsyncLoading == false) || ((ltdInfoPage.AsyncLoading == true) && (asyncLoading == false)))
                {
                    infoDetailListView = InfoDetailView.GetView(ltdSection.InfoSectionID, dataIndex + 1, templateSuffix, false, true, true, false);
                }
                else
                {
                    asyncActionList.Add(new TemplateInfoSectionListDetailItem.AsyncAction
                    {
                        Id             = ltdSection.InfoSectionID.ToString(),
                        DataIndex      = dataIndex.ToString(),
                        PageNo         = pageNo.ToString(),
                        ItemsPerPage   = itemsPerSection.ToString(),
                        TemplateSuffix = templateSuffix,
                    });

                    infoDetailSaveView = InfoDetailView.GetView(ltdSection.InfoSectionID, dataIndex + 1, templateSuffix, false, false, false, false);
                }

                var templateListDetailItem = new TemplateInfoSectionListDetailItem
                {
                    InfoSectionName        = ltdSection.InfoSectionName,
                    InfoSectionDescription = ltdSection.InfoSectionDescription,
                    IsInActive             = !ltdSection.IsActive,

                    EditActionList  = editActionList,
                    AsyncActionList = asyncActionList,
                    InfoDetailView  = infoDetailSaveView + infoDetailListView
                };
                htmlTextItem = templateListDetailItem.GetFilled(templateSuffix, UtilsGeneric.Validate,
                                                                UtilsGeneric.ThrowException,
                                                                out message);
            }
            return(htmlTextItem);
        }