Ejemplo n.º 1
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DtCms.BLL.Products   bll   = new DtCms.BLL.Products();
            DtCms.Model.Products model = bll.GetModel(this.Id);

            model.Title   = txtTitle.Text.Trim();
            model.Guige   = txtGuige.Text.Trim();
            model.Xinghao = txtXinghao.Text.Trim();
            model.Price   = decimal.Parse(txtPrice.Text.Trim());
            model.ClassId = int.Parse(ddlClassId.SelectedValue);
            model.ImgUrl  = txtImgUrl.Text.Trim();
            model.Content = FCKeditor.Value;
            model.Click   = int.Parse(txtClick.Text.Trim());

            model.IsMsg   = 0;
            model.IsTop   = 0;
            model.IsRed   = 0;
            model.IsHot   = 0;
            model.IsSlide = 0;
            model.IsLock  = 0;
            if (cblItem.Items[0].Selected == true)
            {
                model.IsMsg = 1;
            }
            if (cblItem.Items[1].Selected == true)
            {
                model.IsTop = 1;
            }
            if (cblItem.Items[2].Selected == true)
            {
                model.IsRed = 1;
            }
            if (cblItem.Items[3].Selected == true)
            {
                model.IsHot = 1;
            }
            if (cblItem.Items[4].Selected == true)
            {
                model.IsSlide = 1;
            }
            if (cblItem.Items[5].Selected == true)
            {
                model.IsLock = 1;
            }
            bll.Update(model);
            JscriptPrint("编辑成功啦!", "List.aspx", "Success");
        }
Ejemplo n.º 2
0
        //赋值操作
        private void ShowInfo(int _id)
        {
            DtCms.BLL.Products   bll   = new DtCms.BLL.Products();
            DtCms.Model.Products model = bll.GetModel(_id);

            txtTitle.Text            = model.Title;
            txtGuige.Text            = model.Guige;
            txtXinghao.Text          = model.Xinghao;
            txtPrice.Text            = model.Price.ToString();
            ddlClassId.SelectedValue = model.ClassId.ToString();
            txtImgUrl.Text           = model.ImgUrl;
            FCKeditor.Value          = model.Content;
            txtClick.Text            = model.Click.ToString();
            if (model.IsMsg == 1)
            {
                cblItem.Items[0].Selected = true;
            }
            if (model.IsTop == 1)
            {
                cblItem.Items[1].Selected = true;
            }
            if (model.IsRed == 1)
            {
                cblItem.Items[2].Selected = true;
            }
            if (model.IsHot == 1)
            {
                cblItem.Items[3].Selected = true;
            }
            if (model.IsSlide == 1)
            {
                cblItem.Items[4].Selected = true;
            }
            if (model.IsLock == 1)
            {
                cblItem.Items[5].Selected = true;
            }
        }
Ejemplo n.º 3
0
        //设置操作
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);

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

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

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

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

            case "ibtnslide":
                if (model.IsSlide == 1)
                {
                    bll.UpdateField(id, "IsSlide=0");
                }
                else
                {
                    bll.UpdateField(id, "IsSlide=1");
                }
                break;
            }
            this.RptBind("Id>0" + CombSqlTxt(this.classId, this.keywords, this.property), "AddTime desc");
        }