Web/Admin/News/content_annex.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System.Data;
using System.IO;
using Bocent.Lib;

namespace Bocent.Web.Admin.News
{
    public partial class content_annex : AspxBase
    {
        protected Model.News.content_annex Item = new Model.News.content_annex();
        protected override void process()
        {
            Item.ID = Function.CInt(Request["ID"]);
            Item.NewsID = Function.CInt(Request["NewsID"]);
            if (TAB.Exists("news_content_annex", _.array(new string[] { "ID=>" + Item.ID, "NewsID=>" + Item.NewsID })))
            {
                var annex = TAB.GetModel("news_content_annex", _.array(new string[] { "ID=>" + Item.ID, "NewsID=>" + Item.NewsID }));

                Item.ID = (int)annex["ID"];
                Item.NewsID = (int)annex["NewsID"];
                Item.FileName = annex["FileName"].ToString();
                Item.FileType = (int)annex["FileType"];
                Item.FilePath = annex["FileName"].ToString();
                Item.FileSize = (int)annex["FileSize"];
                Item.Height = (int)annex["Height"];
                Item.Width = (int)annex["Width"];
                Item.Align = annex["Align"].ToString();
                Item.OrderNo = (int)annex["OrderNo"];
                Item.IsDefault = (int)annex["IsDefault"];
                Item.IsRecommend = (int)annex["IsRecommend"];

                string sqlstr = string.Format("(NewsID = {0})", Item.NewsID);
                LastID = GetLastID("news_content_annex", "ID", Item.ID, 0, sqlstr).ToString();
                NextID = GetNextID("news_content_annex", "ID", Item.ID, 0, sqlstr).ToString();
            }

            pager.PageSize = 10;
            string where = string.Format("(NewsID = {0})", Item.NewsID);
            DataSet ds = TAB.GetList("news_content_annex", pager, "ID ASC", where);

            var wjdt = _.array(new string[] { "0=>文件", "1=>图片", "2=>视频", "3=>动画" });
            ds.Tables[0].Columns.Add("TypeName", System.Type.GetType("System.String"));
            ds.Tables[0].Columns.Add("Reference", System.Type.GetType("System.String"));
            ds.Tables[0].Columns.Add("FileIcon", System.Type.GetType("System.String"));
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                ds.Tables[0].Rows[i].BeginEdit();
                if (wjdt != null && wjdt.ContainsKey(ds.Tables[0].Rows[i]["FileType"].ToString()))
                {
                    ds.Tables[0].Rows[i]["TypeName"] = wjdt[ds.Tables[0].Rows[i]["FileType"].ToString()];
                    ds.Tables[0].Rows[i]["Reference"] = string.Format("{{${0}{1}}}", 
                        wjdt[ds.Tables[0].Rows[i]["FileType"].ToString()], ds.Tables[0].Rows[i]["ID"]);
                }
                if ((int)ds.Tables[0].Rows[i]["FileType"] == 1)
                {
                    ds.Tables[0].Rows[i]["FileIcon"] = string.Format("/{0}", ds.Tables[0].Rows[i]["FilePath"]);
                }
                else
                {
                    string ext = Path.GetExtension(ds.Tables[0].Rows[i]["FilePath"].ToString()).Replace(".", "");                    
                    if (File.Exists(Request.MapPath(string.Format("~/{0}/{1}/{2}.gif", "Admin", "icon", ext))))
后面还有 22 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。