Beispiel #1
0
        protected void repeater_list_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            //如果邦定的是第一条数据,则显示缩略图和标题
            if (e.Item.ItemIndex == 0)
            {
                EyouSoft.Model.ShopStructure.HighShopTripGuide guidInfo = e.Item.DataItem as EyouSoft.Model.ShopStructure.HighShopTripGuide;
                HtmlTable tableTitleModel = (HtmlTable)e.Item.FindControl("table1");

                tableTitleModel.Rows[0].Cells[0].InnerHtml = string.Format("• <a href=\"{0}\" class=\"huizi\">{1}</a>", Utils.GenerateShopPageUrl2("/MuDiDi_" + guidInfo.ID, Master.CompanyId), guidInfo.ID, Utils.GetText(Utils.InputText(guidInfo.Title), 200));
                tableTitleModel.Rows[0].Cells[1].InnerHtml = string.Format("<span class=\"hui\">【{0} 】</span>", guidInfo.IssueTime.ToString("yyyy-MM-dd"));
                tableTitleModel.Style.Add("display", "none");

                guidInfo.ImagePath = Utils.GetLineShopImgPath(guidInfo.ImagePath, 5);

                string innerHTML = "<table width=\"96%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"  class=\"maintop5\" style=\"margin-bottom:5px;overflow:hidden\" id=\"table" + guidInfo.ID + "\" >" +
                                   "<tr>" +
                                   "<td width=\"16%\" style=\"padding-top:3px;\"><a href=\"" + Utils.GenerateShopPageUrl2("/MuDiDi_" + guidInfo.ID, Master.CompanyId) + "\"><img src=\"" + guidInfo.ImagePath + "\" width=\"97\" height=\"73\" border=\"0\" /></a></td>" +
                                   "<td style=\"padding:8px; text-align:left;vertical-align:top;word-wrap:break-word\" width=\"84%\">" +
                                   "<div style=\"width:520px;overflow-x:hidden;word-wrap:break-word;\"><a  href=\"" + Utils.GenerateShopPageUrl2("/MuDiDi_" + guidInfo.ID, Master.CompanyId) + "\" class=\"huizi\">&nbsp;&nbsp;&nbsp;&nbsp;" + Utils.GetText(Utils.InputText(guidInfo.ContentText), 200) + "</a></div></td>" +
                                   "</tr>" +
                                   "</table>";
                LiteralControl c = new LiteralControl(innerHTML);
                e.Item.Controls.Add(c);
            }
        }
Beispiel #2
0
        private void InitGuidInfo()
        {
            EyouSoft.Model.ShopStructure.HighShopTripGuide guide = EyouSoft.BLL.ShopStructure.HighShopTripGuide.CreateInstance().GetModel(StringValidate.SafeRequest(Request.QueryString["guid_Id"]));
            if (guide != null)
            {
                txtGuidTitle.Value = guide.Title;
                editGuid.Value     = guide.ContentText;
                txtGuidTime.Value  = guide.IssueTime.ToString("yyyy-MM-dd HH:mm");
                if (!string.IsNullOrEmpty(guide.ImagePath))
                {
                    img_Path            = string.Format("<a href=\"{0}\" target='_blank'  title=\"点击查看\">查看原图</a>", Domain.FileSystem + guide.ImagePath);
                    hdfAgoImgPath.Value = guide.ImagePath;
                }

                int TypeId = 0;
                if (guide.TypeID != null)
                {
                    TypeId = (int)guide.TypeID.Value;
                }
                if (ddlGuidType.Items.FindByValue(TypeId.ToString()) != null)
                {
                    ddlGuidType.Items.FindByValue(TypeId.ToString()).Selected = true;
                }
            }
            guide = null;
        }
