//批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel(channel_id, ActionEnum.Delete.ToString()); //检查权限
     BLL.photo bll = new BLL.photo();
     Repeater rptList = new Repeater();
     switch (this.prolistview)
     {
         case "Txt":
             rptList = this.rptList1;
             break;
         default:
             rptList = this.rptList2;
             break;
     }
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             bll.Delete(this.channel_id, id);
         }
     }
     JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("photo_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
         this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
 }
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BLL.photo bll = new BLL.photo();
     Repeater rptList = new Repeater();
     switch (this.prolistview)
     {
         case "Txt":
             rptList = this.rptList1;
             break;
         default:
             rptList = this.rptList2;
             break;
     }
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("photo_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
         this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
 }
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel(channel_id, ActionEnum.Delete.ToString()); //检查权限
            BLL.photo bll     = new BLL.photo();
            Repeater  rptList = new Repeater();

            switch (this.prolistview)
            {
            case "Txt":
                rptList = this.rptList1;
                break;

            default:
                rptList = this.rptList2;
                break;
            }
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    bll.Delete(this.channel_id, id);
                }
            }
            JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("photo_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                                                    this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
        }
        //保存排序
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BLL.photo bll     = new BLL.photo();
            Repeater  rptList = new Repeater();

            switch (this.prolistview)
            {
            case "Txt":
                rptList = this.rptList1;
                break;

            default:
                rptList = this.rptList2;
                break;
            }
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                int sortId;
                if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
                {
                    sortId = 99;
                }
                bll.UpdateField(id, "sort_id=" + sortId.ToString());
            }
            JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("photo_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                                                    this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
        }
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (this.category_id > 0)
            {
                this.ddlCategoryId.SelectedValue = this.category_id.ToString();
            }
            this.ddlProperty.SelectedValue = this.property;
            this.txtKeywords.Text          = this.keywords;
            //图表或列表显示
            BLL.photo bll = new BLL.photo();
            switch (this.prolistview)
            {
            case "Txt":
                this.rptList2.Visible    = false;
                this.rptList1.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
                this.rptList1.DataBind();
                break;

            default:
                this.rptList1.Visible    = false;
                this.rptList2.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
                this.rptList2.DataBind();
                break;
            }
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("photo_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
                                              this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
        //图文模块
        private void digg_photo_add(HttpContext context)
        {
            string channel_type = DTRequest.GetFormString("channel_type");
            string digg_type    = DTRequest.GetFormString("digg_type");
            int    id           = DTRequest.GetFormInt("id");

            BLL.photo bll = new BLL.photo();
            if (!bll.Exists(id))
            {
                context.Response.Write("{msg:0, msgbox:\"信息不存在或已删除!\"}");
                return;
            }
            if (digg_type == "good")
            {
                bll.UpdateField(id, "digg_good=digg_good+1");
            }
            else
            {
                bll.UpdateField(id, "digg_act=digg_act+1");
            }
            Model.photo model = bll.GetModel(id);
            context.Response.Write("{msg:1, digggood:" + model.digg_good + ", diggact:" + model.digg_act + ", msgbox:\"成功顶或踩了一下!\"}");
            Utils.WriteCookie(DTKeys.COOKIE_DIGG_KEY, channel_type + id.ToString(), id.ToString(), 8640);
            return;
        }
        private void ShowInfo(int _id)
        {
            BLL.photo   bll   = new BLL.photo();
            Model.photo model = bll.GetModel(_id);

            ddlCategoryId.SelectedValue = model.category_id.ToString();
            txtTitle.Text   = model.title;
            txtPhotoNo.Text = model.photo_no;
            txtLinkUrl.Text = model.link_url;
            if (model.is_msg == 1)
            {
                cblItem.Items[0].Selected = true;
            }
            if (model.is_top == 1)
            {
                cblItem.Items[1].Selected = true;
            }
            if (model.is_red == 1)
            {
                cblItem.Items[2].Selected = true;
            }
            if (model.is_hot == 1)
            {
                cblItem.Items[3].Selected = true;
            }
            if (model.is_slide == 1)
            {
                cblItem.Items[4].Selected = true;
            }
            if (model.is_lock == 1)
            {
                cblItem.Items[5].Selected = true;
            }
            txtMarketPrice.Text    = model.market_price.ToString();
            txtSellPrice.Text      = model.sell_price.ToString();
            txtSortId.Text         = model.sort_id.ToString();
            txtClick.Text          = model.click.ToString();
            txtDiggGood.Text       = model.digg_good.ToString();
            txtDiggAct.Text        = model.digg_act.ToString();
            txtContent.Value       = model.content;
            txtSeoTitle.Text       = model.seo_title;
            txtSeoKeywords.Text    = model.seo_keywords;
            txtSeoDescription.Text = model.seo_description;
            //赋值上传的相册
            focus_photo.Value = model.img_url; //封面图片
            LitAlbumList.Text = GetAlbumHtml(model.photo_albums, model.img_url);
            //赋值属性列表
            LitAttributeList.Text = GetAttributeHtml(model.photo_attribute_values, this.channel_id, _id);
        }
Esempio n. 8
0
        /// <summary>
        /// 图文列表
        /// </summary>
        /// <param name="channel_id">频道ID</param>
        /// <param name="top">显示条数</param>
        /// <param name="strwhere">查询条件</param>
        /// <returns>DataTable</returns>
        protected DataTable get_photo_list(int channel_id, int category_id, int top, string strwhere, string orderby)
        {
            DataTable dt = new DataTable();

            if (channel_id > 0)
            {
                string _where = "channel_id=" + channel_id;
                if (category_id > 0)
                {
                    _where += " and category_id in(select id from dt_category where id=" + category_id + " and class_list like '%," + category_id + ",%')";
                }
                if (!string.IsNullOrEmpty(strwhere))
                {
                    _where += " and " + strwhere;
                }
                dt = new BLL.photo().GetList(top, _where, orderby).Tables[0];
            }
            return(dt);
        }
Esempio n. 9
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id = DTRequest.GetQueryInt("id");
     BLL.photo bll = new BLL.photo();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetModel(id);
     //浏览数+1
     bll.UpdateField(id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
         model.link_url = model.link_url.Trim();
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }
Esempio n. 10
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id = DTRequest.GetQueryInt("id");
     BLL.photo bll = new BLL.photo();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetModel(id);
     //浏览数+1
     bll.UpdateField(id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
     {
         model.link_url = model.link_url.Trim();
     }
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }
Esempio n. 11
0
        /// <summary>
        /// 图文分页列表
        /// </summary>
        /// <param name="channel_id">频道ID</param>
        /// <param name="page_size">页面大小</param>
        /// <param name="page_index">当前页码</param>
        /// <param name="strwhere">查询条件</param>
        /// <param name="totalcount">总记录数</param>
        /// <returns>DateTable</returns>
        protected DataTable get_photo_list(int channel_id, int category_id, int page_size, int page_index, string strwhere, out int totalcount)
        {
            DataTable dt = new DataTable();

            if (channel_id > 0)
            {
                string _where = "channel_id=" + channel_id;
                if (category_id > 0)
                {
                    _where += " and category_id in(select id from dt_category where id=" + category_id + " and class_list like '%," + category_id + ",%')";
                }
                if (!string.IsNullOrEmpty(strwhere))
                {
                    _where += " and " + strwhere;
                }
                dt = new BLL.photo().GetList(page_size, page_index, _where, "sort_id asc,add_time desc", out totalcount).Tables[0];
            }
            else
            {
                totalcount = 0;
            }
            return(dt);
        }
Esempio n. 12
0
        //设置操作
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            ChkAdminLevel(channel_id, ActionEnum.Edit.ToString()); //检查权限
            int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);

            BLL.photo   bll   = new BLL.photo();
            Model.photo model = bll.GetModel(id);
            switch (e.CommandName.ToLower())
            {
            case "ibtnmsg":
                if (model.is_msg == 1)
                {
                    bll.UpdateField(id, "is_msg=0");
                }
                else
                {
                    bll.UpdateField(id, "is_msg=1");
                }
                break;

            case "ibtntop":
                if (model.is_top == 1)
                {
                    bll.UpdateField(id, "is_top=0");
                }
                else
                {
                    bll.UpdateField(id, "is_top=1");
                }
                break;

            case "ibtnred":
                if (model.is_red == 1)
                {
                    bll.UpdateField(id, "is_red=0");
                }
                else
                {
                    bll.UpdateField(id, "is_red=1");
                }
                break;

            case "ibtnhot":
                if (model.is_hot == 1)
                {
                    bll.UpdateField(id, "is_hot=0");
                }
                else
                {
                    bll.UpdateField(id, "is_hot=1");
                }
                break;

            case "ibtnslide":
                if (model.is_slide == 1)
                {
                    bll.UpdateField(id, "is_slide=0");
                }
                else
                {
                    bll.UpdateField(id, "is_slide=1");
                }
                break;
            }
            this.RptBind("id>0" + CombSqlTxt(this.channel_id, this.category_id, this.keywords, this.property), "sort_id asc,add_time desc");
        }
