示例#1
0
        public static string GetImageUrlButtonGroupHtml(PublishmentSystemInfo publishmentSystemInfo, string textBoxID)
        {
            var selectImageClick  = ModalSelectImage.GetOpenWindowString(publishmentSystemInfo, textBoxID);
            var uploadImageClick  = ModalUploadImageSingle.GetOpenWindowStringToTextBox(publishmentSystemInfo.PublishmentSystemId, textBoxID);
            var cuttingImageClick = ModalCuttingImage.GetOpenWindowStringWithTextBox(publishmentSystemInfo.PublishmentSystemId, textBoxID);
            var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(publishmentSystemInfo.PublishmentSystemId, textBoxID);

            return($@"
<div class=""btn-group"">
    <a class=""btn"" href=""javascript:;"" onclick=""{selectImageClick};return false;"" title=""选择""><i class=""icon-th""></i></a>
    <a class=""btn"" href=""javascript:;"" onclick=""{uploadImageClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a>
    <a class=""btn"" href=""javascript:;"" onclick=""{cuttingImageClick};return false;"" title=""裁切""><i class=""icon-crop""></i></a>
    <a class=""btn"" href=""javascript:;"" onclick=""{previewImageClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>
</div>
");
        }
示例#2
0
        public static string GetImageUrlButtonGroupHtml(SiteInfo siteInfo, string attributeName)
        {
            return($@"
<div class=""btn-group btn-group-sm"">
    <button class=""btn"" onclick=""{ModalUploadImage.GetOpenWindowString(siteInfo.Id, attributeName)}"">
        上传
    </button>
    <button class=""btn"" onclick=""{ModalSelectImage.GetOpenWindowString(siteInfo, attributeName)}"">
        选择
    </button>
    <button class=""btn"" onclick=""{ModalCuttingImage.GetOpenWindowStringWithTextBox(siteInfo.Id, attributeName)}"">
        裁切
    </button>
    <button class=""btn"" onclick=""{ModalMessage.GetOpenWindowStringToPreviewImage(siteInfo.Id, attributeName)}"">
        预览
    </button>
</div>
");
        }
示例#3
0
        private static string ParseImage(IAttributes attributes, SiteInfo siteInfo, int channelId, TableStyleInfo styleInfo, StringBuilder extraBuilder)
        {
            var btnAddHtml = string.Empty;

            if (channelId > 0)
            {
                btnAddHtml = $@"
    <button class=""btn"" onclick=""add_{styleInfo.AttributeName}('',true);return false;"">
        新增
    </button>
";
            }

            extraBuilder.Append($@"
<div class=""btn-group btn-group-sm"">
    <button class=""btn"" onclick=""{ModalUploadImage.GetOpenWindowString(siteInfo.Id, styleInfo.AttributeName)}"">
        上传
    </button>
    <button class=""btn"" onclick=""{ModalSelectImage.GetOpenWindowString(siteInfo, styleInfo.AttributeName)}"">
        选择
    </button>
    <button class=""btn"" onclick=""{ModalCuttingImage.GetOpenWindowStringWithTextBox(siteInfo.Id, styleInfo.AttributeName)}"">
        裁切
    </button>
    <button class=""btn"" onclick=""{ModalMessage.GetOpenWindowStringToPreviewImage(siteInfo.Id, styleInfo.AttributeName)}"">
        预览
    </button>
    {btnAddHtml}
</div>
");

            var attributeName       = styleInfo.AttributeName;
            var extendAttributeName = ContentAttribute.GetExtendAttributeName(styleInfo.AttributeName);

            extraBuilder.Append($@"
<script type=""text/javascript"">
function select_{styleInfo.AttributeName}(obj, index){{
  var cmd = ""{ModalSelectImage.GetOpenWindowString(siteInfo, styleInfo.AttributeName)}"".replace('{attributeName}', '{attributeName}_' + index).replace('return false;', '');
  eval(cmd);
}}
function upload_{attributeName}(obj, index){{
  var cmd = ""{ModalUploadImage.GetOpenWindowString(siteInfo.Id, attributeName)}"".replace('{attributeName}', '{attributeName}_' + index).replace('return false;', '');
  eval(cmd);
}}
function cutting_{attributeName}(obj, index){{
  var cmd = ""{ModalCuttingImage.GetOpenWindowStringWithTextBox(siteInfo.Id, attributeName)}"".replace('{attributeName}', '{attributeName}_' + index).replace('return false;', '');
  eval(cmd);
}}
function preview_{attributeName}(obj, index){{
  var cmd = ""{ModalMessage.GetOpenWindowStringToPreviewImage(siteInfo.Id, attributeName)}"".replace(/{attributeName}/g, '{attributeName}_' + index).replace('return false;', '');
  eval(cmd);
}}
function delete_{attributeName}(obj){{
  $(obj).parent().parent().parent().remove();
}}
var index_{attributeName} = 0;
function add_{attributeName}(val,foucs){{
    index_{attributeName}++;
    var inputHtml = '<input id=""{attributeName}_'+index_{attributeName}+'"" name=""{extendAttributeName}"" type=""text"" class=""form-control"" value=""'+val+'"" />';
    var btnHtml = '<div class=""btn-group btn-group-sm"">';
    btnHtml += '<button class=""btn"" href=""javascript:;"" onclick=""select_{attributeName}(this, '+index_{attributeName}+');return false;"">选择</button>';
    btnHtml += '<button class=""btn"" href=""javascript:;"" onclick=""upload_{attributeName}(this, '+index_{attributeName}+');return false;"">上传</button>';
    btnHtml += '<button class=""btn"" href=""javascript:;"" onclick=""cutting_{attributeName}(this, '+index_{attributeName}+');return false;"">裁切</button>';
    btnHtml += '<button class=""btn"" href=""javascript:;"" onclick=""preview_{attributeName}(this, '+index_{attributeName}+');return false;"">预览</button>';
    btnHtml += '<button class=""btn"" href=""javascript:;"" onclick=""delete_{attributeName}(this);return false;"">删除</button>';
    btnHtml += '</div>';
    var div = $('.{extendAttributeName}').length == 0 ? $('#{attributeName}').parent().parent() : $('.{extendAttributeName}:last');
    div.after('<div class=""form-group form-row {extendAttributeName}""><label class=""col-sm-1 col-form-label text-right""></label><div class=""col-sm-6"">' + inputHtml + '</div><div class=""col-sm-5"">' + btnHtml + '</div></div>');
    if (foucs) $('#{attributeName}_'+index_{attributeName}).focus();

}}
");

            var extendValues = attributes.GetString(extendAttributeName);

            if (!string.IsNullOrEmpty(extendValues))
            {
                foreach (var extendValue in TranslateUtils.StringCollectionToStringList(extendValues))
                {
                    if (!string.IsNullOrEmpty(extendValue))
                    {
                        extraBuilder.Append($"add_{attributeName}('{extendValue}',false);");
                    }
                }
            }

            extraBuilder.Append("</script>");

            return($@"<input id=""{attributeName}"" name=""{attributeName}"" type=""text"" class=""form-control"" value=""{attributes.GetString(attributeName)}"" />");
        }
示例#4
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _appointmentId     = Body.GetQueryInt("appointmentID");
            _appointmentItemId = Body.GetQueryInt("appointmentItemID");

            var selectImageClick  = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, TbContentImageUrl.ClientID);
            var uploadImageClick  = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, TbContentImageUrl.ClientID);
            var cuttingImageClick = ModalCuttingImage.GetOpenWindowStringWithTextBox(PublishmentSystemId, TbContentImageUrl.ClientID);
            var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(PublishmentSystemId, TbContentImageUrl.ClientID);

            LtlContentImageUrl.Text = $@"
                      <a class=""btn"" href=""javascript:;"" onclick=""{selectImageClick};return false;"" title=""选择""><i class=""icon-th""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{uploadImageClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{cuttingImageClick};return false;"" title=""裁切""><i class=""icon-crop""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{previewImageClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>";

            var selectVideoClick  = ModalSelectVideo.GetOpenWindowString(PublishmentSystemInfo, TbContentVideoUrl.ClientID);
            var uploadVideoClick  = ModalUploadVideo.GetOpenWindowStringToTextBox(PublishmentSystemId, TbContentVideoUrl.ClientID);
            var previewVideoClick = ModalMessage.GetOpenWindowStringToPreviewVideoByUrl(PublishmentSystemId, TbContentVideoUrl.ClientID);

            LtlContentVideoUrl.Text = $@"
                      <a class=""btn"" href=""javascript:;"" onclick=""{selectVideoClick};return false;"" title=""选择""><i class=""icon-th""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{uploadVideoClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{previewVideoClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>";

            if (!IsPostBack)
            {
                LtlTopImageUrl.Text =
                    $@"<img id=""preview_topImageUrl"" src=""{AppointmentManager.GetImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";

                if (_appointmentItemId > 0)
                {
                    var appointmentItemInfo = DataProviderWx.AppointmentItemDao.GetItemInfo(_appointmentItemId);
                    if (appointmentItemInfo != null)
                    {
                        TbTitle.Text                   = appointmentItemInfo.Title;
                        TopImageUrl.Value              = appointmentItemInfo.TopImageUrl;
                        CbIsDescription.Checked        = appointmentItemInfo.IsDescription;
                        TbDescriptionTitle.Text        = appointmentItemInfo.DescriptionTitle;
                        TbDescription.Text             = appointmentItemInfo.Description;
                        CbIsImageUrl.Checked           = appointmentItemInfo.IsImageUrl;
                        TbImageUrlTitle.Text           = appointmentItemInfo.ImageUrlTitle;
                        TbContentImageUrl.Text         = appointmentItemInfo.ImageUrl;
                        CbIsVideoUrl.Checked           = appointmentItemInfo.IsVideoUrl;
                        TbVideoUrlTitle.Text           = appointmentItemInfo.VideoUrlTitle;
                        TbContentVideoUrl.Text         = appointmentItemInfo.VideoUrl;
                        CbIsImageUrlCollection.Checked = appointmentItemInfo.IsImageUrlCollection;
                        TbImageUrlCollectionTitle.Text = appointmentItemInfo.ImageUrlCollectionTitle;
                        ImageUrlCollection.Value       = appointmentItemInfo.ImageUrlCollection;
                        LargeImageUrlCollection.Value  = appointmentItemInfo.LargeImageUrlCollection;
                        CbIsMap.Checked                = appointmentItemInfo.IsMap;
                        TbMapTitle.Text                = appointmentItemInfo.MapTitle;
                        TbMapAddress.Text              = appointmentItemInfo.MapAddress;
                        CbIsTel.Checked                = appointmentItemInfo.IsTel;
                        TbTelTitle.Text                = appointmentItemInfo.TelTitle;
                        TbTel.Text = appointmentItemInfo.Tel;

                        if (!string.IsNullOrEmpty(appointmentItemInfo.TopImageUrl))
                        {
                            LtlTopImageUrl.Text =
                                $@"<img id=""preview_topImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                    PublishmentSystemInfo, appointmentItemInfo.TopImageUrl)}"" width=""370"" align=""middle"" />";
                        }
                        if (!string.IsNullOrEmpty(appointmentItemInfo.MapAddress))
                        {
                            LtlMap.Text =
                                $@"<iframe style=""width:100%;height:100%;background-color:#ffffff;margin-bottom:15px;"" scrolling=""auto"" frameborder=""0"" width=""100%"" height=""100%"" src=""{MapManager.GetMapUrl(PublishmentSystemInfo, TbMapAddress.Text)}""></iframe>";
                        }
                        if (!string.IsNullOrEmpty(appointmentItemInfo.ImageUrlCollection))
                        {
                            var scriptBuilder = new StringBuilder();
                            scriptBuilder.AppendFormat(@"
addImage('{0}','{1}');
", appointmentItemInfo.ImageUrlCollection, appointmentItemInfo.LargeImageUrlCollection);

                            LtlScript.Text = $@"
$(document).ready(function(){{
	{scriptBuilder}
}});
";
                        }
                    }
                }
            }

            // this.btnAddImageUrl.Attributes.Add("onclick", Modal.AppointmentItemPhotoUpload.GetOpenWindowStringToAdd(base.PublishmentSystemId, this.imageUrlCollection.Value));
        }
示例#5
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemId");
            _view360Id = Body.GetQueryInt("view360ID");

            if (!IsPostBack)
            {
                var pageTitle = _view360Id > 0 ? "编辑360全景" : "添加360全景";

                BreadCrumb(AppManager.WeiXin.LeftMenu.IdFunction, AppManager.WeiXin.LeftMenu.Function.IdView360, pageTitle, AppManager.WeiXin.Permission.WebSite.View360);
                LtlPageTitle.Text = pageTitle;

                LtlImageUrl.Text =
                    $@"<img id=""preview_imageUrl"" src=""{View360Manager.GetImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";

                var selectImageClick  = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, TbContentImageUrl1.ClientID);
                var uploadImageClick  = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, TbContentImageUrl1.ClientID);
                var cuttingImageClick = ModalCuttingImage.GetOpenWindowStringWithTextBox(PublishmentSystemId, TbContentImageUrl1.ClientID);
                var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(PublishmentSystemId, TbContentImageUrl1.ClientID);
                LtlContentImageUrl1.Text = $@"
                      <a class=""btn"" href=""javascript:;"" onclick=""{selectImageClick};return false;"" title=""选择""><i class=""icon-th""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{uploadImageClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{cuttingImageClick};return false;"" title=""裁切""><i class=""icon-crop""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{previewImageClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>";

                LtlContentImageUrl2.Text = LtlContentImageUrl1.Text.Replace(TbContentImageUrl1.ClientID, TbContentImageUrl2.ClientID);
                LtlContentImageUrl3.Text = LtlContentImageUrl1.Text.Replace(TbContentImageUrl1.ClientID, TbContentImageUrl3.ClientID);
                LtlContentImageUrl4.Text = LtlContentImageUrl1.Text.Replace(TbContentImageUrl1.ClientID, TbContentImageUrl4.ClientID);
                LtlContentImageUrl5.Text = LtlContentImageUrl1.Text.Replace(TbContentImageUrl1.ClientID, TbContentImageUrl5.ClientID);
                LtlContentImageUrl6.Text = LtlContentImageUrl1.Text.Replace(TbContentImageUrl1.ClientID, TbContentImageUrl6.ClientID);

                if (_view360Id == 0)
                {
                    TbContentImageUrl1.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, string.Empty, 1);
                    TbContentImageUrl2.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, string.Empty, 2);
                    TbContentImageUrl3.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, string.Empty, 3);
                    TbContentImageUrl4.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, string.Empty, 4);
                    TbContentImageUrl5.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, string.Empty, 5);
                    TbContentImageUrl6.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, string.Empty, 6);
                }
                else
                {
                    var view360Info = DataProviderWx.View360Dao.GetView360Info(_view360Id);

                    TbKeywords.Text     = DataProviderWx.KeywordDao.GetKeywords(view360Info.KeywordId);
                    CbIsEnabled.Checked = !view360Info.IsDisabled;
                    TbTitle.Text        = view360Info.Title;
                    if (!string.IsNullOrEmpty(view360Info.ImageUrl))
                    {
                        LtlImageUrl.Text =
                            $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, view360Info.ImageUrl)}"" width=""370"" align=""middle"" />";
                    }
                    TbSummary.Text = view360Info.Summary;

                    TbContentImageUrl1.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, view360Info.ContentImageUrl1, 1);
                    TbContentImageUrl2.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, view360Info.ContentImageUrl2, 2);
                    TbContentImageUrl3.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, view360Info.ContentImageUrl3, 3);
                    TbContentImageUrl4.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, view360Info.ContentImageUrl4, 4);
                    TbContentImageUrl5.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, view360Info.ContentImageUrl5, 5);
                    TbContentImageUrl6.Text = View360Manager.GetContentImageUrl(PublishmentSystemInfo, view360Info.ContentImageUrl6, 6);

                    ImageUrl.Value = view360Info.ImageUrl;
                }

                BtnReturn.Attributes.Add("onclick",
                                         $@"location.href=""{PageView360.GetRedirectUrl(PublishmentSystemId)}"";return false");
            }
        }
