Esempio n. 1
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'");
        }
Esempio n. 2
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);
     }
 }