示例#1
0
        private void LoadStyleSet(Guid styleId)
        {
            var style = OEMStyleService.QueryOEMStyle(styleId);

            if (style != null)
            {
                hdStyleId.Value              = style.Id.ToString();
                txtKeyWord.Value             = style.StyleName;
                txtTemplatePath.Value        = style.TemplatePath;
                txtThumbnailPicture.Value    = style.ThumbnailPicture;
                txtTemplateIndex.Value       = style.Sort.ToString();
                txtTemplateDescription.Value = style.Remark;
                if (style.Enable)
                {
                    radTemplateEnabled.Checked = true;
                }
                else
                {
                    radTemplateDisabled.Checked = true;
                }
                style.StylePath.AddRange(Enumerable.Range(1, 3).Select(p => string.Empty));
                rpStyleFilePath.DataSource = style.StylePath;
                rpStyleFilePath.DataBind();
            }
            hdStyleId.Value = styleId.ToString();
        }
示例#2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var style = new OEMStyle();

            style.StyleName        = txtKeyWord.Value.Trim();
            style.StylePath        = new List <string>();
            style.TemplatePath     = txtTemplatePath.Value.Trim();
            style.ThumbnailPicture = txtThumbnailPicture.Value.Trim();
            style.Remark           = txtTemplateDescription.Value.Trim();
            style.Sort             = int.Parse(txtTemplateIndex.Value.Trim());
            style.Enable           = radTemplateEnabled.Checked;
            foreach (RepeaterItem item in rpStyleFilePath.Items)
            {
                var pathContainer = item.FindControl("txtStyleFilePath") as HtmlInputText;
                if (pathContainer != null && !string.IsNullOrEmpty(pathContainer.Value))
                {
                    style.StylePath.Add(pathContainer.Value.Trim());
                }
            }
            var styleId = Request.QueryString["styleId"];

            if (!string.IsNullOrEmpty(styleId))
            {
                style.Id = Guid.Parse(styleId);
                OEMStyleService.UpdateOEMStyle(style, CurrentUser.UserName);
            }
            else
            {
                style.Id = Guid.NewGuid();
                OEMStyleService.InsertOEMStyle(style, CurrentUser.UserName);
            }
            RegisterScript(this, "alert('保存成功!');location.href='OrganizationModule/TerraceModule/DistributionOEMSiteStyleManage.aspx'");
        }
示例#3
0
 /// <summary>
 /// 保存OME风格
 /// </summary>
 /// <param name="style"></param>
 /// <param name="oemId"> </param>
 public void SaveOEMStyle(OEMStyle style)
 {
     style.StylePath = style.StylePath.Where(p => !string.IsNullOrWhiteSpace(p)).ToList();
     if (style.Id == Guid.Empty)
     {
         style.Id = Guid.NewGuid();
         OEMStyleService.InsertOEMStyle(style, CurrentUser.UserName);
     }
     else
     {
         OEMStyleService.UpdateOEMStyle(style, CurrentUser.UserName);
         FlushRequester.TriggerOEMStyleFlusher(style.Id);
     }
 }
示例#4
0
        private void LoadStyle(OEMInfo oem)
        {
            string str = "";
            int    i   = 0;

            foreach (var item in OEMStyleService.QueryOEMVailStyles())
            {
                if (oem.OEMStyle != null && item.Id == oem.OEMStyle.Id)
                {
                    hidValue.Value = item.Id.ToString();
                }
                str += "<li for='s" + i + "'><img  title='" + item.Remark + "' src='" + item.ThumbnailPicture
                       + "' for='s" + i + "' /><p class='bor'>" + item.StyleName + "</p><p><input type='radio' " +
                       "name='radChooice' value='" + item.Id + "' id='s" + i + "' " + (oem.OEMStyle != null && item.Id == oem.OEMStyle.Id
                                                                                           ? "checked='checked'"
                                                                                           : "") + " /><label for='s" + i + "'>设为默认</label></p></li>";
                i++;
            }
            ulHtml.InnerHtml = str;
        }
示例#5
0
 public void DeleteStyle(Guid styleId)
 {
     OEMStyleService.DeleteOEMStyle(styleId, CurrentUser.UserName);
 }