コード例 #1
0
        private void BindData()
        {
            this.hidPid.Value = eventItemID.ToString();
            EventItemViewEntity entity = bllEventItem.QueryViewEntity(eventItemID);

            if (entity != null)
            {
                List <CalendarTypeEntity> firstTypeList  = bllCalendarType.QueryFirstCalendarType();
                List <CalendarTypeEntity> secondTypeList = bllCalendarType.QuerySecondCalendarType(entity.FirstTypeID);
                List <ZoneEntity>         zoneList       = bllZone.QueryZoneProvince();

                foreach (CalendarTypeEntity item in firstTypeList)
                {
                    this.selFirstType.Items.Add(new ListItem(item.CalendarTypeName, item.CalendarTypeID.ToString()));
                }
                this.selFirstType.Value = entity.FirstTypeID.ToString();

                foreach (CalendarTypeEntity item in secondTypeList)
                {
                    this.selSecondType.Items.Add(new ListItem(item.CalendarTypeName, item.CalendarTypeID.ToString()));
                }
                this.selSecondType.Value = entity.CalendarTypeID.ToString();

                if (entity.CalendarTypeID == 0 && entity.FirstTypeID == 0)
                {
                    this.chkSubpage.Checked      = true;
                    this.selFirstType.Disabled   = true;
                    this.selSecondType.Disabled  = true;
                    this.chkSingleGroup.Disabled = false;
                }

                this.chkSingleGroup.Checked = entity.IsSingleGroupState;

                this.hidPublichAreaID.Value = bllZone.ConvertZoneIDs(entity.PublishAreaID);

                this.txtActivePlace.Value = entity.ActivePlace;

                this.txtTitle.Value   = entity.Title;
                this.txtContent.Value = entity.Content;

                if (!string.IsNullOrEmpty(entity.PicturePath))
                {
                    this.hidImgurl.Value = entity.Domain + entity.PicturePath;
                    this.imgLogo.Src     = entity.Domain + entity.PicturePath;
                    this.btnImage.Value  = "删除";
                    this.btnImage.Attributes.Add("datatype", "del");
                }

                if (!string.IsNullOrEmpty(entity.ThemePicturePath))
                {
                    this.hidThemeImgurl.Value = entity.Domain + entity.ThemePicturePath;
                    this.imgThemeLogo.Src     = entity.Domain + entity.ThemePicturePath;
                    this.btnThemeImage.Value  = "删除";
                    this.btnThemeImage.Attributes.Add("datatype", "del");
                }

                this.txtHtml.InnerHtml = entity.Html;

                this.hidPublishTime.Value   = DateTime.Parse(entity.PublishTime).ToString("yyyy-MM-dd HH:mm:ss");
                this.txtPublishSource.Value = entity.PublishSource;
                this.lblUrl.InnerText       = entity.Url;

                this.chkRecommend.Checked      = entity.Recommend == 1 ? true:false;
                this.chkAdvert.Checked         = entity.Advert == 1? true:false;
                this.chkDiscoverAdvert.Checked = entity.DiscoverAdvert == 1 ? true : false;

                this.txtAdsEndTime.Value         = entity.AdsEndTime.Year == 4000 ? "" : entity.AdsEndTime.ToString("yyyy-MM-dd HH:mm:ss");
                this.txtDiscoverAdsEndTime.Value = entity.DiscoverAdsEndTime.Year == 4000 ? "" : entity.DiscoverAdsEndTime.ToString("yyyy-MM-dd HH:mm:ss");
                this.txtAdvertOrder.Value        = entity.AdvertOrder.ToString();
                this.hidBookListPath.Value       = entity.BookListPath;

                this.hidFestivalID.Value = entity.FestivalID.ToString() != "00000000-0000-0000-0000-000000000000" ? entity.FestivalID.ToString():"";

                //if (entity.StartTime.ToString("yyyy-MM-dd HH:mm:ss") == entity.StartTime.ToString("yyyy-MM-dd") + " 00:00:00"
                //    && entity.EndTime.ToString("yyyy-MM-dd HH:mm:ss") == entity.EndTime.ToString("yyyy-MM-dd") + " 23:59:59")
                //{
                //    this.hidStartTime.Value = "4000-01-01 00:00:00";
                //    this.hidEndTime.Value = "4000-01-01 00:00:00";
                //    this.hidallday.Value = entity.StartTime.ToString("yyyy-MM-dd");
                //}
                //else
                {
                    this.hidStartTime.Value = entity.StartTime.ToString("yyyy-MM-dd HH:mm");
                    this.hidEndTime.Value   = entity.EndTime.ToString("yyyy-MM-dd HH:mm");
                }

                if (!string.IsNullOrEmpty(entity.CarouselPicturePath))
                {
                    this.hidCarouselImgurl.Value = entity.Domain + entity.CarouselPicturePath;
                    this.imgCarouselLogo.Src     = entity.Domain + entity.CarouselPicturePath;
                    this.btnCarouselImage.Value  = "删除";
                    this.btnCarouselImage.Attributes.Add("datatype", "del");
                }

                if (entity.EventItemFlag == 1)
                {
                    this.chkFestArticle.Checked = true;
                    this.txtStartTime2.Value    = entity.StartTime2.ToString("yyyy-MM-dd HH:mm:ss");
                    this.txtEndTime2.Value      = entity.EndTime2.ToString("yyyy-MM-dd HH:mm:ss");
                    this.txtTitle2.Value        = entity.Title2;
                }
                else
                {
                    this.chkFestArticle.Checked = false;
                    this.txtStartTime2.Attributes.Add("disabled", "disabled");
                    this.txtEndTime2.Attributes.Add("disabled", "disabled");
                    this.txtTitle2.Attributes.Add("disabled", "disabled");
                }
            }
            else
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "articleEdit2", "<script>bootbox.dialog(\"数据传输错误!\", [{\"label\": \"OK\",\"class\": \"btn-small btn-primary\",callback: function () { window.location.href = 'ArticleManager.aspx?fun="+ Master.fun +"';}}]);</script>");
                Page.ClientScript.RegisterStartupScript(this.GetType(), "articleEdit2", "<script>alert('数据传输错误!');</script>");
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Guid eventItemGUID;
                //判定是否是分享页
                string id  = Request["pid"];
                string pid = string.Empty;
                if (id.IndexOf("_") != -1)
                {
                    string[] urlSplit = id.Split('_');
                    if (urlSplit[0] == "1")
                    {
                        prefix             = "1_";
                        moblieShareHeader += "<header class='app-logo-box' style='display: none;' id='divMoblieShareHeader'>";
                        moblieShareHeader += "<div class='logo-box article-content'>";
                        moblieShareHeader += "<figure class='logo'>";
                        moblieShareHeader += "<img src='/images/app-logo.png' alt='开卷日历logo'/>";
                        moblieShareHeader += "</figure>";
                        moblieShareHeader += "<div class='app-open'>";
                        moblieShareHeader += "<a href='http://www.kjrili.com/app/download.html'>立即打开</a>";
                        moblieShareHeader += "</div>";
                        moblieShareHeader += "</div>";
                        moblieShareHeader += "</header>";

                        moblieShareFooter += " <div class='app-btn more' id='divMoblieShareFooter' style='display: none;'>";
                        moblieShareFooter += "<span></span><a href='http://www.kjrili.com/app/download.html' class='more-btn'><img src='/images/share_icon.png'/>";
                        moblieShareFooter += "打开开卷日历,看更多精彩内容</a> ";
                        moblieShareFooter += "</div> ";
                    }
                    pid = urlSplit[1];
                }
                else
                {
                    pid = id;
                }
                if (Guid.TryParse(pid, out eventItemGUID))
                {
                    this.hidGlobalGUID.Value = eventItemGUID.ToString();
                    BCtrl_EventItem bll = new BCtrl_EventItem();

                    EventItemViewEntity entity = bll.QueryViewEntity(eventItemGUID);


                    title = entity.Title;
                    if (title.Length > 25)
                    {
                        title = title.Substring(0, 25) + "...";
                    }
                    Page.Title = entity.Title;
                    desc       = entity.Content;
                    imgUrl     = entity.Domain + entity.PicturePath + "?imageView2/0/interlace/1/format/jpg";
                    //设置带有下载头的url
                    link = Request.Url.Host + Request.RawUrl;
                    CheckSignature(link);
                    this.hidNewsPath.Value = WebMaster.ArticleDomain + eventItemGUID.ToString() + ".html";
                }
                else
                {
                    WebMaster.EndPage();
                }
            }
        }
