Esempio n. 1
0
        public void FeedTemplateList(string appID
                                     , GlobalTemplateMembers.CannotDoTemplate canNotDo
                                     , FeedTemplateHeadFootItemTemplate head
                                     , FeedTemplateHeadFootItemTemplate foot
                                     , FeedTemplateListItemTemplate item)
        {
            Guid currentAppID;

            try
            {
                currentAppID = new Guid(appID);
            }
            catch
            {
                currentAppID = new BasicApp().AppID;
                //throw new Exception("非法的AppID");
            }


            FeedTemplateCollection feedTemplates;

            using (ErrorScope errorScope = new ErrorScope())
            {
                feedTemplates = FeedBO.Instance.GetFeedTemplates(currentAppID);
                errorScope.CatchError <ErrorInfo>(delegate(ErrorInfo error)
                {
                    canNotDo(error.Message);
                    return;
                });
            }

            int totalCount = feedTemplates.Count;

            AppBase currentApp = AppManager.GetApp(currentAppID);

            head(totalCount > 0, totalCount, currentApp);

            int i = 0;

            foreach (FeedTemplate feedTemplate in feedTemplates)
            {
                item(i++, feedTemplate, currentApp);
            }

            foot(totalCount > 0, totalCount, currentApp);
        }
Esempio n. 2
0
        public void FeedTemplateList(string appID
            , GlobalTemplateMembers.CannotDoTemplate canNotDo
            , FeedTemplateHeadFootItemTemplate head
            , FeedTemplateHeadFootItemTemplate foot
            , FeedTemplateListItemTemplate item)
        {
            Guid currentAppID;
            try
            {
                currentAppID = new Guid(appID);
            }
            catch
            {
                currentAppID = new BasicApp().AppID;
                //throw new Exception("非法的AppID");
            }


            FeedTemplateCollection feedTemplates;
            using (ErrorScope errorScope = new ErrorScope())
            {
                feedTemplates = FeedBO.Instance.GetFeedTemplates(currentAppID);
                errorScope.CatchError<ErrorInfo>(delegate(ErrorInfo error)
                {
                    canNotDo(error.Message);
                    return;
                });
            }

            int totalCount = feedTemplates.Count;

            AppBase currentApp = AppManager.GetApp(currentAppID);

            head(totalCount > 0, totalCount, currentApp);

            int i = 0;

            foreach (FeedTemplate feedTemplate in feedTemplates)
            {
                item(i++, feedTemplate, currentApp);
            }

            foot(totalCount > 0, totalCount, currentApp);
        }