/// <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); }
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'"); }
/// <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); } }
/// <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); }