Beispiel #3
0
        /// <summary>
        /// 获取出游指南实体
        /// </summary>
        /// <param name="ID">主键ID</param>
        /// <returns>存在返回出游指南实体,不存在返回NULL</returns>
        public virtual EyouSoft.Model.ShopStructure.HighShopTripGuide GetModel(string ID)
        {
            EyouSoft.Model.ShopStructure.HighShopTripGuide model = null;
            DbCommand dc = this._database.GetSqlStringCommand(SQL_HighShopTripGuide_GETMODEL);

            this._database.AddInParameter(dc, "ID", DbType.AnsiStringFixedLength, ID);
            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._database))
            {
                if (dr.Read())
                {
                    model    = new EyouSoft.Model.ShopStructure.HighShopTripGuide();
                    model.ID = dr.GetString(0);
                    if (!dr.IsDBNull(1))
                    {
                        model.TypeID = (EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType) int.Parse(dr.GetByte(1).ToString());
                    }
                    model.Title       = dr.GetString(2);
                    model.ContentText = dr.IsDBNull(3)?string.Empty:dr.GetString(3);
                    model.ImagePath   = dr.IsDBNull(4)?string.Empty:dr.GetString(4);
                    model.IssueTime   = dr.IsDBNull(5) ? DateTime.Now : dr.GetDateTime(5);
                    model.IsTop       = dr.IsDBNull(6) ? false : dr.GetString(6) == "1" ? true : false;
                    model.TopTime     = dr.IsDBNull(7) ? DateTime.MinValue : dr.GetDateTime(7);
                }
            }
            return(model);
        }
Beispiel #4
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void InitPage()
        {
            string SecnicId = Request.QueryString["id"];

            //if (type == SeniorOnlineShop.master.SPOTT1TAB.门票政策)
            //{
            //    TabName = "门票政策";
            //    likReturn.HRef = "ScenicInfoDetail.aspx?st=4&cid=" + CompanyId + "";
            //    IsAdmissionPolicy = true;
            //    IList<EyouSoft.Model.ShopStructure.HighShopTripGuide> lists = new List<EyouSoft.Model.ShopStructure.HighShopTripGuide>();
            //    int TypeId = (int)EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType.门票政策;//门票政策
            //    lists = EyouSoft.BLL.ShopStructure.HighShopTripGuide.CreateInstance().GetWebList(1, CompanyId, TypeId, string.Empty);
            //    if (lists != null && lists.Count>0)
            //    {
            //        ContentText=lists[0].ContentText;
            //    }
            //    lists = null;
            //}
            //else
            //{
            if (!string.IsNullOrEmpty(SecnicId))
            {
                EyouSoft.Model.ShopStructure.HighShopTripGuide model = EyouSoft.BLL.ShopStructure.HighShopTripGuide.CreateInstance().GetModel(SecnicId);
                ImagePath      = model.ImagePath;
                StrTitle       = model.Title;
                ContentText    = model.ContentText;
                IssueTime      = model.IssueTime.ToShortDateString();
                TabName        = Enum.GetName(typeof(EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType), model.TypeID);
                likReturn.HRef = "ScenicInfoList.aspx?cid=" + CompanyId + "&st=" + TabIndex;
                model          = null;
            }
            //}
        }
Beispiel #5
0
        protected void Submit1_Click(object sender, EventArgs e)
        {
            bool Result = false;

            EyouSoft.Model.ShopStructure.HighShopTripGuide model = new EyouSoft.Model.ShopStructure.HighShopTripGuide();
            model.CompanyID   = SiteUserInfo.CompanyID;
            model.ContentText = editGuid.Value;
            model.ImagePath   = "";
            model.IssueTime   = DateTime.Now;
            model.OperatorID  = SiteUserInfo.ID;
            model.Title       = "";
            model.TypeID      = EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType.门票政策;
            if (!string.IsNullOrEmpty(hId.Value))
            {
                model.ID = hId.Value;
                Result   = EyouSoft.BLL.ShopStructure.HighShopTripGuide.CreateInstance().Update(model);
            }
            else
            {
                Result = EyouSoft.BLL.ShopStructure.HighShopTripGuide.CreateInstance().Add(model);
            }
            model = null;
            if (Result)
            {
                MessageBox.ResponseScript(this.Page, "alert(\"操作成功!\");parent.Boxy.getIframeDialog('" + Request.QueryString["iframeId"] + "').hide();");
            }
            else
            {
                MessageBox.ShowAndRedirect(this.Page, "alert(\"操作失败!\")", Request.RawUrl);
            }
        }
