Ejemplo n.º 1
0
        /// <summary>
        /// д�����ݿ�
        /// </summary>
        /// <param name="tabName">Ŀ�����</param>
        /// <param name="id">���Id</param>
        /// <param name="fileFormat">�洢��ʽ</param>
        /// <param name="fileType">�ļ�����</param>
        /// <param name="fileURL">�����</param>
        /// <param name="sconfigid">���������</param>
        /// <returns>Ӱ������</returns>
        private static Int64 SaveDataBase(string tabName, Int64 id, string fileFormat, Model.UploadFileType fileType,string fileURL, int sconfigid)
        {
            XYECOM.Model.AttachmentInfo fileinfo = new XYECOM.Model.AttachmentInfo();

            Int64 atid = 0;

            if (0 < id)
            {
                fileinfo = new XYECOM.Business.Attachment().GetItem(id);
                if (fileinfo == null)
                {
                    fileinfo = new XYECOM.Model.AttachmentInfo();
                    id = 0;
                }
            }

            fileinfo.At_FileFormat = fileFormat;

            if (0 < id)
            {
                //ɾ��ԭ��ͼƬ
                XYECOM.Model.ServerInfo ffileconfig = new XYECOM.Business.Server().GetItem(fileinfo.S_ID);
                if (null != ffileconfig)
                {
                    string filepath = ffileconfig.S_Path + fileinfo.At_Path;
                    if (File.Exists(filepath))
                        File.Delete(filepath);

                    foreach (string ifile in fileinfo.SmallImg.Images)
                    {
                        filepath = ffileconfig.S_Path + ifile;
                        if (File.Exists(filepath))
                            File.Delete(filepath);
                    }
                }
                fileinfo.S_ID = sconfigid;
                fileinfo.At_Path = fileURL;
                fileinfo.ThumbnailImg = "";
                fileinfo.At_ID = id;
                fileinfo.At_Index = 0;
                new XYECOM.Business.Attachment().Update(fileinfo);
            }
            else
            {
                fileinfo.At_Path = fileURL;
                fileinfo.DescTabID = -1;
                fileinfo.At_FileType = fileType == Model.UploadFileType.Image?"image":"file";
                fileinfo.DescTabName = tabName;
                fileinfo.S_ID = sconfigid;
                fileinfo.At_Remark = "";
                new XYECOM.Business.Attachment().Insert(fileinfo, out atid);
            }
            return atid;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// �ϴ��ļ�
        /// </summary>
        /// <returns></returns>
        public static string _UploadFile()
        {
            if (XYECOM.Core.XYRequest.IsPost())
            {
                /**
                 * edit by liujia
                 * ����
                 * TabName  �������
                 * At_ID    ��ӦͼƬ���id �����Ϊ�� ���ʾ�޸Ķ�Ӧ��ļ�¼
                 * **/
                string TabName = XYECOM.Core.XYRequest.GetQueryString("TabName");

                Int64 AtID = 0;
                string strAtId = XYECOM.Core.XYRequest.GetQueryString("AtID");
                if (strAtId != "") AtID = Convert.ToInt64(strAtId);

                //ȡ��ͼƬ������������Ϣ
                int S_ID = new XYECOM.Business.Server().GetCurrentServerID();
                XYECOM.Model.ServerInfo sconfig = new XYECOM.Business.Server().GetItem(S_ID);
                if (S_ID <= 0)
                {
                    return "<script>var errmsf='�ϴ�ʧ�ܣ�<br /> ����������������������ϵ����Ա!';UploadFileSave(errmsf,[]);</script>";
                }

                #region ����Ŀ¼
                string DateFolderName = DateTime.Now.ToString("yy-MM-dd");
                string SFolderPath = sconfig.S_Path + "files\\" + TabName + "\\" + DateFolderName;
                if (!Directory.Exists(SFolderPath))
                {
                    Directory.CreateDirectory(SFolderPath);
                }
                if (!Directory.Exists(SFolderPath))
                {
                    return "<script>var errmsf='�ϴ�ʧ�ܣ�<br />����������������������ϵ����Ա!';UploadFileSave(errmsf,[]);</script>";
                }
                #endregion

                string errTypefiles = "";
                string errSizeFiles = "";
                string result = "";

                HttpFileCollection files = HttpContext.Current.Request.Files;
                for (int ifile = 0; ifile < files.Count; ifile++)
                {
                    HttpPostedFile f = files[ifile];
                    if (f.ContentLength > 0)
                    {
                        string filename = Path.GetFileName(f.FileName);
                        string fileFormat = Path.GetExtension(f.FileName).Substring(1);

                        if (!CheckFileType(fileFormat, Model.UploadFileType.File))
                        {
                            errTypefiles += "" == errTypefiles ? filename : "," + filename;
                        }
                        else if (f.ContentLength / 1024 > webInfo.UploadAdjunctSize)
                        {
                            errSizeFiles += "" == errSizeFiles ? filename : "," + filename;
                        }
                        else
                        {
                            string TargetFileName = filename;

                            string SFolderFullPath = SFolderPath + "\\" + TargetFileName;

                            if (File.Exists(SFolderFullPath))
                            {
                                TargetFileName = Path.GetFileNameWithoutExtension(f.FileName) +"("+ (new Random().Next(10, 99)) + ")." + fileFormat;
                                SFolderFullPath = SFolderPath + "\\" + TargetFileName;
                            }

                            string SFileURL = "files/" + TabName + "/" + DateFolderName + "/" + TargetFileName;
                            string SFileFullURL = sconfig.S_URL + SFileURL;

                            f.SaveAs(SFolderFullPath);

                            //д�����ݿ�
                            Int64 infoid = SaveDataBase(TabName, AtID, fileFormat, Model.UploadFileType.File, SFileURL, S_ID);

                            result += "" == result ? "" : ",";
                            result += "{id:'" + infoid + "',url:'" + Path.GetFileName(SFolderFullPath) + "'}";
                        }
                    }
                }

                string errmsg = "";
                if ("" != errTypefiles)
                {
                    errmsg += "�ļ��С�" + errTypefiles + "����ʽ����<br />";
                }
                if ("" != errSizeFiles)
                {
                    errmsg += "�ļ��С�" + errSizeFiles + "���ļ�̫��<br />";
                }
                return "<script>var errmsf='" + errmsg + "';var filelist = [" + result + "];UploadFileSave(errmsf,filelist);</script>";
            }
            return "";
        }
Ejemplo n.º 3
0
        /// <summary>
        /// ָ����������Ϣ�����ɸ�����Ϣ������ͼ
        /// </summary>
        /// <param name="info">ʵ�����</param>
        private static void CreateThumbnailImgByInfo(XYECOM.Model.AttachmentInfo info)
        {
            //��ȡ��ͼƬ�ķ�����������Ϣ
            XYECOM.Model.ServerInfo sconfig = new XYECOM.Business.Server().GetItem(info.S_ID);
            string[] arr = info.At_Path.Split('/');
            string FileName = arr[arr.Length - 1];
            string SFolderPath = sconfig.S_Path + webInfo.UploadThumbnailImgFolder + "\\" + info.At_Path.Replace("/" + FileName, "").Replace("/", @"\\");
            //����Ŀ¼
            if (!Directory.Exists(SFolderPath))
            {
                Directory.CreateDirectory(SFolderPath);
            }
            string SFileURL = webInfo.UploadThumbnailImgFolder + "/" + info.At_Path.Replace("/" + FileName, "");
            string BaseFilePath = sconfig.S_Path + info.At_Path.Replace("/", @"\\");

            string SFolderFullPath;
            info.ThumbnailImg = "";
            if ("" != webInfo.UploadThumbnailImg1)
            {
                string s1 = FileName.Replace(".", "s1.");
                SFolderFullPath = SFolderPath + "\\" + s1;
                s1 = SFileURL + "/" + s1;
                CreateThumbnailState result = CreateThumbnailCutImg(BaseFilePath, SFolderFullPath, webInfo.UploadThumbnailImg1);
                if (result == CreateThumbnailState.Succeed)
                    info.ThumbnailImg = s1;
            }

            if ("" != webInfo.UploadThumbnailImg2)
            {
                string s2 = FileName.Replace(".", "s2.");
                SFolderFullPath = SFolderPath + "\\" + s2;
                s2 = SFileURL + "/" + s2;
                CreateThumbnailState result = CreateThumbnailCutImg(BaseFilePath, SFolderFullPath, webInfo.UploadThumbnailImg2);
                if (result == CreateThumbnailState.Succeed)
                    info.ThumbnailImg += "" == info.ThumbnailImg ? s2 : "|" + s2;
            }

            if ("" != webInfo.UploadThumbnailImg3)
            {
                string s3 = FileName.Replace(".", "s3.");
                SFolderFullPath = SFolderPath + "\\" + s3;
                s3 = SFileURL + "/" + s3;
                CreateThumbnailState result = CreateThumbnailCutImg(BaseFilePath, SFolderFullPath, webInfo.UploadThumbnailImg3);
                if (result == CreateThumbnailState.Succeed)
                    info.ThumbnailImg += "" == info.ThumbnailImg ? s3 : "|" + s3;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// �ϴ�ͼƬ
        /// </summary>
        /// <returns>ͼƬ</returns>
        public static string UploadFile()
        {
            if (XYECOM.Core.XYRequest.IsPost())
            {
                /**
                 * edit by liujia
                 * ����
                 * TabName  �������
                 * At_ID    ��ӦͼƬ���id �����Ϊ�� ���ʾ�޸Ķ�Ӧ��ļ�¼
                 * **/
                string TabName = XYECOM.Core.XYRequest.GetQueryString("TabName");

                Int64 AtID = 0;
                string strAtId = XYECOM.Core.XYRequest.GetQueryString("AtID");
                if (strAtId != "") AtID = Convert.ToInt64(strAtId);

                bool iswatermark = "true" == XYECOM.Core.XYRequest.GetQueryString("iswatermark");

                //ȡ��ͼƬ������������Ϣ
                int S_ID = new XYECOM.Business.Server().GetCurrentServerID();
                XYECOM.Model.ServerInfo sconfig = new XYECOM.Business.Server().GetItem(S_ID);
                if (S_ID <= 0)
                {
                    return "<script>var errmsf='�ϴ�ʧ�ܣ�<br /> ����������������������ϵ����Ա!';UploadFileSave(errmsf,[]);</script>";
                }

                #region ����Ŀ¼

                string DateFolderName = DateTime.Now.ToString("yy-MM-dd");
                string SFolderPath = sconfig.S_Path + TabName + "\\" + DateFolderName;
                if (!Directory.Exists(SFolderPath))
                {
                    Directory.CreateDirectory(SFolderPath);
                }
                if (!Directory.Exists(SFolderPath))
                {
                    return "<script>var errmsf='�ϴ�ʧ�ܣ�<br />����������������������ϵ����Ա!';UploadFileSave(errmsf,[]);</script>";
                }
                #endregion

                string errTypefiles = "";
                string errSizeFiles = "";
                string result = "";

                HttpFileCollection files = HttpContext.Current.Request.Files;
                for (int ifile = 0; ifile < files.Count; ifile++)
                {
                    HttpPostedFile f = files[ifile];
                    if (f.ContentLength > 0)
                    {
                        string filename = Path.GetFileName(f.FileName);
                        string fileFormat = filename.Substring(filename.LastIndexOf(".") + 1).ToLower();

                        if (!CheckFileType(fileFormat, Model.UploadFileType.Image))
                        {
                            errTypefiles += "" == errTypefiles ? filename : "," + filename;
                        }
                        else if (f.ContentLength / 1024 > webInfo.UploadFileSize)
                        {
                            errSizeFiles += "" == errSizeFiles ? filename : "," + filename;
                        }
                        else
                        {
                            string TargetFileName = DateTime.Now.ToString("yyMMddHHmmssFFF") + "." + fileFormat;
                            string SFileURL = TabName + "/" + DateFolderName + "/" + TargetFileName;
                            string SFolderFullPath = SFolderPath + "\\" + TargetFileName;
                            string SFileFullURL = sconfig.S_URL + SFileURL;
                            f.SaveAs(SFolderFullPath);

                            if ("gif" == fileFormat || "jpg" == fileFormat || "png" == fileFormat || "bmp" == fileFormat || "jpeg" == fileFormat)
                            {
                                if ("" != webInfo.UploadImg)
                                {
                                    //�ȱ�����ͼƬ
                                    string tmpfilepath = SFolderFullPath.Replace(TargetFileName, "tmp_" + TargetFileName);
                                    CreateThumbnailState createstate = UploadManage.CreateThumbnailImg(SFolderFullPath, tmpfilepath, webInfo.UploadImg);
                                    if (createstate == CreateThumbnailState.Succeed || createstate == CreateThumbnailState.DimensionSmall)
                                    {
                                        //�û��ļ�
                                        File.Delete(SFolderFullPath);
                                        File.Move(tmpfilepath, SFolderFullPath);
                                    }
                                }

                                //���ˮӡ
                                AddWaterMark(TargetFileName, SFolderFullPath, iswatermark, TabName, fileFormat);
                            }

                            //д�����ݿ�
                            Int64 infoid = SaveDataBase(TabName, AtID, fileFormat, Model.UploadFileType.Image,SFileURL, S_ID);

                            result += "" == result ? "" : ",";
                            result += "{id:'" + infoid + "',url:'" + sconfig.S_URL + SFileURL + "'}";
                        }
                    }
                }

                string errmsg = "";
                if ("" != errTypefiles)
                {
                    errmsg += "�ļ��С�" + errTypefiles + "����ʽ����<br />";
                }
                if ("" != errSizeFiles)
                {
                    errmsg += "�ļ��С�" + errSizeFiles + "���ļ�̫��<br />";
                }
                return "<script>var errmsf='" + errmsg + "';var filelist = [" + result + "];UploadFileSave(errmsf,filelist);</script>";
            }
            return "";
        }
Ejemplo n.º 5
0
        /// <summary>
        /// ɾ��������Ч����
        /// </summary>
        /// <returns>Ӱ������</returns>
        public int DeleteAllTemp()
        {
            DataTable dt = DAL.GetAllTemp();

            foreach (DataRow dr in dt.Rows)
            {
                XYECOM.Model.ServerInfo sconfig = new XYECOM.Business.Server().GetItem(XYECOM.Core.MyConvert.GetInt32(dr["S_ID"].ToString()));
                if (null != sconfig)
                {
                    DeleteFile(sconfig.S_Path, dr["At_Path"].ToString().Replace("/", @"\"), dr["ThumbnailImg"].ToString().Replace("/", @"\"));
                }
            }

            return DAL.DeleteAllTemp();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// ɾ����������
 /// </summary>
 /// <param name="At_IDs">Id����</param>
 /// <returns>Ӱ������</returns>
 public int Delete(string At_IDs)
 {
     //edit by liujia 2008-10-16 ������ɾ����Ϣʱɾ����Ӧ��ͼƬ
     DataTable dt = DAL.GetDataTable(At_IDs);
     foreach (DataRow dr in dt.Rows)
     {
         XYECOM.Model.ServerInfo sconfig = new XYECOM.Business.Server().GetItem(XYECOM.Core.MyConvert.GetInt32(dr["S_ID"].ToString()));
         if (null != sconfig)
         {
             DeleteFile(sconfig.S_Path, dr["At_Path"].ToString().Replace("/", @"\"), dr["ThumbnailImg"].ToString().Replace("/", @"\"));
         }
     }
     return DAL.Delete(At_IDs);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// ɾ��һ����¼
 /// </summary>
 /// <param name="A_ID">��¼���</param>
 /// <returns>��Ӱ�������</returns>
 public int Delete(long At_ID)
 {
     XYECOM.Model.AttachmentInfo info = DAL.GetItem(At_ID);
     if (null != info)
     {
         XYECOM.Model.ServerInfo sconfig = new XYECOM.Business.Server().GetItem(info.S_ID);
         if (null != sconfig)
         {
             DeleteFile(sconfig.S_Path, info.At_Path.Replace("/", @"\\"), info.ThumbnailImg.Replace("/", @"\\"));
         }
     }
     return DAL.Delete(At_ID);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// �滻��ǩ�ֶ�Ϊ��ʵ����
        /// </summary>
        /// <param name="index">������</param>
        /// <param name="labelFlagName">��ǩ��ʶ����</param>
        /// <param name="labelBody">��ǩ����</param>
        /// <param name="dataRow">������</param>
        /// <param name="queryParam">��ǩ��ʽ����</param>
        /// <returns></returns>
        public string ReplaceField(int index, string labelFlagName, string labelBody, DataRow dataRow, LabelQueryParameterInfo queryParam)
        {
            List<XYECOM.Configuration.ModuleItemInfo> moduleItems = new List<XYECOM.Configuration.ModuleItemInfo>();

            labelFlagName = labelFlagName.ToLower().Trim();

            labelBody = labelBody.Replace("{i}", index.ToString());

            #region  ϵͳ�ֶ�
            if (labelBody.Contains("{SY:XY_WebURL}"))
            {
                labelBody = labelBody.Replace("{SY:XY_WebURL}", webInfo.WebDomain);
            }
            if (labelBody.Contains("{SY:XY_TemplatePath}"))
            {
                labelBody = labelBody.Replace("{SY:XY_TemplatePath}", templateInfo.Path);
            }
            //if (str.IndexOf("{SY:XY_Coptright}") > 0)
            //{
            //    str = str.Replace("{SY:XY_Coptright}", "XYECS!b2b");
            //}
            if (labelBody.Contains("{SY:XY_Version}"))
            {
                labelBody = labelBody.Replace("{SY:XY_Version}", System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Web.HttpContext.Current.Server.MapPath("/bin/XYECOM.Web.dll")).FileVersion);
            }
            #endregion

            #region ��������

            if (labelBody.Contains("{WI:XY_URL}"))
            {
                if (IsHaveColumn(dataRow, "FL_URL"))
                    labelBody = labelBody.Replace("{WI:XY_URL}", dataRow["FL_URL"].ToString());
            }

            if (labelBody.Contains("{WI:XY_ALT}"))
            {
                if (queryParam.IsFriendLinkAlt)
                {
                    if (IsHaveColumn(dataRow, "FL_Alt"))
                        labelBody = labelBody.Replace("{WI:XY_ALT}", dataRow["FL_Alt"].ToString());
                }
                else
                {
                    labelBody = labelBody.Replace("{WI:XY_ALT}", "");
                }
            }

            if (labelBody.Contains("{WI:XY_SRC}"))
            {
                if (dataRow["FL_Font"].ToString() == "Image")
                {
                    if (IsHaveColumn(dataRow, "At_Path"))
                        labelBody = labelBody.Replace("{WI:XY_SRC}", dataRow["S_URL"].ToString() + dataRow["At_Path"].ToString());
                }
                else
                {
                    if (IsHaveColumn(dataRow, "FL_Font"))
                        labelBody = labelBody.Replace("{WI:XY_SRC}", dataRow["FL_Font"].ToString());
                }
            }
            if (labelBody.Contains("{WI:XY_Font}"))
            {
                if (IsHaveColumn(dataRow, "FL_Font"))
                    labelBody = labelBody.Replace("{WI:XY_Font}", dataRow["FL_Font"].ToString());
            }

            #endregion

            #region ��Ѷ��Ŀ

            string allDomainName = "";
            if (labelBody.Contains("{NT:XY_Title}"))
            {
                if (IsHaveColumn(dataRow, "NT_Name"))
                    labelBody = labelBody.Replace("{NT:XY_Title}", dataRow["NT_Name"].ToString());
            }
            if (labelBody.Contains("{NT:XY_URL}"))
            {
                if (dataRow["DomainName"].ToString() != "")
                {
                    allDomainName = webInfo.GetSubDomain(dataRow["DomainName"].ToString());
                }
                if (dataRow["NT_TempletAddress"].ToString() != "")
                    labelBody = labelBody.Replace("{NT:XY_URL}", webInfo.WebDomain + "news/" + dataRow["NT_EnName"].ToString() + "/" + dataRow["NT_TempletAddress"].ToString().Substring(0, dataRow["NT_TempletAddress"].ToString().IndexOf('.')) + "." + webInfo.WebSuffix);
                else
                {
                    if (webInfo.IsBogusStatic)
                    {
                        if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                        {
                            labelBody = labelBody.Replace("{NT:XY_URL}", allDomainName + "channel-" + dataRow["NT_ID"].ToString() + "." + webInfo.WebSuffix);
                        }
                        else
                        {
                            labelBody = labelBody.Replace("{NT:XY_URL}", webInfo.WebDomain + "news/channel-" + dataRow["NT_ID"].ToString() + "." + webInfo.WebSuffix);
                        }
                    }
                    else
                    {
                        if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                        {
                            labelBody = labelBody.Replace("{NT:XY_URL}", allDomainName + "channel." + webInfo.WebSuffix + "?nt_id=" + dataRow["NT_ID"].ToString());
                        }
                        else
                        {
                            labelBody = labelBody.Replace("{NT:XY_URL}", webInfo.WebDomain + "news/channel." + webInfo.WebSuffix + "?nt_id=" + dataRow["NT_ID"].ToString());
                        }
                    }
                }
            }
            #endregion

            #region ������Ϣ
            if (labelFlagName.Equals("newslist") || labelFlagName.Equals("newspagelist"))
            {
                if (labelBody.Contains("{NS:XY_ID}"))
                    labelBody = labelBody.Replace("{NS:XY_ID}", dataRow["NS_ID"].ToString());

                if (labelBody.Contains("{NS:XY_TitleAll}"))
                {
                    string newsName = XYECOM.Business.FiltrateKeyWord.LeachKeyWord(dataRow["NS_NewsName"].ToString());

                    if (!dataRow["NS_TitleStyle"].ToString().Trim().Equals(""))
                    {
                        newsName = "<font style=" + dataRow["NS_TitleStyle"].ToString().Trim() + ">" + newsName + "</font>";
                    }

                    labelBody = labelBody.Replace("{NS:XY_TitleAll}", newsName);
                }

                if (labelBody.Contains("{NS:XY_Title}"))
                {
                    string newsName = XYECOM.Core.Utils.IsLength(queryParam.TitleFontNumbers, XYECOM.Business.FiltrateKeyWord.LeachKeyWord(dataRow["NS_NewsName"].ToString()));

                    if (!dataRow["NS_TitleStyle"].ToString().Trim().Equals(""))
                    {
                        newsName = "<font style=" + dataRow["NS_TitleStyle"].ToString().Trim() + ">" + newsName + "</font>";
                    }

                    labelBody = labelBody.Replace("{NS:XY_Title}", newsName);
                }

                if (labelBody.Contains("{NS:XY_TName}"))
                    labelBody = labelBody.Replace("{NS:XY_TName}", dataRow["NT_Name"].ToString());

                if (labelBody.Contains("{NS:XY_STName}"))
                    labelBody = labelBody.Replace("{NS:XY_STName}", dataRow["NT_NessName"].ToString());

                if (labelBody.Contains("{NS:XY_TURL}"))
                {
                    if (dataRow["DomainName"].ToString() != "")
                    {
                        allDomainName = webInfo.GetSubDomain(dataRow["DomainName"].ToString());
                    }
                    string channelId = dataRow["NT_ID"].ToString();
                    string subChannelFolder = dataRow["NT_TempletFolderAddress"].ToString().Trim();

                    if (!subChannelFolder.Equals("")) subChannelFolder = subChannelFolder + "/";

                    channelId = Core.Utils.RemoveStartComma(channelId);

                    channelId = channelId.Substring(0, channelId.IndexOf(','));

                    if (webInfo.IsBogusStatic)
                    {
                        if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                        {
                            labelBody = labelBody.Replace("{NS:XY_TURL}", allDomainName + "channel-" + channelId + "." + webInfo.WebSuffix);
                        }
                        else
                        {
                            labelBody = labelBody.Replace("{NS:XY_TURL}", webInfo.WebDomain + "news/" + subChannelFolder + "channel-" + channelId + "." + webInfo.WebSuffix);
                        }
                    }
                    else
                    {
                        if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                        {
                            labelBody = labelBody.Replace("{NS:XY_TURL}", allDomainName + "channel." + webInfo.WebSuffix + "?nt_id=" + channelId);
                        }
                        else
                        {
                            labelBody = labelBody.Replace("{NS:XY_TURL}", webInfo.WebDomain + "news/" + subChannelFolder + "channel." + webInfo.WebSuffix + "?nt_id=" + channelId);
                        }
                    }
                }
                if (labelBody.Contains("{NS:XY_CurtTitle}"))
                    labelBody = labelBody.Replace("{NS:XY_CurtTitle}", XYECOM.Business.FiltrateKeyWord.LeachKeyWord(dataRow["NS_TwoName"].ToString()));
                if (labelBody.Contains("{NS:XY_NaviContentAll}"))
                    labelBody = labelBody.Replace("{NS:XY_NaviContentAll}", XYECOM.Business.FiltrateKeyWord.LeachKeyWord(dataRow["NS_NewsLess"].ToString()));
                if (labelBody.Contains("{NS:XY_NaviContent}"))
                    labelBody = labelBody.Replace("{NS:XY_NaviContent}", XYECOM.Core.Utils.IsLength(queryParam.NewsLeadinFontNumber, XYECOM.Business.FiltrateKeyWord.LeachKeyWord(XYECOM.Core.Utils.RemoveHTML(dataRow["NS_NewsLess"].ToString()))));
                if (labelBody.Contains("{NS:XY_Content}"))
                    labelBody = labelBody.Replace("{NS:XY_Content}", XYECOM.Business.FiltrateKeyWord.LeachKeyWord(dataRow["NS_NewsNote"].ToString()));
                if (labelBody.Contains("{NS:XY_Author}"))
                    labelBody = labelBody.Replace("{NS:XY_Author}", dataRow["NS_NewsAuthor"].ToString());
                if (labelBody.Contains("{NS:XY_Source}"))
                    labelBody = labelBody.Replace("{NS:XY_Source}", dataRow["NS_NewsOrigin"].ToString());
                if (labelBody.Contains("{NS:XY_KeyWord}"))
                    labelBody = labelBody.Replace("{NS:XY_KeyWord}", XYECOM.Business.FiltrateKeyWord.LeachKeyWord(dataRow["NS_KeyWord"].ToString()));
                if (labelBody.Contains("{NS:XY_Date}"))
                {
                    if (queryParam.DateFormat != "")
                        labelBody = labelBody.Replace("{NS:XY_Date}", FormatDateTime(dataRow["NS_AddTime"].ToString(), queryParam.DateFormat));
                    else
                        labelBody = labelBody.Replace("{NS:XY_Date}", dataRow["NS_AddTime"].ToString());
                }
                if (labelBody.Contains("{NS:XY_Link}"))
                {
                    if (dataRow["DomainName"].ToString() != "")
                    {
                        allDomainName = webInfo.GetSubDomain(dataRow["DomainName"].ToString());
                    }
                    if (IsHaveColumn(dataRow, "NS_LinkAddress"))
                    {
                        if (dataRow["NS_LinkAddress"].ToString() != "")
                            labelBody = labelBody.Replace("{NS:XY_Link}", dataRow["NS_LinkAddress"].ToString());
                        else
                        {
                            string subChannelFolder = dataRow["NT_TempletFolderAddress"].ToString().Trim();
                            if (!subChannelFolder.Equals("")) subChannelFolder = subChannelFolder + "/";

                            if (webInfo.IsBogusStatic)
                                if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                                {
                                    labelBody = labelBody.Replace("{NS:XY_Link}", allDomainName + "content-" + dataRow["NS_ID"].ToString() + "." + webInfo.WebSuffix);
                                }
                                else
                                {
                                    labelBody = labelBody.Replace("{NS:XY_Link}", webInfo.WebDomain + "news/" + subChannelFolder + "content-" + dataRow["NS_ID"].ToString() + "." + webInfo.WebSuffix);
                                }
                            else
                            {
                                if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                                {
                                    labelBody = labelBody.Replace("{NS:XY_Link}", allDomainName + "content." + webInfo.WebSuffix + "?ns_id=" + dataRow["NS_ID"].ToString());
                                }
                                else
                                {
                                    labelBody = labelBody.Replace("{NS:XY_Link}", webInfo.WebDomain + "news/" + subChannelFolder + "content." + webInfo.WebSuffix + "?ns_id=" + dataRow["NS_ID"].ToString());
                                }
                            }
                        }
                    }
                }
                if (labelBody.Contains("{NS:XY_URL}"))
                {
                    string subChannelFolder = dataRow["NT_TempletFolderAddress"].ToString().Trim();
                    if (!subChannelFolder.Equals("")) subChannelFolder = subChannelFolder + "/";
                    if (dataRow["DomainName"].ToString() != "")
                    {
                        allDomainName = webInfo.GetSubDomain(dataRow["DomainName"].ToString());
                    }

                    if (dataRow["NS_Type"].ToString() == "3")
                    {
                        if (dataRow["NS_LinkAddress"].ToString() != "")
                            labelBody = labelBody.Replace("{NS:XY_URL}", dataRow["NS_LinkAddress"].ToString());
                        else
                        {
                            if (webInfo.IsBogusStatic)
                                if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", allDomainName + "content-" + dataRow["NS_ID"].ToString() + "." + webInfo.WebSuffix);
                                }
                                else
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", webInfo.WebDomain + "news/" + subChannelFolder + "content-" + dataRow["NS_ID"].ToString() + "." + webInfo.WebSuffix);
                                }
                            else
                            {
                                if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", allDomainName + "content." + webInfo.WebSuffix + "?ns_id=" + dataRow["NS_ID"].ToString());
                                }
                                else
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", webInfo.WebDomain + "news/" + subChannelFolder + "content." + webInfo.WebSuffix + "?ns_id=" + dataRow["NS_ID"].ToString());
                                }
                            }

                        }
                    }
                    else
                    {
                        if (dataRow["NS_HTMLPage"].ToString() != "")
                            labelBody = labelBody.Replace("{NS:XY_URL}", webInfo.WebDomain + dataRow["NS_HTMLPage"].ToString());
                        else
                        {
                            if (webInfo.IsBogusStatic)
                                if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", allDomainName + "content-" + dataRow["NS_ID"].ToString() + "." + webInfo.WebSuffix);
                                }
                                else
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", webInfo.WebDomain + "news/" + subChannelFolder + "content-" + dataRow["NS_ID"].ToString() + "." + webInfo.WebSuffix);
                                }
                            else
                            {
                                if (webInfo.IsNewsDomain && dataRow["DomainName"].ToString() != "")
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", allDomainName + "content." + webInfo.WebSuffix + "?ns_id=" + dataRow["NS_ID"].ToString());
                                }
                                else
                                {
                                    labelBody = labelBody.Replace("{NS:XY_URL}", webInfo.WebDomain + "news/" + subChannelFolder + "content." + webInfo.WebSuffix + "?ns_id=" + dataRow["NS_ID"].ToString());
                                }
                            }
                        }
                    }
                }

                if (labelBody.Contains("{NS:XY_Click}"))
                    labelBody = labelBody.Replace("{NS:XY_Click}", dataRow["NS_Count"].ToString());

                //��ѶͼƬ��ַ(Ϊ����֮ǰ�ֶα���)
                if (labelBody.Contains("{NS:XY_SmallPicPath}"))
                {
                    if (IsHaveColumn(dataRow, "IsHasImage"))
                    {
                        if (dataRow["IsHasImage"].ToString() != "0")
                        {
                            long infoId = Core.MyConvert.GetInt64(dataRow["NS_ID"].ToString());

                            string imgUrl = Business.Attachment.GetInfoDefaultImgHref(XYECOM.Model.AttachmentItem.News, infoId);

                            labelBody = labelBody.Replace("{NS:XY_SmallPicPath}", imgUrl);
                        }
                        else
                        {
                            if (!dataRow["NS_PicUrl"].ToString().Equals(""))
                            {
                                labelBody = labelBody.Replace("{NS:XY_PicPath}", dataRow["NS_PicUrl"].ToString());
                            }
                            else
                            {
                                labelBody = labelBody.Replace("{NS:XY_SmallPicPath}", SYS_NOIMAGE_PATH);
                            }
                        }
                    }
                }
                //��ѶͼƬ��ַ
                if (labelBody.Contains("{NS:XY_PicPath}"))
                {
                    if (IsHaveColumn(dataRow, "IsHasImage"))
                    {
                        if (dataRow["IsHasImage"].ToString() != "0")
                        {
                            long infoId = Core.MyConvert.GetInt64(dataRow["NS_ID"].ToString());

                            string imgUrl = Business.Attachment.GetInfoDefaultImgHref(XYECOM.Model.AttachmentItem.News, infoId);

                            labelBody = labelBody.Replace("{NS:XY_PicPath}", imgUrl);
                        }
                        else
                        {
                            if (!dataRow["NS_PicUrl"].ToString().Equals(""))
                            {
                                labelBody = labelBody.Replace("{NS:XY_PicPath}", dataRow["NS_PicUrl"].ToString());
                            }
                            else
                            {
                                labelBody = labelBody.Replace("{NS:XY_PicPath}", SYS_NOIMAGE_PATH);
                            }
                        }
                    }
                }

                if (labelBody.Contains("{NS:XY_Attachment}"))
                {
                    if (IsHaveColumn(dataRow, "NS_ID"))
                    {
                        string attachment = "";
                        long infoId = Core.MyConvert.GetInt64(dataRow["NS_ID"].ToString());

                        XYECOM.Business.Attachment attBll = new XYECOM.Business.Attachment();

                        DataTable dt = attBll.GetDataTable(infoId, XYECOM.Model.AttachmentItem.News, XYECOM.Model.UploadFileType.File);

                        string divfmt = "<div class=\"attachment\"><a href=\"{0}\">����{1}</a></div>";

                        int aIndex = 1;
                        foreach (DataRow row in dt.Rows)
                        {
                            XYECOM.Model.ServerInfo info = new XYECOM.Business.Server().GetItem(Core.MyConvert.GetInt32(row["S_ID"].ToString()));
                            attachment += string.Format(divfmt, info.S_URL + row["At_Path"], aIndex++);
                        }
                        labelBody = labelBody.Replace("{NS:XY_Attachment}", attachment);
                    }
                }

                //������ʶ
                if (labelBody.Contains("{NS:XY_AreaFlag}"))
                {
                    string areaName = "";
                    if (IsHaveColumn(dataRow, "AreaIds"))
                    {
                        //=========================================================================/
                        int aId = XYECOM.Core.MyConvert.GetInt32(dataRow["AreaIds"].ToString().Split(',')[1]);

                        if (aId > 0)
                        {
                            XYECOM.Model.AreaInfo aInfo = new XYECOM.Business.Area().GetItem(aId);
                            if (null != aInfo) areaName = aInfo.Name;
                        }
                        //=========================================================================/
                    }
                    labelBody = labelBody.Replace("{NS:XY_AreaFlag}", areaName);
                }
            }
            #endregion

            return labelBody;
        }