Esempio n. 13
0
        private bool DoAdd()
        {
            bool result = true;
            DTcms.Model.photo model = new Model.photo();
            DTcms.BLL.photo bll = new BLL.photo();

            model.channel_id = this.channel_id;
            model.title = txtTitle.Text.Trim();
            model.category_id = int.Parse(ddlCategoryId.SelectedValue);
            model.photo_no = txtPhotoNo.Text.Trim();
            model.market_price = decimal.Parse(txtMarketPrice.Text.Trim());
            model.sell_price = decimal.Parse(txtSellPrice.Text.Trim());
            model.link_url = txtLinkUrl.Text.Trim();
            model.img_url = focus_photo.Value;
            model.content = txtContent.Value;
            model.seo_title = txtSeoTitle.Text.Trim();
            model.seo_keywords = txtSeoKeywords.Text.Trim();
            model.seo_description = txtSeoDescription.Text.Trim();
            model.sort_id = int.Parse(txtSortId.Text.Trim());
            model.click = int.Parse(txtClick.Text.Trim());
            model.is_msg = 0;
            model.is_top = 0;
            model.is_red = 0;
            model.is_hot = 0;
            model.is_slide = 0;
            model.is_lock = 0;
            if (cblItem.Items[0].Selected == true)
            {
                model.is_msg = 1;
            }
            if (cblItem.Items[1].Selected == true)
            {
                model.is_top = 1;
            }
            if (cblItem.Items[2].Selected == true)
            {
                model.is_red = 1;
            }
            if (cblItem.Items[3].Selected == true)
            {
                model.is_hot = 1;
            }
            if (cblItem.Items[4].Selected == true)
            {
                model.is_slide = 1;
            }
            if (cblItem.Items[5].Selected == true)
            {
                model.is_lock = 1;
            }
            //保存相册
            string[] albumArr = Request.Form.GetValues("hide_photo_name");
            if (albumArr != null && albumArr.Length > 0)
            {
                List<Model.photo_album> ls = new List<Model.photo_album>();
                for (int i = 0; i < albumArr.Length; i++)
                {
                    string[] imgArr = albumArr[i].Split('|');
                    if (imgArr.Length == 3)
                    {
                        ls.Add(new Model.photo_album { big_img = imgArr[1], small_img = imgArr[2] });
                    }
                }
                model.photo_albums = ls;
            }

            //扩展属性
            BLL.photo_attribute bll2 = new BLL.photo_attribute();
            DataSet ds2 = bll2.GetList("channel_id=" + this.channel_id);

            List<Model.photo_attribute_value> attrls = new List<Model.photo_attribute_value>();
            foreach (DataRow dr in ds2.Tables[0].Rows)
            {
                int attr_id = int.Parse(dr["id"].ToString());
                string attr_title = dr["title"].ToString();
                string attr_value = Request.Form["content_" + attr_id];
                if (!string.IsNullOrEmpty(attr_value))
                {
                    attrls.Add(new Model.photo_attribute_value { attribute_id = attr_id, title = attr_title, content = attr_value });
                }
            }
            model.photo_attribute_values = attrls;

            if (bll.Add(model) < 1)
            {
                result = false;
            }
            return result;
        }