Beispiel #6
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="model">出游指南实体</param>
 /// <returns>false:失败 true:成功</returns>
 public bool Update(EyouSoft.Model.ShopStructure.HighShopTripGuide model)
 {
     if (model == null)
     {
         return(false);
     }
     return(dal.Update(model));
 }
Beispiel #7
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model">出游指南实体</param>
        /// <returns>false:失败 true:成功</returns>
        public virtual bool Update(EyouSoft.Model.ShopStructure.HighShopTripGuide model)
        {
            DbCommand dc = this._database.GetSqlStringCommand(SQL_HighShopTripGuide_UPDATE);

            this._database.AddInParameter(dc, "ID", DbType.AnsiStringFixedLength, model.ID);
            this._database.AddInParameter(dc, "TypeID", DbType.Byte, (int)model.TypeID);
            this._database.AddInParameter(dc, "Title", DbType.String, model.Title);
            this._database.AddInParameter(dc, "ContentText", DbType.String, model.ContentText);
            this._database.AddInParameter(dc, "ImagePath", DbType.String, model.ImagePath);
            return(DbHelper.ExecuteSql(dc, this._database) > 0?true:false);
        }
Beispiel #8
0
        /// <summary>
        /// 获取后台出游指南列表集合
        /// </summary>
        /// <param name="pageSize">每页显示条数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="CompanyID">公司编号 为空返回全部否则返回指定公司的所有记录</param>
        /// <param name="KeyWord">需要匹配的关键字</param>
        /// <param name="typeList">类别ID,若不包含ID,则返回全部</param>
        /// <returns>出游指南列表集合</returns>
        public virtual IList <EyouSoft.Model.ShopStructure.HighShopTripGuide> GetList(int pageSize, int pageIndex, ref int recordCount, string CompanyID, string KeyWord, params EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType[] typeList)
        {
            IList <EyouSoft.Model.ShopStructure.HighShopTripGuide> list = new List <EyouSoft.Model.ShopStructure.HighShopTripGuide>();
            string tableName     = "tbl_HighShopTripGuide";
            string fields        = "ID,TypeID,Title,ContentText,ImagePath,UpdateTime,IsTop,TopTime";
            string primaryKey    = "ID";
            string orderByString = "IsTop desc,TopTime desc,UpdateTime desc";

            #region 查询条件
            StringBuilder strWhere = new StringBuilder();
            strWhere.Append(" 1=1 ");
            if (!string.IsNullOrEmpty(CompanyID))
            {
                strWhere.AppendFormat(" AND CompanyID='{0}' ", CompanyID);
            }
            if (!string.IsNullOrEmpty(KeyWord))
            {
                strWhere.AppendFormat(" AND title like'%{0}%'", KeyWord);
            }
            if (typeList != null && typeList.Length > 0)
            {
                string sqlTmp = "";
                foreach (EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType type in typeList)
                {
                    sqlTmp += string.Format("{0},", Convert.ToInt32(type));
                }
                strWhere.AppendFormat(" AND TypeID IN ({0})", sqlTmp.TrimEnd(",".ToCharArray()));
            }
            #endregion

            using (IDataReader dr = DbHelper.ExecuteReader(this._database, pageSize, pageIndex, ref recordCount, tableName, primaryKey, fields, strWhere.ToString(), orderByString))
            {
                while (dr.Read())
                {
                    EyouSoft.Model.ShopStructure.HighShopTripGuide model = new EyouSoft.Model.ShopStructure.HighShopTripGuide();
                    model.ID = dr.GetString(0);
                    if (!dr.IsDBNull(1))
                    {
                        model.TypeID = (EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType)dr.GetByte(1);
                    }
                    model.Title       = dr.GetString(2);
                    model.ContentText = dr.IsDBNull(3) ? "" :dr.GetString(3);
                    model.ImagePath   = dr.IsDBNull(4) ? "" : dr.GetString(4);
                    model.IssueTime   = dr.GetDateTime(5);
                    model.IsTop       = dr.IsDBNull(6) ? false : dr.GetString(6) == "1" ? true : false;
                    model.TopTime     = dr.IsDBNull(7) ? DateTime.Now : dr.GetDateTime(7);
                    list.Add(model);
                    model = null;
                }
            }
            return(list);
        }
