예제 #1
0
        private void RptBind(string strWhere, string orderby)
        {
            if (!int.TryParse(Request.Params["page"] as string, out this.page))
            {
                this.page = 0;
            }
            Spread.BLL.Dealer bll = new Spread.BLL.Dealer();
            //获得总条数
            this.pcount = bll.GetCount(strWhere);
            if (this.pcount > 0)
            {
                this.lbtnDel.Enabled = true;
            }
            else
            {
                this.lbtnDel.Enabled = false;
            }
            if (this.classId > 0)
            {
                this.ddlClassId.SelectedValue = this.classId.ToString();
            }
            this.txtKeywords.Text = this.keywords;


            this.rptList.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, orderby);
            this.rptList.DataBind();
        }
예제 #2
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Spread.BLL.Dealer bll = new Spread.BLL.Dealer();
            Spread.Model.Dealer model = bll.GetModel(this.Id);

            model.Title = txtTitle.Text.Trim();
            model.Form = txtForm.Text.Trim();
            model.ClassId = int.Parse(ddlClassId.SelectedValue);
            model.ImgUrl = "";
            model.AddTime = DateTime.Now;
            model.Zhaiyao = "";
            model.IsMsg = false;
            model.IsTop = false;
            model.IsRed = false;
            model.IsHot = false;
            model.IsSlide = false;
            model.GType = "";
            model.GFactory = "";
            model.GBrand = ddlBrand.SelectedValue;
            model.Code1 = "";
            model.Code2 ="";            
            model.LanguageType = "zh";
            bll.Update(model);
            JscriptPrint("经销商编辑成功啦!", "List.aspx", "Success");
        }
예제 #3
0
 //赋值操作
 private void ShowInfo(int _id)
 {
     Spread.BLL.Dealer bll = new Spread.BLL.Dealer();
     Spread.Model.Dealer model = bll.GetModel(_id);
     txtTitle.Text = model.Title;
     txtForm.Text = model.Form;
     ddlClassId.SelectedValue = model.ClassId.ToString();
     this.ddlBrand.SelectedValue = model.GBrand.ToString();
 }
예제 #4
0
 //删除
 protected void lbtnDel_Click(object sender, EventArgs e)
 {
     chkLoginLevel("delDealer");
     Spread.BLL.Dealer bll = new Spread.BLL.Dealer();
     //批量删除
     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");
 }
예제 #5
0
 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);
     Spread.BLL.Dealer bll = new Spread.BLL.Dealer();
     Spread.Model.Dealer 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 and LanguageType='zh' " + this.CombSqlTxt(this.classId, this.keywords, this.property), "AddTime desc");
 }