Esempio n. 14
0
        private bool DoEdit(int _id)
        {
            bool result = true;

            DTcms.BLL.photo   bll   = new BLL.photo();
            DTcms.Model.photo model = bll.GetModel(_id);

            model.channel_id      = this.channel_id;
            model.title           = txtTitle.Text.Trim();
            model.category_id     = int.Parse(ddlCategoryId.SelectedValue);
            model.photo_no        = txtPhotoNo.Text.Trim();
            model.market_price    = decimal.Parse(txtMarketPrice.Text.Trim());
            model.sell_price      = decimal.Parse(txtSellPrice.Text.Trim());
            model.link_url        = txtLinkUrl.Text.Trim();
            model.img_url         = focus_photo.Value;
            model.content         = txtContent.Value;
            model.seo_title       = txtSeoTitle.Text.Trim();
            model.seo_keywords    = txtSeoKeywords.Text.Trim();
            model.seo_description = txtSeoDescription.Text.Trim();
            model.sort_id         = int.Parse(txtSortId.Text.Trim());
            model.click           = int.Parse(txtClick.Text.Trim());
            model.is_msg          = 0;
            model.is_top          = 0;
            model.is_red          = 0;
            model.is_hot          = 0;
            model.is_slide        = 0;
            model.is_lock         = 0;
            if (cblItem.Items[0].Selected == true)
            {
                model.is_msg = 1;
            }
            if (cblItem.Items[1].Selected == true)
            {
                model.is_top = 1;
            }
            if (cblItem.Items[2].Selected == true)
            {
                model.is_red = 1;
            }
            if (cblItem.Items[3].Selected == true)
            {
                model.is_hot = 1;
            }
            if (cblItem.Items[4].Selected == true)
            {
                model.is_slide = 1;
            }
            if (cblItem.Items[5].Selected == true)
            {
                model.is_lock = 1;
            }
            //保存相册
            if (model.photo_albums != null)
            {
                model.photo_albums.Clear();
            }
            string[] albumArr = Request.Form.GetValues("hide_photo_name");
            if (albumArr != null)
            {
                List <Model.photo_album> ls = new List <Model.photo_album>();
                for (int i = 0; i < albumArr.Length; i++)
                {
                    string[] imgArr = albumArr[i].Split('|');
                    int      img_id = int.Parse(imgArr[0]);
                    if (imgArr.Length == 3)
                    {
                        ls.Add(new Model.photo_album {
                            id = img_id, photo_id = _id, big_img = imgArr[1], small_img = imgArr[2]
                        });
                    }
                }
                model.photo_albums = ls;
            }

            //扩展属性
            BLL.photo_attribute bll2 = new BLL.photo_attribute();
            DataSet             ds2  = bll2.GetList("channel_id=" + this.channel_id);

            List <Model.photo_attribute_value> attrls = new List <Model.photo_attribute_value>();

            foreach (DataRow dr in ds2.Tables[0].Rows)
            {
                int    attr_id            = int.Parse(dr["id"].ToString());
                string attr_title         = dr["title"].ToString();
                string attr_value_id      = Request.Form["value_" + attr_id];
                string attr_value_content = Request.Form["content_" + attr_id];
                if (!string.IsNullOrEmpty(attr_value_id) && !string.IsNullOrEmpty(attr_value_content))
                {
                    attrls.Add(new Model.photo_attribute_value {
                        id = Convert.ToInt32(attr_value_id), photo_id = _id, attribute_id = attr_id, title = attr_title, content = attr_value_content
                    });
                }
            }
            model.photo_attribute_values = attrls;

            if (!bll.Update(model))
            {
                result = false;
            }
            return(result);
        }
 //图文模块
 private void digg_photo_add(HttpContext context)
 {
     string channel_type = DTRequest.GetFormString("channel_type");
     string digg_type = DTRequest.GetFormString("digg_type");
     int id = DTRequest.GetFormInt("id");
     BLL.photo bll = new BLL.photo();
     if (!bll.Exists(id))
     {
         context.Response.Write("{msg:0, msgbox:\"信息不存在或已删除!\"}");
         return;
     }
     if (digg_type == "good")
     {
         bll.UpdateField(id, "digg_good=digg_good+1");
     }
     else
     {
         bll.UpdateField(id, "digg_act=digg_act+1");
     }
     Model.photo model = bll.GetModel(id);
     context.Response.Write("{msg:1, digggood:" + model.digg_good + ", diggact:" + model.digg_act + ", msgbox:\"成功顶或踩了一下!\"}");
     Utils.WriteCookie(DTKeys.COOKIE_DIGG_KEY, channel_type + id.ToString(), id.ToString(), 8640);
     return;
 }