Beispiel #9
0
 protected void rptTrip3_ItemCreated(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemIndex != -1)
     {
         EyouSoft.Model.ShopStructure.HighShopTripGuide trip = e.Item.DataItem as EyouSoft.Model.ShopStructure.HighShopTripGuide;
         if (trip != null)
         {
             HtmlAnchor a = e.Item.FindControl("linkTrip") as HtmlAnchor;
             if (a != null)
             {
                 string linkUrl = Utils.GenerateShopPageUrl2(string.Format("/MuDiDi_{0}", trip.ID), this.Master.CompanyId);
                 a.InnerText = Utils.GetText(trip.Title, 15);
                 a.HRef      = linkUrl;
             }
         }
     }
 }
Beispiel #10
0
        protected void InitPageData()
        {
            string KeyId = Utils.GetQueryStringValue("key");

            if (string.IsNullOrEmpty(KeyId))
            {
                Utils.ShowAndRedirect("未能找到该条信息", "/template4/GuideBooks.aspx");
            }
            EyouSoft.Model.ShopStructure.HighShopTripGuide model = EyouSoft.BLL.ShopStructure.HighShopTripGuide.CreateInstance().GetModel(KeyId);
            if (model == null)
            {
                Utils.ShowAndRedirect("未能找到该条信息", "/template4/GuideBooks.aspx");
            }
            lbTitle.InnerText   = model.Title;
            sTypeName.InnerText = model.TypeID.ToString();
            lbAddTime.Text      = model.IssueTime.ToString("yyyy-MM-dd");
            pContent.InnerHtml  = model.ContentText;
            model = null;
        }
Beispiel #11
0
 /// <summary>
 /// 数据绑定时处理特殊情况
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Literal ltrXH = (Literal)e.Item.FindControl("ltrXH");
         if (ltrXH != null)
         {
             ltrXH.Text = Convert.ToString(intPageSize * (CurrencyPage - 1) + (e.Item.ItemIndex + 1));
         }
         EyouSoft.Model.ShopStructure.HighShopTripGuide model = (EyouSoft.Model.ShopStructure.HighShopTripGuide)e.Item.DataItem;
         int typeId = (int)model.TypeID;
         if (typeId >= 8 && typeId <= 12)
         {
             Literal ltrType = (Literal)e.Item.FindControl("ltrType");
             if (ltrType != null)
             {
                 ltrType.Text = "<a><font class=\"C_blue\">[" + model.TypeID.ToString().Substring(2) + "]</font></a>";
             }
         }
         model = null;
     }
 }
Beispiel #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //获取出游指南
            string id = Utils.InputText(Request.QueryString["mudidiid"]);

            //string cid=Utils.InputText(Request.QueryString["cid"]);
            if (!string.IsNullOrEmpty(id))
            {
                EyouSoft.Model.ShopStructure.HighShopTripGuide guide = EyouSoft.BLL.ShopStructure.HighShopTripGuide.CreateInstance().GetModel(id);
                if (guide != null)
                {
                    ltrTitle.Text     = Utils.InputText(guide.Title);
                    ltrContent.Text   = guide.ContentText;
                    ltrIssuetime.Text = guide.IssueTime.ToString("yyyy-MM-dd HH:mm");

                    //出游指南类型
                    ltrTripTypeName.Text = guide.TypeID.ToString();

                    Page.Title = ltrTitle.Text + "_出游指南";
                }
                guide = null;
            }
        }
