Example #1
0
 //赋值操作
 private void ShowInfo(int _id)
 {
     Spread.BLL.Goods bll = new Spread.BLL.Goods();
     Spread.Model.Goods model = bll.GetModel(_id);
     txtTitle.Text = model.Title;
     txtForm.Text = model.Form;
     txtImgUrl.Text = model.ImgUrl;
     content1.Value = model.Zhaiyao;
     if (model.IsMsg == true)
     {
         cblItem.Items[0].Selected = true;
     }
     if (model.IsTop == true)
     {
         cblItem.Items[1].Selected = true;
     }
     if (model.IsRed == true)
     {
         cblItem.Items[2].Selected = true;
     }
     if (model.IsHot == true)
     {
         cblItem.Items[3].Selected = true;
     }
     if (model.IsSlide == true)
     {
         cblItem.Items[4].Selected = true;
     }
     this.txtBak5.Text=model.Bak5;
 }
Example #2
0
 private void Info()
 {
     StringBuilder sql = new StringBuilder();
     Spread.BLL.Goods bllGoods = new Spread.BLL.Goods();
     sql.Append(" ClassId<>7905 ");
     if (!string.IsNullOrEmpty(this.Conditions1.Value) && this.Conditions1.Value != "模糊查询")
     {
         sql.Append(" and (Title like '%" + this.Conditions1.Value + "%' or Zhaiyao like '%" + this.Conditions1.Value + "%' or GType like '%" + this.Conditions1.Value + "%' or GFactory like '%" + this.Conditions1.Value + "%' or GBrand like '%" + this.Conditions1.Value + "%') ");
     }
     if (!string.IsNullOrEmpty(this.Conditions2.Value) && this.Conditions2.Value != "类型")
     {
         sql.Append(" and GType like '%" + this.Conditions2.Value + "%'");
     }
     if (!string.IsNullOrEmpty(this.Conditions3.Value) && this.Conditions3.Value != "车厂")
     {
         sql.Append(" and GFactory like '%" + this.Conditions3.Value + "%'");
     }
     if (!string.IsNullOrEmpty(this.Conditions4.Value) && this.Conditions4.Value != "品牌")
     {
         sql.Append(" and GBrand like '%" + this.Conditions4.Value + "%'");
     }
     DataTable dt = bllGoods.GetList(sql.ToString()).Tables[0];
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         strType += "<div class=\"bd\"><b>" + dt.Rows[i]["GType"] + "</b></div>";
         strDesc += "<div class=\"bd\">" + dt.Rows[i]["Form"] + "</div>";
     }
 }
Example #3
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void info()
        {
            Spread.BLL.Goods bllGoods = new Spread.BLL.Goods();
            Spread.BLL.Article bllArticle = new Spread.BLL.Article();

            DataTable dt = bllGoods.GetList(6, "IsHot=1 ", "ID ASC").Tables[0];
            Article = bllArticle.GetList(6, " ", "a.AddTime DESC").Tables[0];
            Goods = dt;
        }
Example #4
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Spread.BLL.Goods bll = new Spread.BLL.Goods();
            Spread.Model.Goods model = bll.GetModel(this.Id);

            model.Title = txtTitle.Text.Trim();
            model.Form = txtForm.Text.Trim();  
            model.ClassId = 0;
            model.ImgUrl = txtImgUrl.Text.Trim();
            model.AddTime = DateTime.Now;
            model.Zhaiyao = content1.Value;
            model.IsMsg = false;
            model.IsTop = false;
            model.IsRed = false;
            model.IsHot = false;
            model.IsSlide = false;
            model.GType = "";
            model.GFactory = "";
            model.GBrand = "";
            model.Code1 = "";
            model.Code2 = "";
            model.Bak1 = "";
            model.Bak2 = "";
            model.Bak3 = "";
            model.Bak4 = "";
            model.Bak5 = "";
            if (cblItem.Items[0].Selected == true)
            {
                model.IsMsg = true;
            }
            if (cblItem.Items[1].Selected == true)
            {
                model.IsTop = true;
            }
            if (cblItem.Items[2].Selected == true)
            {
                model.IsRed = true;
            }
            if (cblItem.Items[3].Selected == true)
            {
                model.IsHot = true;
            }
            if (cblItem.Items[4].Selected == true)
            {
                model.IsSlide = true;
            }
            bll.Update(model);
            JscriptPrint("游戏编辑成功啦!", "List.aspx", "Success");
        }
