username@email.com
2025-05-15 6fe02a16e55f17e45a3997171e1b2284d45af25b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.Model;
using CY.BLL;
using CY.Infrastructure.Common;
using System.Data;
using CY.BLL.Sys;
 
namespace CY.WebForm.Pages.member
{
    //吴辉
    //添加/修改设备展示
    public partial class EquipmentEdit : BasePage
    {
        Info_SortBLL bll_Info_SortBLL = null;
        Info_ContentBLL bll_Info_ContentBLL = null;
        Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
 
        //初始化
        public EquipmentEdit()
        {
            bll_Info_SortBLL = new Info_SortBLL();
            bll_Info_ContentBLL = new Info_ContentBLL();
            bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitData();
            }
        }
 
        //页面加载
        public void InitData()
        {
            this.selSortId.Items.Clear();
            this.selSortId.Items.Insert(0, new ListItem("设备展示", bll_Sys_DictionaryBLL.GetKeyIdByKeyid(7, "网站资讯类型").ToString2()));
 
            Info_Content m_Info_Content = new Info_Content();
            if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
                m_Info_Content = bll_Info_ContentBLL.SelectModelBySortId(Request["Keyid"].ToInt32());
 
            this.txtTitle.Value = m_Info_Content.Title.ToString2();
            this.selSortId.Value = m_Info_Content.SortID.ToString2();
            this.txtInfoContent.Text = m_Info_Content.InfoContent.ToString2();
            this.txtOrderNum.Value = m_Info_Content.OrderNum.ToString2();
 
        }
 
        //提交事件
        protected void btn_Submit_form(object sender, EventArgs e)
        {
            Info_Content m_Info_Content = new Info_Content();
            if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
                m_Info_Content = bll_Info_ContentBLL.SelectModelBySortId(Request["Keyid"].ToInt32());
 
            m_Info_Content.Title = this.txtTitle.Value.ToString2();
            m_Info_Content.Title_Bold = false;
            m_Info_Content.Title_Color = "";
            m_Info_Content.SortID = this.selSortId.Value.ToInt32();
            m_Info_Content.Keyword = this.txtTitle.Value.ToString2();
            m_Info_Content.MeteDesc = this.txtTitle.Value.ToString2();
            m_Info_Content.FromSource = "";
            m_Info_Content.Author = "";
            m_Info_Content.WebLink = "";
            m_Info_Content.IsRecommendation = false;
            m_Info_Content.IsTop = false;
            m_Info_Content.InfoContent = this.txtInfoContent.Text.ToString2();
            m_Info_Content.OrderNum = this.txtOrderNum.Value.ToInt32();
            m_Info_Content.UpTime = DateTime.Now;
 
            if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
            {
                if (bll_Info_ContentBLL.UpdateModel(m_Info_Content))
                    JavaScript.MessageBox("更新成功", this, true, true);
                else
                    JavaScript.MessageBox("更新失败", this);
            }
            else
            {
                m_Info_Content.MemberId = CurrentUser.MemberId;
                m_Info_Content.Star = 0;
                m_Info_Content.Hits = 0;
                m_Info_Content.GoodNum = 0;
                m_Info_Content.MediumNum = 0;
                m_Info_Content.BadNum = 0;
                m_Info_Content.CreatTime = DateTime.Now;
                m_Info_Content.TypeId = bll_Sys_DictionaryBLL.GetKeyIdByKeyid(7, "网站资讯类型").ToInt32();
 
                if (bll_Info_ContentBLL.InsertModel(m_Info_Content))
                    JavaScript.MessageBox("新增成功", this, true, true);
                else
                    JavaScript.MessageBox("新增失败", this);
            }
        }
 
 
    }
}