Exemplo n.º 1
0
        private bool DoEdit(int _id)
        {
            bool result = true;

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

            model.title     = txtTitle.Text.Trim();
            model.is_lock   = int.Parse(rblIsLock.SelectedValue);
            model.is_red    = int.Parse(rblIsRed.SelectedValue);
            model.sort_id   = int.Parse(txtSortId.Text.Trim());
            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))
            {
                result = false;
            }

            return(result);
        }
Exemplo n.º 2
0
        private void ShowInfo(int _id)
        {
            BLL.link   bll   = new BLL.link();
            Model.link model = bll.GetModel(_id);

            ddlSitePath.SelectedValue = model.site_path;
            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;
            if (!string.IsNullOrEmpty(model.img_url))
            {
                ImgDiv.Visible  = true;
                ImgUrl.ImageUrl = model.img_url;
            }
        }
Exemplo n.º 3
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.site_path = ddlSitePath.SelectedValue;
            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.is_image  = 1;
            if (string.IsNullOrEmpty(model.img_url))
            {
                model.is_image = 0;
            }
            //判断上传图片
            if (this.imgUpload.HasFile)
            {
                //上传前先删除原图片
                if (!string.IsNullOrEmpty(model.img_url))
                {
                    Utils.DeleteFile(model.img_url);
                }
                DTcms.Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false);
                if (upfile.status > 0)
                {
                    model.img_url = upfile.path;
                }
            }
            else
            {
                //判断是否需要删除原图
                if (txtImgUrl.Text.Trim() == "" && !string.IsNullOrEmpty(model.img_url))
                {
                    Utils.DeleteFile(model.img_url);
                }
                model.img_url = txtImgUrl.Text.Trim();
            }
            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志
                result = true;
            }
            return(result);
        }
Exemplo n.º 4
0
        private void ShowInfo(int _id)
        {
            BLL.link   bll   = new BLL.link();
            Model.link model = bll.GetModel(_id);

            txtTitle.Text           = model.title;
            rblIsRed.SelectedValue  = model.is_red.ToString();
            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;
        }
Exemplo n.º 5
0
        //设置操作
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);

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

            ddlSitePath.SelectedValue = model.site_path;
            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;
        }
Exemplo n.º 7
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.site_path = ddlSitePath.SelectedValue;
            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(DTEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Exemplo n.º 8
0
        private bool DoEdit(int _id)
        {
            bool result = true;
            BLL.link bll = new BLL.link();
            Model.link model = bll.GetModel(_id);

            model.title = txtTitle.Text.Trim();
            model.is_lock = int.Parse(rblIsLock.SelectedValue);
            model.is_red = int.Parse(rblIsRed.SelectedValue);
            model.sort_id = int.Parse(txtSortId.Text.Trim());
            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))
            {
                result = false;
            }

            return result;
        }
Exemplo n.º 9
0
        private void ShowInfo(int _id)
        {
            BLL.link bll = new BLL.link();
            Model.link model = bll.GetModel(_id);

            txtTitle.Text = model.title;
            rblIsRed.SelectedValue = model.is_red.ToString();
            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;
        }
Exemplo n.º 10
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.link bll = new BLL.link();
            Model.link model = bll.GetModel(_id);

            model.site_path = ddlSitePath.SelectedValue;
            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(DTEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志
                result = true;
            }

            return result;
        }
Exemplo n.º 11
0
 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);
     BLL.link bll = new BLL.link();
     Model.link model = bll.GetModel(id);
     switch (e.CommandName.ToLower())
     {
         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.keywords), "sort_id asc,add_time desc");
 }