Esempio n. 1
0
        private bool DoEdit(int _id)
        {
            bool result = true;
            BLL.redpacket bll = new BLL.redpacket();
            Model.redpacket model = bll.GetRedPacketModel(_id);

            model.channel_id = this.channel_id;
            model.title = txtTitle.Text.Trim();
            model.content = Utils.ToHtml(txtContent.Text);
            model.market_price = decimal.Parse(txtMarketPrice.Text);
            model.sell_price = decimal.Parse(txtSellPrice.Text);
            model.total_count = int.Parse(txtTotal.Text.Trim());

            model.img_url = txtImgUrl.Text.Trim();
            model.start_date = txtStartDate.Text.Trim();
            model.end_date = txtEndDate.Text.Trim();
            model.status = string.IsNullOrEmpty(rdoStatus.SelectedValue) ? 0 : int.Parse(rdoStatus.SelectedValue);
            model.sort_id = int.Parse(txtSortId.Text.Trim());

            model.is_slide = 0;
            model.is_top = 0;
            model.is_red = 0;
            model.remark1 = "";
            model.remark2 = 0;
            if (cblItem.Items[0].Selected == true)
            {
                model.is_top = 1;
            }
            if (cblItem.Items[1].Selected == true)
            {
                model.is_red = 1;
            }

            model.albums = null;

            if (!bll.Update(model))
            {
                result = false;
            }
            return result;
        }
Esempio n. 2
0
        private void ShowInfo(int _id)
        {
            BLL.redpacket bll = new BLL.redpacket();
            Model.redpacket model = bll.GetRedPacketModel(_id);

            txtTitle.Text = model.title;
            txtContent.Text = Utils.ToTxt(model.content);
            txtMarketPrice.Text = model.market_price.ToString();
            txtSellPrice.Text = model.sell_price.ToString();
            txtTotal.Text = model.total_count.ToString();
            txtImgUrl.Text = model.img_url;
            txtStartDate.Text = model.start_date;
            txtEndDate.Text = model.end_date;
            rdoStatus.SelectedValue = model.status.ToString();
            txtSortId.Text = model.sort_id.ToString();

            if (model.is_top == 1)
            {
                cblItem.Items[0].Selected = true;
            }
            if (model.is_red == 1)
            {
                cblItem.Items[1].Selected = true;
            }
        }
Esempio n. 3
0
 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     ChkAdminLevel(channel_id, DTEnums.ActionEnum.Edit.ToString()); //检查权限
     int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);
     BLL.redpacket bll = new BLL.redpacket();
     Model.redpacket model = bll.GetRedPacketModel(id);
     switch (e.CommandName.ToLower())
     {
         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;
     }
     this.RptBind("id>0" + CombSqlTxt(this.channel_id ,this.keywords, this.property), " status desc,sort_id asc,add_time desc");
 }