Beispiel #1
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var ltlIndex         = (Literal)e.Item.FindControl("ltlIndex");
                var ltlAddUserName   = (Literal)e.Item.FindControl("ltlAddUserName");
                var ltlAddDate       = (Literal)e.Item.FindControl("ltlAddDate");
                var ltlContentLength = (Literal)e.Item.FindControl("ltlContentLength");
                var ltlView          = (Literal)e.Item.FindControl("ltlView");

                var logID = SqlUtils.EvalInt(e.Item.DataItem, "ID");

                ltlIndex.Text         = Convert.ToString(e.Item.ItemIndex + 1);
                ltlAddUserName.Text   = SqlUtils.EvalString(e.Item.DataItem, "AddUserName");
                ltlAddDate.Text       = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate"));
                ltlContentLength.Text = SqlUtils.EvalInt(e.Item.DataItem, "ContentLength").ToString();
                ltlView.Text          =
                    $@"<a href=""javascript:;"" onclick=""{ModalTemplateView.GetOpenLayerString(PublishmentSystemId,
                        logID)}"">查看</a>";
            }
        }
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var ltlIndex         = (Literal)e.Item.FindControl("ltlIndex");
            var ltlAddUserName   = (Literal)e.Item.FindControl("ltlAddUserName");
            var ltlAddDate       = (Literal)e.Item.FindControl("ltlAddDate");
            var ltlContentLength = (Literal)e.Item.FindControl("ltlContentLength");
            var ltlView          = (Literal)e.Item.FindControl("ltlView");

            var logId = SqlUtils.EvalInt(e.Item.DataItem, nameof(TemplateLogInfo.Id));

            ltlIndex.Text         = Convert.ToString(e.Item.ItemIndex + 1);
            ltlAddUserName.Text   = SqlUtils.EvalString(e.Item.DataItem, nameof(TemplateLogInfo.AddUserName));
            ltlAddDate.Text       = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, nameof(TemplateLogInfo.AddDate)));
            ltlContentLength.Text = SqlUtils.EvalInt(e.Item.DataItem, nameof(TemplateLogInfo.ContentLength)).ToString();
            ltlView.Text          =
                $@"<a href=""javascript:;"" onclick=""{ModalTemplateView.GetOpenWindowString(SiteId,
                    logId)}"">查看</a>";
        }