Пример #1
0
 protected void btnEnter_Click(object sender, EventArgs e)
 {
     WeiSha.Common.Templates.TemplateBank tmp = WeiSha.Common.Template.GetTemplate(type, tag);
     tmp.Name    = tbName.Text.Trim();
     tmp.Author  = tbAuthor.Text.Trim();
     tmp.Phone   = tbPhone.Text.Trim();
     tmp.QQ      = tbQQ.Text.Trim();
     tmp.CrtTime = Convert.ToDateTime(tbCrtTime.Text);
     tmp.Intro   = tbIntro.Text.Trim();
     //图片
     if (fuLoad.PostedFile.FileName != "")
     {
         try
         {
             fuLoad.NewName      = "logo.jpg";
             fuLoad.IsConvertJpg = true;
             fuLoad.SaveAs(this.Server.MapPath(tmp.Logo));
             WeiSha.Common.Images.FileTo.Zoom(this.Server.MapPath(tmp.Logo), 200, 200, false);
             imgShow.Src = tmp.Logo + "?s=" + DateTime.Now.Ticks;
         }
         catch (Exception ex)
         {
             this.Alert(ex.Message);
         }
     }
     tmp.Save();
     WeiSha.Common.Template.RefreshTemplate();
     Master.AlertCloseAndRefresh("操作成功!");
 }
Пример #2
0
 /// <summary>
 /// 更改模板信息
 /// </summary>
 /// <param name="tmp"></param>
 /// <returns></returns>
 public WeiSha.Common.Templates.TemplateBank Save(WeiSha.Common.Templates.TemplateBank tmp)
 {
     tmp.Save();
     return(tmp);
 }