Exemplo n.º 1
0
        private bool DoAdd()
        {
            bool result = false;

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

            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.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加友情链接:" + model.title); //记录日志
                result = true;
            }
            return(result);
        }
Exemplo n.º 2
0
        private bool DoAdd()
        {
            bool result = true;

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

            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.Add(model) < 1)
            {
                result = false;
            }
            return(result);
        }
Exemplo n.º 3
0
        private bool DoAdd()
        {
            bool result = false;

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

            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)
            {
                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
            {
                model.img_url = txtImgUrl.Text.Trim();
            }
            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加友情链接:" + model.title); //记录日志
                result = true;
            }
            return(result);
        }
Exemplo n.º 4
0
        private void link_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();

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

            string _site_path = DTRequest.GetQueryString("site");
            string _code      = DTRequest.GetFormString("txtCode");
            string _title     = DTRequest.GetFormString("txtTitle");
            string _user_name = DTRequest.GetFormString("txtUserName");
            string _user_tel  = DTRequest.GetFormString("txtUserTel");
            string _email     = DTRequest.GetFormString("txtEmail");
            string _site_url  = DTRequest.GetFormString("txtSiteUrl");
            string _img_url   = DTRequest.GetFormString("txtImgUrl");

            //检查站点目录
            if (string.IsNullOrEmpty(_site_path))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,网站传输参数有误!\"}");
                return;
            }
            //校检验证码
            if (string.IsNullOrEmpty(_code))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,请输入验证码!\"}");
                return;
            }
            if (context.Session[DTKeys.SESSION_CODE] == null)
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,系验证码已过期!\"}");
                return;
            }
            if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            {
                context.Response.Write("{\"status\":0, \"msg\":\"验证码与系统的不一致!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_title))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入网站标题!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_site_url))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入网站网址!\"}");
                return;
            }
            model.site_path = Utils.DropHTML(_site_path);
            model.title     = Utils.DropHTML(_title);
            model.is_lock   = 1;
            model.is_red    = 0;
            model.user_name = Utils.DropHTML(_user_name);
            model.user_tel  = Utils.DropHTML(_user_tel);
            model.email     = Utils.DropHTML(_email);
            model.site_url  = Utils.DropHTML(_site_url);
            model.img_url   = Utils.DropHTML(_img_url);
            model.is_image  = 1;
            if (string.IsNullOrEmpty(model.img_url))
            {
                model.is_image = 0;
            }
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,提交成功!\"}");
                return;
            }
            context.Response.Write("{\"status\": 0, \"msg\": \"对不起,保存过程中发生错误!\"}");
            return;
        }
Exemplo n.º 5
0
        private bool DoAdd()
        {
            bool result = true;
            Model.link model = new Model.link();
            BLL.link bll = new BLL.link();

            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.Add(model) < 1)
            {
                result = false;
            }
            return result;
        }
Exemplo n.º 6
0
        private bool DoAdd()
        {
            bool result = false;
            Model.link model = new Model.link();
            BLL.link bll = new BLL.link();

            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.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加友情链接:" + model.title); //记录日志
                result = true;
            }
            return result;
        }