username@email.com
2025-05-12 ae6e40362a745caef9ead36f81f38313fb8c2c66
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
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.InfoManage
{
    //吴辉
    //添加/修改友情链接
    public partial class Info_AllianceLink : BasePage
    {
        Info_AllianceBLL bll_Info_AllianceBLL = null;
        Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
 
        //初始化
        public Info_AllianceLink()
        {
            bll_Info_AllianceBLL = new Info_AllianceBLL();
            bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitData();
            }
        }
 
        //页面加载
        public void InitData()
        {
            Info_Alliance m_Info_Alliance = new Info_Alliance();
            if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
                m_Info_Alliance = bll_Info_AllianceBLL.SelectModelByKeyId(Request["Keyid"].ToInt32());
            if (m_Info_Alliance != null && m_Info_Alliance.Keyid != null)
            {
                this.txtTitle.Value = m_Info_Alliance.Title.ToString2();
                this.txtOrderNum.Value = m_Info_Alliance.OrderNum.ToString2();
                this.showImg.Visible = true;
                this.showImg.HRef = m_Info_Alliance.InfoContent;
            }
            else
            {
                this.showImg.Visible = false;
            }
        }
 
 
        //提交事件
        protected void btn_Submit_form(object sender, EventArgs e)
        {
            Info_Alliance m_Info_Alliance = new Info_Alliance();
            if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
                m_Info_Alliance = bll_Info_AllianceBLL.SelectModelByKeyId(Request["Keyid"].ToInt32());
 
            //图片上传
            CY.WebForm.cs.UploadCS.UpFileResult _UpFileResult2 = CY.WebForm.cs.UploadCS.Upload("txtInfoContent", m_Info_Alliance.InfoContent);
            m_Info_Alliance.InfoContent = m_Info_Alliance.InfoContent ?? "";
            if (_UpFileResult2.returnerror.Count == 0)
            {
                if (_UpFileResult2.returnfilename.Count > 0)
                    m_Info_Alliance.InfoContent = _UpFileResult2.returnfilename[0].ToString2();
            }
            else
            {
                JavaScript.MessageBox(string.Join("<br/>", (string[])_UpFileResult2.returnerror.ToArray(typeof(string))), this);
                return;
            }
            m_Info_Alliance.Title = this.txtTitle.Value.ToString2();
            m_Info_Alliance.OrderNum = this.txtOrderNum.Value.ToInt32();
            m_Info_Alliance.LastUpdateTime = DateTime.Now;
            m_Info_Alliance.Operator = CurrentUser.ShortName;
            m_Info_Alliance.Type = "友情链接";
 
            if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
            {
                if (bll_Info_AllianceBLL.UpdateModel(m_Info_Alliance))
                    JavaScript.MessageBox("更新成功", this, true,true);
                else
                    JavaScript.MessageBox("更新失败", this);
            }
            else
            {
                m_Info_Alliance.CreatTime = DateTime.Now;
 
                if (bll_Info_AllianceBLL.InsertModel(m_Info_Alliance))
                    JavaScript.MessageBox("发布成功", this,true,true);
                else
                    JavaScript.MessageBox("发布失败", this);
            }
        }
 
 
    }
}