Beispiel #13
0
 protected void rptTrip1_ItemCreated(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemIndex != -1)
     {
         EyouSoft.Model.ShopStructure.HighShopTripGuide trip = e.Item.DataItem as EyouSoft.Model.ShopStructure.HighShopTripGuide;
         if (trip != null)
         {
             Literal ltr = e.Item.FindControl("ltrTrip") as Literal;
             if (ltr != null)
             {
                 string linkUrl = Utils.GenerateShopPageUrl2(string.Format("/MuDiDi_{0}", trip.ID), this.Master.CompanyId);
                 if (e.Item.ItemIndex == 0)
                 {
                     ltr.Text = string.Format(TripFormat1, linkUrl, Utils.GetLineShopImgPath(trip.ImagePath, 5), linkUrl, Utils.GetText(Utils.InputText(trip.ContentText), 35, true));
                 }
                 else
                 {
                     ltr.Text = string.Format(TripFormat2, linkUrl, Utils.GetText(trip.Title, 15));
                 }
             }
         }
     }
 }
Beispiel #14
0
        /// <summary>
        /// 获取前台指定条数的出游指南列表
        /// </summary>
        /// <param name="TopNumber">需要返回的条数 =0返回全部 >0返回指定条数的记录</param>
        /// <param name="CompanyID">公司编号</param>
        /// <param name="TypeID">类别编号 =0返回所有类别 >0返回指定类别的数据</param>
        /// <param name="KeyWord">需要匹配的关键字</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.ShopStructure.HighShopTripGuide> GetWebList(int TopNumber, string CompanyID, int TypeID, string KeyWord)
        {
            IList <EyouSoft.Model.ShopStructure.HighShopTripGuide> list = new List <EyouSoft.Model.ShopStructure.HighShopTripGuide>();
            StringBuilder strSql = new StringBuilder();

            if (TopNumber > 0)
            {
                strSql.AppendFormat(SQL_HighShopTripGuide_GETTOPLIST, "Top " + TopNumber.ToString());
            }
            else
            {
                strSql.AppendFormat(SQL_HighShopTripGuide_GETTOPLIST, string.Empty);
            }
            if (!string.IsNullOrEmpty(CompanyID))
            {
                strSql.AppendFormat(" where companyID='{0}' ", CompanyID);
            }
            if (TypeID > 0)
            {
                if (strSql.Length > 0)
                {
                    strSql.AppendFormat(" and TypeID={0}", TypeID);
                }
                else
                {
                    strSql.AppendFormat(" where TypeID={0}", TypeID);
                }
            }
            if (!string.IsNullOrEmpty(KeyWord))
            {
                if (strSql.Length > 0)
                {
                    strSql.AppendFormat(" and Title like'%{0}%'", KeyWord);
                }
                else
                {
                    strSql.AppendFormat(" where Title like'%{0}%'", KeyWord);
                }
            }
            strSql.Append(" order by IsTop desc,TopTime desc,UpdateTime desc");

            DbCommand dc = this._database.GetSqlStringCommand(strSql.ToString());

            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._database))
            {
                while (dr.Read())
                {
                    EyouSoft.Model.ShopStructure.HighShopTripGuide model = new EyouSoft.Model.ShopStructure.HighShopTripGuide();
                    model.ID = dr.GetString(0);
                    if (!dr.IsDBNull(1))
                    {
                        model.TypeID = (EyouSoft.Model.ShopStructure.HighShopTripGuide.TripGuideType)dr.GetByte(1);
                    }
                    model.Title       = dr.GetString(2);
                    model.ContentText = dr.IsDBNull(3) ? "" : dr.GetString(3);
                    model.ImagePath   = dr.IsDBNull(4) ? "" : dr.GetString(4);
                    model.IssueTime   = dr.GetDateTime(5);
                    model.IsTop       = dr.IsDBNull(6) ? false : dr.GetString(6) == "1" ? true : false;
                    model.TopTime     = dr.IsDBNull(7) ? DateTime.Now : dr.GetDateTime(7);
                    list.Add(model);
                    model = null;
                }
            }
            return(list);
        }