Example #5
0
 public string ProductInfo(string menuId)
 {
     StringBuilder html = new StringBuilder();
     Spread.BLL.Goods bllGoods = new Spread.BLL.Goods();
     DataTable dt = bllGoods.GetList(10, "ClassId=" + menuId + "", "ID ASC").Tables[0];
     if (dt.Rows.Count > 0)
     {
         html.Append("<ul>");
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             html.Append("<li> <a href=\"/Product/Default.aspx?id=" + dt.Rows[i]["ID"] + "\">" + dt.Rows[i]["Title"] + "</a></li>");
         }
         html.Append("</ul>");
     }
     return html.ToString();
 }
Example #6
0
 private void Info()
 {          
     Spread.BLL.Goods bllGoods = new Spread.BLL.Goods();
     Spread.BLL.Menu bllMenu = new Spread.BLL.Menu();
     if(Pid>0){               
         DataTable dt = bllGoods.GetList(1, "ClassId=" + Pid + "", "ID ASC").Tables[0];
         if(dt.Rows.Count>0){
             
             lbMenu.Text = " > <a class=\"col-01\" href=\"/Product/Default.aspx?id=" + dt.Rows[0]["ID"].ToString() + "\">" + dt.Rows[0]["Title"].ToString() + "</a>";
             this.Goods = dt;
         }
     }
     if (Id > 0)
     {
         DataTable dt = bllGoods.GetList(1, "Id=" + Id + "", "ID ASC").Tables[0];
         if (dt.Rows.Count > 0)
         {
             lbMenu.Text = " > <a class=\"col-01\" href=\"/Product/Default.aspx?id=" + dt.Rows[0]["ID"].ToString() + "\">" + dt.Rows[0]["Title"].ToString() + "</a>";
             this.Goods = dt;
         }
        
     }
 }
Example #7
0
        private void RptBind(string strWhere, string orderby)
        {
            if (!int.TryParse(Request.Params["page"] as string, out this.page))
            {
                this.page = 0;
            }
            Spread.BLL.Goods bll = new Spread.BLL.Goods();
            //获得总条数
            this.pcount = bll.GetCount(strWhere);
            if (this.pcount > 0)
            {
                this.lbtnDel.Enabled = true;
            }
            else
            {
                this.lbtnDel.Enabled = false;
            }
           
            this.txtKeywords.Text = this.keywords;
            this.ddlProperty.SelectedValue = this.property;

            this.rptList.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, orderby);
            this.rptList.DataBind();
        }
Example #8
0
 //删除
 protected void lbtnDel_Click(object sender, EventArgs e)
 {
     chkLoginLevel("delGoods");
     Spread.BLL.Goods bll = new Spread.BLL.Goods();
     //批量删除
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((Label)rptList.Items[i].FindControl("lb_id")).Text);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
         if (cb.Checked)
         {
             bll.Delete(id);
         }
     }
     JscriptPrint("批量删除成功啦!", "List.aspx?" + CombUrlTxt(this.classId, this.keywords, this.property) + "page=0", "Success");
 }
Example #9
0
 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);
     Spread.BLL.Goods bll = new Spread.BLL.Goods();
     Spread.Model.Goods model = bll.GetModel(id);
     switch (e.CommandName.ToLower())
     {
         case "ibtnmsg":
             if (model.IsMsg == true)
                 bll.UpdateField(id, "IsMsg=false");
             else
                 bll.UpdateField(id, "IsMsg=true");
             break;
         case "ibtntop":
             if (model.IsTop == true)
                 bll.UpdateField(id, "IsTop=false");
             else
                 bll.UpdateField(id, "IsTop=true");
             break;
         case "ibtnred":
             if (model.IsRed == true)
                 bll.UpdateField(id, "IsRed=false");
             else
                 bll.UpdateField(id, "IsRed=true");
             break;
         case "ibtnhot":
             if (model.IsHot == true)
                 bll.UpdateField(id, "IsHot=false");
             else
                 bll.UpdateField(id, "IsHot=true");
             break;
         case "ibtnslide":
             if (model.IsSlide == true)
                 bll.UpdateField(id, "IsSlide=false");
             else
                 bll.UpdateField(id, "IsSlide=true");
             break;
     }
     RptBind("Id>0" + this.CombSqlTxt(this.classId, this.keywords, this.property), "AddTime desc");
 }