示例#6
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemId");
            _appointmentId     = Body.GetQueryInt("appointmentID");
            _appointmentItemId = Body.GetQueryInt("appointmentItemID");

            var selectImageClick  = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, TbContentImageUrl.ClientID);
            var uploadImageClick  = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, TbContentImageUrl.ClientID);
            var cuttingImageClick = ModalCuttingImage.GetOpenWindowStringWithTextBox(PublishmentSystemId, TbContentImageUrl.ClientID);
            var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(PublishmentSystemId, TbContentImageUrl.ClientID);

            LtlContentImageUrl.Text = $@"
                      <a class=""btn"" href=""javascript:;"" onclick=""{selectImageClick};return false;"" title=""选择""><i class=""icon-th""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{uploadImageClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{cuttingImageClick};return false;"" title=""裁切""><i class=""icon-crop""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{previewImageClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>";

            var selectVideoClick  = ModalSelectVideo.GetOpenWindowString(PublishmentSystemInfo, TbContentVideoUrl.ClientID);
            var uploadVideoClick  = ModalUploadVideo.GetOpenWindowStringToTextBox(PublishmentSystemId, TbContentVideoUrl.ClientID);
            var previewVideoClick = ModalMessage.GetOpenWindowStringToPreviewVideoByUrl(PublishmentSystemId, TbContentVideoUrl.ClientID);

            LtlContentVideoUrl.Text = $@"
                      <a class=""btn"" href=""javascript:;"" onclick=""{selectVideoClick};return false;"" title=""选择""><i class=""icon-th""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{uploadVideoClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a>
                      <a class=""btn"" href=""javascript:;"" onclick=""{previewVideoClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>";

            if (!IsPostBack)
            {
                var pageTitle = _appointmentId > 0 ? "编辑微预约" : "添加微预约";
                BreadCrumb(AppManager.WeiXin.LeftMenu.IdFunction, AppManager.WeiXin.LeftMenu.Function.IdAppointment, pageTitle, AppManager.WeiXin.Permission.WebSite.Appointment);
                LtlPageTitle.Text = pageTitle;

                LtlImageUrl.Text =
                    $@"<img id=""preview_imageUrl"" src=""{AppointmentManager.GetImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";
                LtlTopImageUrl.Text =
                    $@"<img id=""preview_topImageUrl"" src=""{AppointmentManager.GetItemTopImageUrl(
                        PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";
                LtlResultTopImageUrl.Text =
                    $@"<img id=""preview_resultTopImageUrl"" src=""{AppointmentManager.GetContentResultTopImageUrl(
                        PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";
                LtlContentImageUrl.Text =
                    $@"<img id=""preview_contentImageUrl"" src=""{AppointmentManager.GetContentImageUrl(
                        PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";

                LtlEndImageUrl.Text =
                    $@"<img id=""preview_endImageUrl"" src=""{AppointmentManager.GetEndImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";

                if (_appointmentId == 0)
                {
                    DtbEndDate.DateTime = DateTime.Now.AddMonths(1);
                }
                else
                {
                    var appointmentInfo = DataProviderWx.AppointmentDao.GetAppointmentInfo(_appointmentId);

                    if (appointmentInfo != null)
                    {
                        TbKeywords.Text       = DataProviderWx.KeywordDao.GetKeywords(appointmentInfo.KeywordId);
                        CbIsEnabled.Checked   = !appointmentInfo.IsDisabled;
                        DtbStartDate.DateTime = appointmentInfo.StartDate;
                        DtbEndDate.DateTime   = appointmentInfo.EndDate;
                        TbTitle.Text          = appointmentInfo.Title;
                        if (!string.IsNullOrEmpty(appointmentInfo.ImageUrl))
                        {
                            LtlImageUrl.Text =
                                $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                    PublishmentSystemInfo, appointmentInfo.ImageUrl)}"" width=""370"" align=""middle"" />";
                        }
                        if (!string.IsNullOrEmpty(appointmentInfo.ContentResultTopImageUrl))
                        {
                            LtlResultTopImageUrl.Text =
                                $@"<img id=""preview_resultTopImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                    PublishmentSystemInfo, appointmentInfo.ContentResultTopImageUrl)}"" width=""370"" align=""middle"" />";
                        }

                        TbSummary.Text = appointmentInfo.Summary;

                        TbEndTitle.Text   = appointmentInfo.EndTitle;
                        TbEndSummary.Text = appointmentInfo.EndSummary;
                        if (!string.IsNullOrEmpty(appointmentInfo.EndImageUrl))
                        {
                            LtlEndImageUrl.Text =
                                $@"<img id=""preview_endImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                    PublishmentSystemInfo, appointmentInfo.EndImageUrl)}"" width=""370"" align=""middle"" />";
                        }

                        ImageUrl.Value          = appointmentInfo.ImageUrl;
                        ContentImageUrl.Value   = appointmentInfo.ContentImageUrl;
                        ResultTopImageUrl.Value = appointmentInfo.ContentResultTopImageUrl;
                        EndImageUrl.Value       = appointmentInfo.EndImageUrl;
                        #region 拓展属性
                        #region 姓名
                        if (appointmentInfo.IsFormRealName == "True")
                        {
                            CbIsFormRealName.Checked = true;
                            TbFormRealNameTitle.Text = appointmentInfo.FormRealNameTitle;
                        }
                        else if (string.IsNullOrEmpty(appointmentInfo.IsFormRealName))
                        {
                            CbIsFormRealName.Checked = true;
                            TbFormRealNameTitle.Text = "姓名";
                        }
                        else
                        {
                            CbIsFormRealName.Checked = false;
                            TbFormRealNameTitle.Text = appointmentInfo.FormRealNameTitle;
                        }
                        #endregion
                        #region 电话
                        if (appointmentInfo.IsFormMobile == "True")
                        {
                            CbIsFormMobile.Checked = true;
                            TbFormMobileTitle.Text = appointmentInfo.FormMobileTitle;
                        }
                        else if (string.IsNullOrEmpty(appointmentInfo.IsFormMobile))
                        {
                            CbIsFormMobile.Checked = true;
                            TbFormMobileTitle.Text = "电话";
                        }
                        else
                        {
                            CbIsFormMobile.Checked = false;
                            TbFormMobileTitle.Text = appointmentInfo.FormMobileTitle;
                        }
                        #endregion
                        #region 邮箱
                        if (appointmentInfo.IsFormEmail == "True")
                        {
                            CbIsFormEmail.Checked = true;
                            TbFormEmailTitle.Text = appointmentInfo.FormEmailTitle;
                        }
                        else if (string.IsNullOrEmpty(appointmentInfo.IsFormEmail))
                        {
                            CbIsFormEmail.Checked = true;
                            TbFormEmailTitle.Text = "电话";
                        }
                        else
                        {
                            CbIsFormEmail.Checked = false;
                            TbFormEmailTitle.Text = appointmentInfo.FormEmailTitle;
                        }
                        #endregion

                        _appointmentItemId = DataProviderWx.AppointmentItemDao.GetItemId(PublishmentSystemId, _appointmentId);

                        var configExtendInfoList = DataProviderWx.ConfigExtendDao.GetConfigExtendInfoList(PublishmentSystemId, appointmentInfo.Id, EKeywordTypeUtils.GetValue(EKeywordType.Appointment));
                        var itemBuilder          = new StringBuilder();
                        foreach (var configExtendInfo in configExtendInfoList)
                        {
                            if (string.IsNullOrEmpty(configExtendInfo.IsVisible))
                            {
                                configExtendInfo.IsVisible = "checked=checked";
                            }
                            else if (configExtendInfo.IsVisible == "True")
                            {
                                configExtendInfo.IsVisible = "checked=checked";
                            }
                            else
                            {
                                configExtendInfo.IsVisible = "";
                            }
                            itemBuilder.AppendFormat(@"{{id: '{0}', attributeName: '{1}',isVisible:'{2}'}},", configExtendInfo.Id, configExtendInfo.AttributeName, configExtendInfo.IsVisible);
                        }
                        if (itemBuilder.Length > 0)
                        {
                            itemBuilder.Length--;
                        }
                        LtlAwardItems.Text =
                            $@"itemController.itemCount = {configExtendInfoList.Count};itemController.items = [{itemBuilder}];";
                        #endregion
                    }
                }

                if (_appointmentItemId > 0)
                {
                    var appointmentItemInfo = DataProviderWx.AppointmentItemDao.GetItemInfo(_appointmentItemId);
                    if (appointmentItemInfo != null)
                    {
                        TbItemTitle.Text               = appointmentItemInfo.Title;
                        TopImageUrl.Value              = appointmentItemInfo.TopImageUrl;
                        CbIsDescription.Checked        = appointmentItemInfo.IsDescription;
                        TbDescriptionTitle.Text        = appointmentItemInfo.DescriptionTitle;
                        TbDescription.Text             = appointmentItemInfo.Description;
                        CbIsImageUrl.Checked           = appointmentItemInfo.IsImageUrl;
                        TbImageUrlTitle.Text           = appointmentItemInfo.ImageUrlTitle;
                        TbContentImageUrl.Text         = appointmentItemInfo.ImageUrl;
                        CbIsVideoUrl.Checked           = appointmentItemInfo.IsVideoUrl;
                        TbVideoUrlTitle.Text           = appointmentItemInfo.VideoUrlTitle;
                        TbContentVideoUrl.Text         = appointmentItemInfo.VideoUrl;
                        CbIsImageUrlCollection.Checked = appointmentItemInfo.IsImageUrlCollection;
                        TbImageUrlCollectionTitle.Text = appointmentItemInfo.ImageUrlCollectionTitle;
                        ImageUrlCollection.Value       = appointmentItemInfo.ImageUrlCollection;
                        LargeImageUrlCollection.Value  = appointmentItemInfo.LargeImageUrlCollection;
                        CbIsMap.Checked   = appointmentItemInfo.IsMap;
                        TbMapTitle.Text   = appointmentItemInfo.MapTitle;
                        TbMapAddress.Text = appointmentItemInfo.MapAddress;
                        CbIsTel.Checked   = appointmentItemInfo.IsTel;
                        TbTelTitle.Text   = appointmentItemInfo.TelTitle;
                        TbTel.Text        = appointmentItemInfo.Tel;


                        if (!string.IsNullOrEmpty(appointmentItemInfo.TopImageUrl))
                        {
                            LtlTopImageUrl.Text =
                                $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                    PublishmentSystemInfo, appointmentItemInfo.TopImageUrl)}"" width=""370"" align=""middle"" />";
                        }
                        if (!string.IsNullOrEmpty(appointmentItemInfo.MapAddress))
                        {
                            LtlMap.Text =
                                $@"<iframe style=""width:100%;height:100%;background-color:#ffffff;margin-bottom:15px;"" scrolling=""auto"" frameborder=""0"" width=""100%"" height=""100%"" src=""{MapManager.GetMapUrl(PublishmentSystemInfo, TbMapAddress.Text)}""></iframe>";
                        }
                        if (!string.IsNullOrEmpty(appointmentItemInfo.ImageUrlCollection))
                        {
                            var scriptBuilder = new StringBuilder();
                            scriptBuilder.AppendFormat(@"
addImage('{0}','{1}');
", appointmentItemInfo.ImageUrlCollection, appointmentItemInfo.LargeImageUrlCollection);

                            LtlScript.Text = $@"
$(document).ready(function(){{
	{scriptBuilder}
}});
";
                        }
                    }
                }

                BtnReturn.Attributes.Add("onclick",
                                         $@"location.href=""{PageAppointment.GetRedirectUrl(PublishmentSystemId)}"";return false");
            }
        }