Esempio n. 16
0
 /// <summary>
 /// 图文分页列表
 /// </summary>
 /// <param name="channel_id">频道ID</param>
 /// <param name="page_size">页面大小</param>
 /// <param name="page_index">当前页码</param>
 /// <param name="strwhere">查询条件</param>
 /// <param name="totalcount">总记录数</param>
 /// <returns>DateTable</returns>
 protected DataTable get_photo_list(int channel_id, int category_id, int page_size, int page_index, string strwhere, out int totalcount)
 {
     DataTable dt = new DataTable();
     if (channel_id > 0)
     {
         string _where = "channel_id=" + channel_id;
         if (category_id > 0)
         {
             _where += " and category_id in(select id from dt_category where id=" + category_id + " and class_list like '%," + category_id + ",%')";
         }
         if (!string.IsNullOrEmpty(strwhere))
         {
             _where += " and " + strwhere;
         }
         dt = new BLL.photo().GetList(page_size, page_index, _where, "sort_id asc,add_time desc", out totalcount).Tables[0];
     }
     else
     {
         totalcount = 0;
     }
     return dt;
 }
Esempio n. 17
0
 /// <summary>
 /// 图文列表
 /// </summary>
 /// <param name="channel_id">频道ID</param>
 /// <param name="top">显示条数</param>
 /// <param name="strwhere">查询条件</param>
 /// <returns>DataTable</returns>
 protected DataTable get_photo_list(int channel_id, int category_id, int top, string strwhere, string orderby)
 {
     DataTable dt = new DataTable();
     if (channel_id > 0)
     {
         string _where = "channel_id=" + channel_id;
         if (category_id > 0)
         {
             _where += " and category_id in(select id from dt_category where id=" + category_id + " and class_list like '%," + category_id + ",%')";
         }
         if (!string.IsNullOrEmpty(strwhere))
         {
             _where += " and " + strwhere;
         }
         dt = new BLL.photo().GetList(top, _where, orderby).Tables[0];
     }
     return dt;
 }
