Example #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Id"] == null)
            {
                return;
            }
            string content = Request.Form["editor1"] == null ? "" : Request.Form["editor1"];

            Maticsoft.BLL.tAbout   bll   = new Maticsoft.BLL.tAbout();
            Maticsoft.Model.tAbout model = bll.GetModel(int.Parse(Request.QueryString["Id"]));
            if (model == null)
            {
                return;
            }
            model.AboutContent = content;
            model.Remark       = txtRemark.Text;
            if (bll.Update(model))
            {
                Alert.ShowInTop("保存成功!");
            }
            else
            {
                Alert.ShowInTop("保存失败!");
            }
        }
Example #2
0
 public Maticsoft.Model.tAbout About(int id)
 {
     Maticsoft.BLL.tAbout   BLL   = new Maticsoft.BLL.tAbout();
     Maticsoft.Model.tAbout model = BLL.GetModel(id);
     //model.Click = (model.Click + 1);
     //BLL.Update(model);
     return(model);
 }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Maticsoft.BLL.tAbout   BLL  = new Maticsoft.BLL.tAbout();
         Maticsoft.Model.tAbout menu = BLL.GetModel(8);
         lit_content.Text = menu == null?"": menu.AboutContent;
     }
 }
Example #4
0
        /// <summary>
        /// 根据ArtGuid 来给控件赋值
        /// </summary>
        /// <param name="ArtGuid"></param>
        public void UpMenuModel(string ArtGuid)
        {
            Maticsoft.BLL.tAbout   BLL = new Maticsoft.BLL.tAbout();
            Maticsoft.Model.tAbout m   = BLL.GetModel(int.Parse(ArtGuid));

            txtName.Text = m.Title;

            txtSort.Text = m.Sort.ToString();
        }
Example #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Request.QueryString["pageId"]))
            {
                Maticsoft.BLL.tAbout BLL = new Maticsoft.BLL.tAbout();
                int pageId = int.Parse(Request.QueryString["pageId"]);
                Maticsoft.Model.tAbout menu = BLL.GetModel(pageId);
                if (BLL.GetList(string.Format(" Title='{0}' and Id<>{1} ", txtName.Text, pageId)).Tables[0].Rows.Count >= 1)
                {
                    Alert.ShowInTop("该名称已经存在!"); return;
                }

                menu.Id    = pageId;
                menu.Title = txtName.Text.ToString().Trim();

                menu.Sort = Convert.ToInt32(txtSort.Text.ToString().Trim());

                if (BLL.Update(menu) == true)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("操作失败!");
                }
            }
            else
            {
                Maticsoft.BLL.tAbout   BLL  = new Maticsoft.BLL.tAbout();
                Maticsoft.Model.tAbout menu = new Maticsoft.Model.tAbout();
                if (BLL.GetList(string.Format(" Title='{0}' ", txtName.Text)).Tables[0].Rows.Count >= 1)
                {
                    Alert.ShowInTop("该名称已经存在!"); return;
                }

                menu.Title = txtName.Text.ToString().Trim();
                menu.Sort  = Convert.ToInt32(txtSort.Text.ToString().Trim());

                if (BLL.Add(menu) >= 1)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("操作失败!");
                }
            }
        }
Example #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["Id"] != null)
         {
             Maticsoft.BLL.tAbout   bll   = new Maticsoft.BLL.tAbout();
             Maticsoft.Model.tAbout model = bll.GetModel(int.Parse(Request.QueryString["Id"]));
             if (model == null)
             {
                 return;
             }
             hfEditorInitValue.Text = model.AboutContent;
             txtRemark.Text         = model.Remark;
             btnSave.Text           = model.Title + "-" + "保存";
         }
     }
 }
Example #7
0
        protected void getNav(int tId)
        {
            StringBuilder sb = new StringBuilder();

            BLL.tAbout          bll  = new Maticsoft.BLL.tAbout();
            List <Model.tAbout> list = null;

            if (tId <= 6)
            {
                list = bll.GetModelList(string.Format(" Id<={0} ", 6));
            }
            else if (tId == 7)
            {
                list = bll.GetModelList(string.Format(" Id={0} ", tId));
            }
            else if (tId > 8)
            {
                list = bll.GetModelList(string.Format(" Id>{0} ", 8));
            }
            foreach (Model.tAbout m in list)
            {
                if (m.Id == tId)
                {
                    typeName         = m.Title;
                    this.Title       = m.Title;
                    lit_content.Text = m.AboutContent;

                    sb.Append("<div class=\"df f-ac tab-content tab-active\" data-title=\"" + m.Title + "\">");
                }
                else
                {
                    sb.Append("<div class=\"df f-ac tab-content\" data-title=\"" + m.Title + "\">");
                }

                sb.Append("<div class=\"fs-1 fw-b\">");
                sb.Append("<img src=\"images/list-icon-active.png\" />");
                sb.Append("</div>");
                sb.Append("<div class=\"tab-title\"><a href=\"single.aspx?Id=" + m.Id + "\">" + m.Title + "</a></div>");
                sb.Append("</div>");
            }
            lit_nav.Text = sb.ToString();
        }