示例#7
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemId");
            _conferenceId = Body.GetQueryInt("conferenceID");

            if (!IsPostBack)
            {
                var pageTitle = _conferenceId > 0 ? "编辑会议(活动)" : "添加会议(活动)";
                BreadCrumb(AppManager.WeiXin.LeftMenu.IdFunction, AppManager.WeiXin.LeftMenu.Function.IdConference, pageTitle, AppManager.WeiXin.Permission.WebSite.Conference);
                LtlPageTitle.Text = pageTitle;

                LtlImageUrl.Text =
                    $@"<img id=""preview_imageUrl"" src=""{ConferenceManager.GetImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";
                LtlBackgroundImageUrl.Text =
                    $@"{ComponentsManager.GetBackgroundImageSelectHtml(PublishmentSystemInfo, string.Empty)}<hr /><img id=""preview_backgroundImageUrl"" src=""{ComponentsManager
                        .GetBackgroundImageUrl(PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";
                LtlEndImageUrl.Text =
                    $@"<img id=""preview_endImageUrl"" src=""{ConferenceManager.GetEndImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";

                var selectImageClick  = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, "itemPicUrl_");
                var uploadImageClick  = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, "itemPicUrl_");
                var cuttingImageClick = ModalCuttingImage.GetOpenWindowStringWithTextBox(PublishmentSystemId, "itemPicUrl_");
                var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(PublishmentSystemId, "itemPicUrl_");
                LtlGuestScript.Text =
                    $@"guestController.selectImageClickString = ""{selectImageClick}"";guestController.uploadImageClickString = ""{uploadImageClick}"";guestController.cuttingImageClickString = ""{cuttingImageClick}"";guestController.previewImageClickString = ""{previewImageClick}"";";

                if (_conferenceId == 0)
                {
                    LtlAgendaScript.Text += "agendaController.agendaCount = 2;agendaController.items = [{}, {}];";
                    LtlGuestScript.Text  += "guestController.guestCount = 2;guestController.items = [{}, {}];";
                    DtbEndDate.DateTime   = DateTime.Now.AddMonths(1);
                }
                else
                {
                    var conferenceInfo = DataProviderWx.ConferenceDao.GetConferenceInfo(_conferenceId);

                    TbKeywords.Text       = DataProviderWx.KeywordDao.GetKeywords(conferenceInfo.KeywordId);
                    CbIsEnabled.Checked   = !conferenceInfo.IsDisabled;
                    DtbStartDate.DateTime = conferenceInfo.StartDate;
                    DtbEndDate.DateTime   = conferenceInfo.EndDate;
                    TbTitle.Text          = conferenceInfo.Title;
                    if (!string.IsNullOrEmpty(conferenceInfo.ImageUrl))
                    {
                        LtlImageUrl.Text =
                            $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, conferenceInfo.ImageUrl)}"" width=""370"" align=""middle"" />";
                    }
                    TbSummary.Text = conferenceInfo.Summary;
                    if (!string.IsNullOrEmpty(conferenceInfo.BackgroundImageUrl))
                    {
                        LtlBackgroundImageUrl.Text =
                            $@"{ComponentsManager.GetBackgroundImageSelectHtml(PublishmentSystemInfo, conferenceInfo.BackgroundImageUrl)}<hr /><img id=""preview_backgroundImageUrl"" src=""{ComponentsManager
                                .GetBackgroundImageUrl(PublishmentSystemInfo, conferenceInfo.BackgroundImageUrl)}"" width=""370"" align=""middle"" />";
                    }

                    TbConferenceName.Text = conferenceInfo.ConferenceName;
                    TbAddress.Text        = conferenceInfo.Address;
                    TbDuration.Text       = conferenceInfo.Duration;
                    BreIntroduction.Text  = conferenceInfo.Introduction;

                    CbIsAgenda.Checked = conferenceInfo.IsAgenda;
                    TbAgendaTitle.Text = conferenceInfo.AgendaTitle;
                    var agendaInfoList = new List <ConferenceAgendaInfo>();
                    agendaInfoList = TranslateUtils.JsonToObject(conferenceInfo.AgendaList, agendaInfoList) as List <ConferenceAgendaInfo>;
                    if (agendaInfoList != null)
                    {
                        var agendaBuilder = new StringBuilder();
                        foreach (var agendaInfo in agendaInfoList)
                        {
                            agendaBuilder.AppendFormat(@"{{dateTime: '{0}', title: '{1}', summary: '{2}'}},", agendaInfo.DateTime, agendaInfo.Title, agendaInfo.Summary);
                        }
                        if (agendaBuilder.Length > 0)
                        {
                            agendaBuilder.Length--;
                        }

                        LtlAgendaScript.Text +=
                            $@"agendaController.agendaCount = {agendaInfoList.Count};agendaController.items = [{agendaBuilder}];";
                    }
                    else
                    {
                        LtlAgendaScript.Text += "agendaController.agendaCount = 0;agendaController.items = [{}];";
                    }

                    CbIsGuest.Checked = conferenceInfo.IsGuest;
                    TbGuestTitle.Text = conferenceInfo.GuestTitle;
                    var guestInfoList = new List <ConferenceGuestInfo>();
                    guestInfoList = TranslateUtils.JsonToObject(conferenceInfo.GuestList, guestInfoList) as List <ConferenceGuestInfo>;
                    if (guestInfoList != null)
                    {
                        var guestBuilder = new StringBuilder();
                        foreach (var guestInfo in guestInfoList)
                        {
                            guestBuilder.AppendFormat(@"{{displayName: '{0}', position: '{1}', picUrl: '{2}'}},", guestInfo.DisplayName, guestInfo.Position, guestInfo.PicUrl);
                        }
                        if (guestBuilder.Length > 0)
                        {
                            guestBuilder.Length--;
                        }

                        LtlGuestScript.Text +=
                            $@"guestController.guestCount = {guestInfoList.Count};guestController.items = [{guestBuilder}];";
                    }
                    else
                    {
                        LtlGuestScript.Text += "guestController.guestCount = 0;guestController.items = [{}];";
                    }

                    TbEndTitle.Text   = conferenceInfo.EndTitle;
                    TbEndSummary.Text = conferenceInfo.EndSummary;
                    if (!string.IsNullOrEmpty(conferenceInfo.EndImageUrl))
                    {
                        LtlEndImageUrl.Text =
                            $@"<img id=""preview_endImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, conferenceInfo.EndImageUrl)}"" width=""370"" align=""middle"" />";
                    }

                    ImageUrl.Value           = conferenceInfo.ImageUrl;
                    BackgroundImageUrl.Value = conferenceInfo.BackgroundImageUrl;
                    EndImageUrl.Value        = conferenceInfo.EndImageUrl;
                }

                BtnReturn.Attributes.Add("onclick",
                                         $@"location.href=""{PageConference.GetRedirectUrl(PublishmentSystemId)}"";return false");
            }
        }