Esempio n. 18
0
 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     ChkAdminLevel(channel_id, ActionEnum.Edit.ToString()); //检查权限
     int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);
     BLL.photo bll = new BLL.photo();
     Model.photo model = bll.GetModel(id);
     switch (e.CommandName.ToLower())
     {
         case "ibtnmsg":
             if (model.is_msg == 1)
                 bll.UpdateField(id, "is_msg=0");
             else
                 bll.UpdateField(id, "is_msg=1");
             break;
         case "ibtntop":
             if (model.is_top == 1)
                 bll.UpdateField(id, "is_top=0");
             else
                 bll.UpdateField(id, "is_top=1");
             break;
         case "ibtnred":
             if (model.is_red == 1)
                 bll.UpdateField(id, "is_red=0");
             else
                 bll.UpdateField(id, "is_red=1");
             break;
         case "ibtnhot":
             if (model.is_hot == 1)
                 bll.UpdateField(id, "is_hot=0");
             else
                 bll.UpdateField(id, "is_hot=1");
             break;
         case "ibtnslide":
             if (model.is_slide == 1)
                 bll.UpdateField(id, "is_slide=0");
             else
                 bll.UpdateField(id, "is_slide=1");
             break;
     }
     this.RptBind("id>0" + CombSqlTxt(this.channel_id, this.category_id, this.keywords, this.property), "sort_id asc,add_time desc");
 }
