Ejemplo n.º 1
0
        /// <summary>
        /// 添加风格
        /// </summary>
        /// <param name="style"></param>
        /// <param name="operatorAccount"></param>
        public static void InsertOEMStyle(OEMStyle style, string operatorAccount)
        {
            style.Id = Guid.NewGuid();
            var repository = Factory.CreateOEMStyleRepository();

            repository.Insert(style);
        }
Ejemplo n.º 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'");
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 修改风格
        /// </summary>
        /// <param name="style"></param>
        /// <param name="operatorAccount"></param>
        public static void UpdateOEMStyle(OEMStyle style, string operatorAccount)
        {
            var repository = Factory.CreateOEMStyleRepository();

            repository.Update(style);
        }