示例#8
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemId");
            _voteId = Body.GetQueryInt("voteID");

            if (!IsPostBack)
            {
                var pageTitle = _voteId > 0 ? "编辑投票活动" : "添加投票活动";
                BreadCrumb(AppManager.WeiXin.LeftMenu.IdFunction, AppManager.WeiXin.LeftMenu.Function.IdVote, pageTitle, AppManager.WeiXin.Permission.WebSite.Vote);
                LtlPageTitle.Text = pageTitle;

                var listItem = new ListItem("文字类型投票", "false");
                DdlContentIsImageOption.Items.Add(listItem);
                listItem = new ListItem("图文类型投票", "true");
                DdlContentIsImageOption.Items.Add(listItem);

                DdlContentIsImageOption.Attributes.Add("onchange", "itemController.isImageOptionChange(this)");
                EBooleanUtils.AddListItems(DdlContentIsCheckBox, "多选", "单选");
                ControlUtils.SelectListItems(DdlContentIsCheckBox, false.ToString());

                LtlImageUrl.Text =
                    $@"<img id=""preview_imageUrl"" src=""{VoteManager.GetImageUrl(PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";
                LtlContentImageUrl.Text =
                    $@"<img id=""preview_contentImageUrl"" src=""{VoteManager.GetContentImageUrl(
                        PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";
                LtlEndImageUrl.Text =
                    $@"<img id=""preview_endImageUrl"" src=""{VoteManager.GetEndImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";

                var selectImageClick  = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, "itemImageUrl_");
                var uploadImageClick  = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, "itemImageUrl_");
                var cuttingImageClick = ModalCuttingImage.GetOpenWindowStringWithTextBox(PublishmentSystemId, "itemImageUrl_");
                var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(PublishmentSystemId, "itemImageUrl_");
                LtlVoteItems.Text =
                    $@"itemController.selectImageClickString = ""{selectImageClick}"";itemController.uploadImageClickString = ""{uploadImageClick}"";itemController.cuttingImageClickString = ""{cuttingImageClick}"";itemController.previewImageClickString = ""{previewImageClick}"";";

                if (_voteId == 0)
                {
                    LtlVoteItems.Text  += "itemController.isImageOption = false;itemController.itemCount = 2;itemController.items = [{}, {}];";
                    DtbEndDate.DateTime = DateTime.Now.AddMonths(1);
                }
                else
                {
                    var voteInfo = DataProviderWx.VoteDao.GetVoteInfo(_voteId);

                    TbKeywords.Text       = DataProviderWx.KeywordDao.GetKeywords(voteInfo.KeywordId);
                    CbIsEnabled.Checked   = !voteInfo.IsDisabled;
                    DtbStartDate.DateTime = voteInfo.StartDate;
                    DtbEndDate.DateTime   = voteInfo.EndDate;
                    TbTitle.Text          = voteInfo.Title;
                    if (!string.IsNullOrEmpty(voteInfo.ImageUrl))
                    {
                        LtlImageUrl.Text =
                            $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, voteInfo.ImageUrl)}"" width=""370"" align=""middle"" />";
                    }
                    TbSummary.Text = voteInfo.Summary;
                    if (!string.IsNullOrEmpty(voteInfo.ContentImageUrl))
                    {
                        LtlContentImageUrl.Text =
                            $@"<img id=""preview_contentImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, voteInfo.ContentImageUrl)}"" width=""370"" align=""middle"" />";
                    }

                    TbContentDescription.Text = voteInfo.ContentDescription;
                    //ControlUtils.SelectListItems(this.ddlContentResultVisible, voteInfo.ContentResultVisible);
                    ControlUtils.SelectListItems(DdlContentIsImageOption, voteInfo.ContentIsImageOption.ToLower());
                    ControlUtils.SelectListItems(DdlContentIsCheckBox, voteInfo.ContentIsCheckBox);

                    var voteItemInfoList = DataProviderWx.VoteItemDao.GetVoteItemInfoList(_voteId);
                    var itemBuilder      = new StringBuilder();
                    foreach (var itemInfo in voteItemInfoList)
                    {
                        itemBuilder.AppendFormat(@"{{id: '{0}', title: '{1}', imageUrl: '{2}', navigationUrl: '{3}', voteNum: '{4}'}},", itemInfo.Id, itemInfo.Title, itemInfo.ImageUrl, itemInfo.NavigationUrl, itemInfo.VoteNum);
                    }
                    if (itemBuilder.Length > 0)
                    {
                        itemBuilder.Length--;
                    }

                    LtlVoteItems.Text += $@"
itemController.isImageOption = {voteInfo.ContentIsImageOption.ToLower()};itemController.itemCount = {voteItemInfoList
                        .Count};itemController.items = [{itemBuilder}];";

                    TbEndTitle.Text   = voteInfo.EndTitle;
                    TbEndSummary.Text = voteInfo.EndSummary;
                    if (!string.IsNullOrEmpty(voteInfo.EndImageUrl))
                    {
                        LtlEndImageUrl.Text =
                            $@"<img id=""preview_endImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, voteInfo.EndImageUrl)}"" width=""370"" align=""middle"" />";
                    }

                    ImageUrl.Value        = voteInfo.ImageUrl;
                    ContentImageUrl.Value = voteInfo.ContentImageUrl;
                    EndImageUrl.Value     = voteInfo.EndImageUrl;
                }

                BtnReturn.Attributes.Add("onclick",
                                         $@"location.href=""{PageVote.GetRedirectUrl(PublishmentSystemId)}"";return false");
            }
        }