protected void btnok_Click(object sender, EventArgs e) { if (txtName.Text == "") { Alert("����д��������"); return; } if ("" == strID) { string TypeName = txtName.Text.Trim().Replace("��", ","); if (TypeName.IndexOf(",") > 0) { string[] arr = TypeName.Split(','); for (int i = 0; i < arr.Length; i++) { InsertData(arr[i].Trim()); if (error) break; } if (!error) Response.Redirect(backUrl); } else { InsertData(txtName.Text.Trim()); if (!error) Response.Redirect(backUrl); } } else { XYECOM.Model.AreaInfo info = new XYECOM.Model.AreaInfo(); info.Name = txtName.Text.Trim(); info.ID = Int32.Parse(strID); int resulit = new XYECOM.Business.Area().Update(info); if (0 < resulit) Response.Redirect("arealist.aspx?parentID=" + strParentID); else if (-1 == resulit) Alert("�ü�¼�Ѿ����ڣ���������д��", "arealist.aspx?parentID=" + strParentID); else if (-2 == resulit) Alert("����������ʧ�ܣ�","arealist.aspx?parentID=" + strParentID); } }
protected void Page_Load(object sender, EventArgs e) { CheckRole("area"); strParentID = "" == XYECOM.Core.XYRequest.GetQueryString("ParentID") ? "0" : XYECOM.Core.XYRequest.GetQueryString("ParentID"); strID = XYECOM.Core.XYRequest.GetQueryString("ID"); if (!IsPostBack) { #region ��ʾ�ּ�·�� XYECOM.Model.AreaInfo info = new XYECOM.Business.Area().GetItem(Convert.ToInt32(strParentID)); string Path = ""; if (null != info) { string fullId = Core.Utils.RemoveComma(info.FullID); if ("" != fullId) { string[] arr1 = fullId.Split(','); string[] arr2 = info.FullName.Split(','); for (int i = 0; i < arr1.Length; i++) { Path += ">><a href=\"arealist.aspx?parentID=" + arr1[i] + "\">" + arr2[i] + "</a>"; } } Path += ">><a href=\"arealist.aspx?parentID=" + info.ID + "\">" + info.Name + "</a>"; } lbPath.Text = Path; #endregion if ("" != strID) { txtName.Text = new XYECOM.Business.Area().GetItem(Convert.ToInt32(strID)).Name; txtName.Rows = 1; txtName.Columns = 40; } } backUrl = strParentID != "" ? "AreaList.aspx?ParentID=" + strParentID : "AreaList.aspx"; }
protected override void BindData() { DataTable table = new Business.AreaSite().GetDataTable(); string areaName = ""; Business.Area areaBLL = new XYECOM.Business.Area(); Model.AreaInfo area = null; foreach (DataRow row in table.Rows) { int areaId = Core.MyConvert.GetInt32(row["areaId"].ToString()); area = areaBLL.GetItem(areaId); if (area == null) continue; areaName = area.Name; this.chklstAreaSite.Items.Add(new ListItem(areaName,row["id"].ToString())); } }
/// <summary> /// ��ȡ���� /// </summary> /// <returns>����</returns> private string GetAreaWhere() { if (areaId != "0" && areaId != "" && XYECOM.Core.Utils.IsNumber(areaId)) { int iAreaId = 0; if (areaId != "") iAreaId = XYECOM.Core.MyConvert.GetInt32(areaId); Business.Area areaBLL = new XYECOM.Business.Area(); string subAreaIds = areaBLL.GetSubIds(iAreaId); if (subAreaIds != "") return " and Area_ID in(" + subAreaIds + ")"; } return ""; }
private void InsertData(string strType) { XYECOM.Model.AreaInfo info = new XYECOM.Model.AreaInfo(); info.Name = strType; info.ParentID = Convert.ToInt32(strParentID); int resulit = new XYECOM.Business.Area().Insert(info); string url = "arealist.aspx?parentID=" + strParentID; if (-1 == resulit) { Alert("��¼�Ѿ����ڣ���������д��", url); error = true; } else if (-2 == resulit) { Alert("����������ʧ�ܣ�", url); error = true; } }
/// <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; }