Esempio n. 1
0
        //设置操作
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            ChkAdminLevel("plugin_link", OSEnums.ActionEnum.Edit.ToString()); //检查权限
            int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);

            BLL.plugins.link   bll   = new BLL.plugins.link();
            Model.plugins.link model = bll.GetModel(id);
            switch (e.CommandName.ToLower())
            {
            case "lbtnisred":
                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.keywords), "sort_id asc,add_time desc");
        }
Esempio n. 2
0
        private void ShowInfo(int _id)
        {
            BLL.plugins.link   bll   = new BLL.plugins.link();
            Model.plugins.link model = bll.GetModel(_id);

            txtTitle.Text = model.title;
            if (model.is_red == 1)
            {
                cbIsRed.Checked = true;
            }
            else
            {
                cbIsRed.Checked = false;
            }
            rblIsLock.SelectedValue = model.is_lock.ToString();
            txtSortId.Text          = model.sort_id.ToString();
            txtUserName.Text        = model.user_name;
            txtUserTel.Text         = model.user_tel;
            txtEmail.Text           = model.email;
            txtSiteUrl.Text         = model.site_url;
            txtImgUrl.Text          = model.img_url;
        }
Esempio n. 3
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.plugins.link   bll   = new BLL.plugins.link();
            Model.plugins.link model = bll.GetModel(_id);

            model.title   = txtTitle.Text.Trim();
            model.is_lock = Utils.StrToInt(rblIsLock.SelectedValue, 0);
            if (cbIsRed.Checked == true)
            {
                model.is_red = 1;
            }
            else
            {
                model.is_red = 0;
            }
            model.sort_id   = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            model.user_name = txtUserName.Text.Trim();
            model.user_tel  = txtUserTel.Text.Trim();
            model.email     = txtEmail.Text.Trim();
            model.site_url  = txtSiteUrl.Text.Trim();
            model.img_url   = txtImgUrl.Text.Trim();
            model.is_image  = 1;
            if (string.IsNullOrEmpty(model.img_url))
            {
                model.is_image = 0;
            }
            if (bll.Update(model))
            {
                AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Esempio n. 4
0
 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     ChkAdminLevel("plugin_link", OSEnums.ActionEnum.Edit.ToString()); //检查权限
     int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);
     BLL.plugins.link bll = new BLL.plugins.link();
     Model.plugins.link model = bll.GetModel(id);
     switch (e.CommandName.ToLower())
     {
         case "lbtnisred":
             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.keywords), "sort_id asc,add_time desc");
 }
Esempio n. 5
0
        private void ShowInfo(int _id)
        {
            BLL.plugins.link bll = new BLL.plugins.link();
            Model.plugins.link model = bll.GetModel(_id);

            txtTitle.Text = model.title;
            if (model.is_red == 1)
            {
                cbIsRed.Checked = true;
            }
            else
            {
                cbIsRed.Checked = false;
            }
            rblIsLock.SelectedValue = model.is_lock.ToString();
            txtSortId.Text = model.sort_id.ToString();
            txtUserName.Text = model.user_name;
            txtUserTel.Text = model.user_tel;
            txtEmail.Text = model.email;
            txtSiteUrl.Text = model.site_url;
            txtImgUrl.Text = model.img_url;
        }
Esempio n. 6
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.plugins.link bll = new BLL.plugins.link();
            Model.plugins.link model = bll.GetModel(_id);

            model.title = txtTitle.Text.Trim();
            model.is_lock = Utils.StrToInt(rblIsLock.SelectedValue, 0);
            if (cbIsRed.Checked == true)
            {
                model.is_red = 1;
            }
            else
            {
                model.is_red = 0;
            }
            model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            model.user_name = txtUserName.Text.Trim();
            model.user_tel = txtUserTel.Text.Trim();
            model.email = txtEmail.Text.Trim();
            model.site_url = txtSiteUrl.Text.Trim();
            model.img_url = txtImgUrl.Text.Trim();
            model.is_image = 1;
            if (string.IsNullOrEmpty(model.img_url))
            {
                model.is_image = 0;
            }
            if (bll.Update(model))
            {
                AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志
                result = true;
            }

            return result;
        }