Esempio n. 19
0
 private void RptBind(string _strWhere, string _orderby)
 {
     this.page = DTRequest.GetQueryInt("page", 1);
     if (this.category_id > 0)
     {
         this.ddlCategoryId.SelectedValue = this.category_id.ToString();
     }
     this.ddlProperty.SelectedValue = this.property;
     this.txtKeywords.Text = this.keywords;
     //图表或列表显示
     BLL.photo bll = new BLL.photo();
     switch (this.prolistview)
     {
         case "Txt":
             this.rptList2.Visible = false;
             this.rptList1.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
             this.rptList1.DataBind();
             break;
         default:
             this.rptList1.Visible = false;
             this.rptList2.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
             this.rptList2.DataBind();
             break;
     }
     //绑定页码
     txtPageNum.Text = this.pageSize.ToString();
     string pageUrl = Utils.CombUrlTxt("photo_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
         this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__");
     PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
 }
Esempio n. 20
0
        private void ShowInfo(int _id)
        {
            BLL.photo bll = new BLL.photo();
            Model.photo model = bll.GetModel(_id);

            ddlCategoryId.SelectedValue = model.category_id.ToString();
            txtTitle.Text = model.title;
            txtPhotoNo.Text = model.photo_no;
            txtLinkUrl.Text = model.link_url;
            if (model.is_msg == 1)
            {
                cblItem.Items[0].Selected = true;
            }
            if (model.is_top == 1)
            {
                cblItem.Items[1].Selected = true;
            }
            if (model.is_red == 1)
            {
                cblItem.Items[2].Selected = true;
            }
            if (model.is_hot == 1)
            {
                cblItem.Items[3].Selected = true;
            }
            if (model.is_slide == 1)
            {
                cblItem.Items[4].Selected = true;
            }
            if (model.is_lock == 1)
            {
                cblItem.Items[5].Selected = true;
            }
            txtMarketPrice.Text = model.market_price.ToString();
            txtSellPrice.Text = model.sell_price.ToString();
            txtSortId.Text = model.sort_id.ToString();
            txtClick.Text = model.click.ToString();
            txtDiggGood.Text = model.digg_good.ToString();
            txtDiggAct.Text = model.digg_act.ToString();
            txtContent.Value = model.content;
            txtSeoTitle.Text = model.seo_title;
            txtSeoKeywords.Text = model.seo_keywords;
            txtSeoDescription.Text = model.seo_description;
            //赋值上传的相册
            focus_photo.Value = model.img_url; //封面图片
            LitAlbumList.Text = GetAlbumHtml(model.photo_albums, model.img_url);
            //赋值属性列表
            LitAttributeList.Text = GetAttributeHtml(model.photo_attribute_values, this.channel_id, _id);
        }