コード例 #3
0
        public string GetEventItemContent(HttpContext context)
        {
            dynamic result = new { status = "-1" };
            Guid    eventItemGuid;

            if (Guid.TryParse(context.Request.Form["pid"], out eventItemGuid))
            {
                BCtrl_EventItem     bll    = new BCtrl_EventItem();
                EventItemViewEntity entity = bll.QueryViewEntity(eventItemGuid);
                entity.Html = bll.DealHtmlImg(entity.Html);

                if (!string.IsNullOrEmpty(entity.ThemePicturePath))
                {
                    if (entity.StartTime.Year == 4000 && entity.EndTime.Year == 4000)
                    {
                        entity.ActiveTimeDesc = "";
                    }
                    else if (entity.StartTime.ToString("HH:mm:ss") == "00:00:00" && entity.EndTime.ToString("HH:mm:ss") == "00:00:00")
                    {
                        entity.ActiveTimeDesc = entity.StartTime.ToString("yyyy-MM-dd") + "至" + entity.EndTime.ToString("yyyy-MM-dd");
                    }
                    else if (entity.StartTime.ToShortDateString() == entity.EndTime.ToShortDateString())
                    {
                        if (entity.StartTime.Hour != 9 || entity.EndTime.Hour != 17)
                        {
                            entity.ActiveTimeDesc = entity.StartTime.ToString("yyyy-MM-dd HH:mm") + "至" + entity.EndTime.ToString("yyyy-MM-dd HH:mm");
                        }
                        else
                        {
                            entity.ActiveTimeDesc = entity.StartTime.ToString("yyyy-MM-dd HH:mm");
                        }
                    }
                    else
                    {
                        entity.ActiveTimeDesc = entity.StartTime.ToString("yyyy-MM-dd HH:mm") + "至" + entity.EndTime.ToString("yyyy-MM-dd HH:mm");
                    }
                    //if (entity.StartTime.Year != 4000 && entity.EndTime.Year != 4000)
                    //{
                    //    if (entity.StartTime.ToString("yyyy-MM-dd HH:mm:ss") == entity.StartTime.ToString("yyyy-MM-dd") + " 00:00:00"
                    //        && entity.EndTime.ToString("yyyy-MM-dd HH:mm:ss") == entity.EndTime.ToString("yyyy-MM-dd") + " 23:59:59")
                    //    {
                    //        entity.ActiveTimeDesc = entity.StartTime.ToString("yyyy-MM-dd") + "全天";
                    //    }
                    //    else if (entity.StartTime.ToString("HH:mm:ss") == "00:00:00" && entity.EndTime.ToString("HH:mm:ss") == "00:00:00")
                    //    {
                    //        entity.ActiveTimeDesc = entity.StartTime.ToString("yyyy-MM-dd") + "至" + entity.EndTime.ToString("yyyy-MM-dd");
                    //    }
                    //    else
                    //    {
                    //        entity.ActiveTimeDesc = entity.StartTime.ToString("yyyy-MM-dd HH:mm") + "至" + entity.EndTime.ToString("yyyy-MM-dd HH:mm");
                    //    }
                    //}
                }

                if (entity != null)
                {
                    result = new { status = "1", item = entity };
                }
                else
                {
                    result = new { status = "0" };
                }
            }
            return(StringUti.ToUnicode(JsonObj <object> .ToJsonString(result)));
        }