Example #1
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.title      = txtTitle.Text.Trim();
            model.build_path = txtBuildPath.Text.Trim();
            model.domain     = txtDomain.Text.Trim();
            model.sort_id    = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsDefault.Checked == true)
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }
            if (cbIsMobile.Checked == true)
            {
                model.is_mobile = 1;
            }
            else
            {
                model.is_mobile = 0;
            }
            model.name            = txtName.Text.Trim();
            model.logo            = txtLogo.Text.Trim();
            model.company         = txtCompany.Text.Trim();
            model.address         = txtAddress.Text.Trim();
            model.tel             = txtTel.Text.Trim();
            model.fax             = txtFax.Text.Trim();
            model.email           = txtEmail.Text.Trim();
            model.crod            = txtCrod.Text.Trim();
            model.seo_title       = txtSeoTitle.Text.Trim();
            model.seo_keyword     = txtSeoKeyword.Text.Trim();
            model.seo_description = Utils.DropHTML(txtSeoDescription.Text);
            model.copyright       = txtCopyright.Text.Trim();

            if (bll.Update(model))
            {
                //更新一下域名缓存
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改站点:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Example #2
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.title      = txtTitle.Text.Trim();
            model.build_path = txtBuildPath.Text.Trim();
            model.domain     = txtDomain.Text.Trim();
            model.sort_id    = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsDefault.Checked == true)
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }
            if (cbIsMobile.Checked == true)
            {
                model.is_mobile = 1;
            }
            else
            {
                model.is_mobile = 0;
            }
            model.inherit_id      = int.Parse(ddlSiteId.SelectedValue);
            model.name            = txtName.Text.Trim();
            model.company         = txtCompany.Text.Trim();
            model.address         = txtAddress.Text.Trim();
            model.tel             = txtTel.Text.Trim();
            model.fax             = txtFax.Text.Trim();
            model.email           = txtEmail.Text.Trim();
            model.crod            = txtCrod.Text.Trim();
            model.seo_title       = txtSeoTitle.Text.Trim();
            model.seo_keyword     = txtSeoKeyword.Text.Trim();
            model.seo_description = Utils.DropHTML(txtSeoDescription.Text);
            model.copyright       = txtCopyright.Text.Trim();
            //判断上传图片
            if (this.imgUpload.HasFile)
            {
                //上传前先删除原图片
                if (!string.IsNullOrEmpty(model.logo))
                {
                    Utils.DeleteFile(model.logo);
                }
                Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false);
                if (upfile.status > 0)
                {
                    model.logo = upfile.path;
                }
            }
            else
            {
                //判断是否需要删除原图
                if (txtLogo.Text.Trim() == "" && !string.IsNullOrEmpty(model.logo))
                {
                    Utils.DeleteFile(model.logo);
                }
                model.logo = txtLogo.Text.Trim();
            }
            //百度推送
            if (bdSend.Checked == true)
            {
                model.bdsend = 1;
            }
            else
            {
                model.bdsend = 0;
            }
            model.bdtoken = bdToken.Text.Trim();

            if (bll.Update(model))
            {
                //更新一下域名缓存
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改站点:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Example #3
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.channel_site bll = new BLL.channel_site();
            Model.channel_site model = bll.GetModel(_id);

            model.title = txtTitle.Text.Trim();
            model.build_path = txtBuildPath.Text.Trim();
            model.domain = txtDomain.Text.Trim();
            model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsDefault.Checked == true)
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }
            model.name = txtName.Text.Trim();
            model.logo = txtLogo.Text.Trim();
            model.company = txtCompany.Text.Trim();
            model.address = txtAddress.Text.Trim();
            model.tel = txtTel.Text.Trim();
            model.fax = txtFax.Text.Trim();
            model.email = txtEmail.Text.Trim();
            model.crod = txtCrod.Text.Trim();
            model.seo_title = txtSeoTitle.Text.Trim();
            model.seo_keyword = txtSeoKeyword.Text.Trim();
            model.seo_description = Utils.DropHTML(txtSeoDescription.Text);
            model.copyright = txtCopyright.Text.Trim();

            if (bll.Update(model))
            {
                //更新一下域名缓存
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改站点:" + model.title); //记录日志
                result = true;
            }

            return result;
        }