예제 #1
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        string navid    = "5";
        string suoluetu = jiexi_picture(txtname.Text);

        if (suoluetu == "")
        {
            SystemTool.AlertShow(this, "图片不能为空");
            return;
        }
        string detail = "album";
        string sql    = "if not exists (select * from article_info where  nav_id=" + Request.QueryString["nid"].ToString() + ")insert into article_info(nav_id,title,article_image,author,descr,detail,isshow) values(@nav_id,@title,@article_image,@author,@descr,@detail,@isshow)";

        if (Request.QueryString["nid"] != null)
        {
            sql = "update article_info set nav_id=@nav_id,title=@title,article_image=@article_image,author=@author,descr=@descr,detail=@detail,isshow=@isshow where nav_id=" + Request.QueryString["nid"].ToString();
        }
        SqlParameter[] parm = new SqlParameter[] {
            new SqlParameter("@nav_id", SqlDbType.Int)
            {
                Value = navid
            },
            new SqlParameter("@title", SqlDbType.NVarChar)
            {
                Value = ""
            },
            new SqlParameter("@article_image", SqlDbType.NVarChar)
            {
                Value = suoluetu
            },
            new SqlParameter("@author", SqlDbType.NVarChar)
            {
                Value = ""
            },
            new SqlParameter("@descr", SqlDbType.NVarChar)
            {
                Value = ""
            },
            new SqlParameter("@detail", SqlDbType.NText)
            {
                Value = detail
            },
            new SqlParameter("@isshow", SqlDbType.Int)
            {
                Value = "1"
            },
        };
        int result = DB.ExecuteSql(sql, parm);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "albumadd.aspx?nid=5");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
예제 #2
0
    protected void rptlist_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string       cmd    = e.CommandName.ToString();
        string       userid = e.CommandArgument.ToString();
        TextBox      name   = e.Item.FindControl("txt_name") as TextBox;
        DropDownList muban  = e.Item.FindControl("ddl_muban") as DropDownList;
        TextBox      paixu  = e.Item.FindControl("txt_paixu") as TextBox;
        DropDownList show   = e.Item.FindControl("ddl_show") as DropDownList;
        DropDownList nav0   = e.Item.FindControl("ddl_nav0") as DropDownList;

        if (cmd == "lbtshan")
        {
            string sql    = "delete from nav_info where id=" + userid;
            int    result = DB.ExecuteSql(sql, null);
            if (result > 0)
            {
                SystemTool.AlertShow(this, "删除成功");
                BindInfo();
            }
        }
        if (cmd == "lbtn_edit")
        {
            if (name.Text == "")
            {
                SystemTool.AlertShow(this, "导航栏名称不能为空");
            }
            if (paixu.Text == "")
            {
                SystemTool.AlertShow(this, "排序不能为空");
                return;
            }
            if (!SystemTool.IsInt(paixu.Text))
            {
                paixu.Text = "0";
            }
            string sql = "select id from nav_info where nav_name='" + name.Text + "'";
            string r   = DB.ExecuteSqlValue(sql, null);
            if (r != "" && r != "no")
            {
                if (r != userid)
                {
                    SystemTool.AlertShow(this, "导航栏名称已存在");
                    return;
                }
            }
            sql = "update nav_info set nav_name='" + name.Text + "',muban_id='" + muban.SelectedValue + "',paixu='" + paixu.Text + "',isshow='" + show.SelectedValue + "',parent_id='" + nav0.SelectedValue + "' where id=" + userid;
            int result = DB.ExecuteSql(sql, null);
            if (result > 0)
            {
                SystemTool.AlertShow_Refresh(this, "保存成功", "nvalist.aspx");
            }
            else
            {
                SystemTool.AlertShow(this, "保存失败");
            }
        }
    }
예제 #3
0
    protected void rptlist_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string  cmd    = e.CommandName.ToString();
        string  userid = e.CommandArgument.ToString();
        TextBox name   = e.Item.FindControl("txt_name") as TextBox;
        TextBox url    = e.Item.FindControl("txt_url") as TextBox;

        if (cmd == "lbtshan")
        {
            string sql    = "delete from muban_info where id=" + userid;
            int    result = DB.ExecuteSql(sql, null);
            if (result > 0)
            {
                SystemTool.AlertShow(this, "删除成功");
                BindInfo();
            }
        }
        if (cmd == "lbtn_edit")
        {
            if (name.Text == "")
            {
                SystemTool.AlertShow(this, "模板名称不能为空");
            }
            if (url.Text == "")
            {
                SystemTool.AlertShow(this, "模板地址不能为空");
            }
            string sql = "select id from muban_info where muban_name='" + name.Text + "'";
            string r   = DB.ExecuteSqlValue(sql, null);
            if (r != "" && r != "no")
            {
                if (r != userid)
                {
                    SystemTool.AlertShow(this, "模板名称已存在");
                    return;
                }
            }
            sql = "update muban_info set muban_name='" + name.Text + "',muban_url='" + url.Text + "' where id=" + userid;
            int result = DB.ExecuteSql(sql, null);
            if (result > 0)
            {
                SystemTool.AlertShow_Refresh(this, "保存成功", "mubanlist.aspx");
                BindInfo();
            }
            else
            {
                SystemTool.AlertShow(this, "添加失败");
            }
        }
    }
예제 #4
0
    protected void add_modules(object sender, EventArgs e)
    {
        string pid      = ddl_nav.SelectedValue;
        string muban_id = ddl_muban.SelectedValue;
        //if (muban_id == "0") {
        //    SystemTool.AlertShow(this, "请选择模板");
        //    return;
        //}
        string name = daohanglanmingcheng.Value;

        if (name == "")
        {
            SystemTool.AlertShow(this, "导航栏名称不能为空");
            return;
        }
        string px = xuhao.Value;

        if (px == "")
        {
            SystemTool.AlertShow(this, "序号不能为空");
            return;
        }
        if (!SystemTool.IsInt(px))
        {
            px = "0";
        }
        string isshow = ddl_show.SelectedValue;
        string sql    = "select id from nav_info where nav_name='" + name + "'";
        string r      = DB.ExecuteSqlValue(sql, null);

        if (r != "" && r != "no")
        {
            SystemTool.AlertShow(this, "导航栏名称已存在");
            return;
        }
        sql = "insert into nav_info(nav_name,muban_id,parent_id,paixu,isshow) values('" + name + "','" + muban_id + "','" + pid + "','" + px + "','" + isshow + "')";
        int result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "nvalist.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "添加失败");
        }
    }
예제 #5
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        string title       = txttitle.Text;
        string keywords    = txtkeywords.Text;
        string description = txtdescription.Text;
        string beian       = txtbeian.Value;
        string sql         = "update sys_info set title=@title,keywords=@keywords,description=@description,beian=@beian ";

        SqlParameter[] parm = new SqlParameter[] {
            new SqlParameter("@title", SqlDbType.NVarChar)
            {
                Value = title
            },
            new SqlParameter("@keywords", SqlDbType.NVarChar)
            {
                Value = keywords
            },
            new SqlParameter("@description", SqlDbType.NVarChar)
            {
                Value = description
            },
            new SqlParameter("@beian", SqlDbType.NVarChar)
            {
                Value = beian
            },
        };
        int result = DB.ExecuteSql(sql, parm);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "xitongshezhi.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
예제 #6
0
    protected void add_modules(object sender, EventArgs e)
    {
        string name = mubanmingcheng.Value;

        if (name == "")
        {
            SystemTool.AlertShow(this, "模板名称不能为空");
            return;
        }
        string url = mubandizhi.Value;

        if (url == "")
        {
            SystemTool.AlertShow(this, "模块地址不能为空");
            return;
        }
        string sql = "select id from muban_info where muban_name='" + name + "'";
        string r   = DB.ExecuteSqlValue(sql, null);

        if (r != "" && r != "no")
        {
            SystemTool.AlertShow(this, "模板名称已存在");
            return;
        }
        sql = "insert into muban_info (muban_name,muban_url) values('" + name + "','" + url + "')";
        int result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "mubanlist.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "添加失败");
        }
    }
예제 #7
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        string navid = "0";

        if (ddl_nav.Items.Count > 1)
        {
            if (ddl_nav.SelectedValue == "0")
            {
                SystemTool.AlertShow(this, "请选择二级导航");
                return;
            }
            navid = ddl_nav.SelectedValue;
        }
        else
        {
            if (ddl_nav0.SelectedValue == "0")
            {
                SystemTool.AlertShow(this, "请选择一级导航");
                return;
            }
            navid = ddl_nav0.SelectedValue;
        }
        string title = txttitle.Text;

        if (title == "")
        {
            SystemTool.AlertShow(this, "标题不能为空");
            return;
        }
        string author = txtauthor.Text;

        if (author == "")
        {
            SystemTool.AlertShow(this, "作者不能为空");
            return;
        }
        string descr = txtdescr.Text;

        if (descr == "")
        {
            SystemTool.AlertShow(this, "简介不能为空");
            return;
        }
        string suoluetu = jiexi_picture(txtname.Text);

        if (suoluetu == "")
        {
            SystemTool.AlertShow(this, "图片不能为空");
            return;
        }
        string detail = "album";
        string isshow = ddl_show.SelectedValue;
        string sql    = "insert into article_info(nav_id,title,article_image,author,descr,detail,isshow) values(@nav_id,@title,@article_image,@author,@descr,@detail,@isshow)";

        if (Request.QueryString["id"] != null)
        {
            sql = "update article_info set nav_id=@nav_id,title=@title,article_image=@article_image,author=@author,descr=@descr,detail=@detail,isshow=@isshow where id=" + Request.QueryString["id"].ToString();
        }
        SqlParameter[] parm = new SqlParameter[] {
            new SqlParameter("@nav_id", SqlDbType.Int)
            {
                Value = navid
            },
            new SqlParameter("@title", SqlDbType.NVarChar)
            {
                Value = title
            },
            new SqlParameter("@article_image", SqlDbType.NVarChar)
            {
                Value = suoluetu
            },
            new SqlParameter("@author", SqlDbType.NVarChar)
            {
                Value = author
            },
            new SqlParameter("@descr", SqlDbType.NVarChar)
            {
                Value = descr
            },
            new SqlParameter("@detail", SqlDbType.NText)
            {
                Value = detail
            },
            new SqlParameter("@isshow", SqlDbType.Int)
            {
                Value = isshow
            },
        };
        int result = DB.ExecuteSql(sql, parm);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "albumlist.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
예제 #8
0
    protected void add_modules(object sender, EventArgs e)
    {
        string bjmkname = qitatiaojian.Value;

        if (bjmkname == "")
        {
            SystemTool.AlertShow(this, "模块名称不能为空");
            return;
        }
        string px = paixu.Value;

        if (px == "")
        {
            SystemTool.AlertShow(this, "模块序号不能为空");
            return;
        }
        if (!Regex.IsMatch(px, @"^[+-]?\d*$"))
        {
            SystemTool.AlertShow(this, "模块序号必须为整数");
            return;
        }
        string tb     = tubiao.Value;
        string mkdz   = mokuaidizhi.Value;
        string sql    = "";
        int    result = 0;
        string pid    = ddlmoduleName.SelectedValue == "--" ? "0" : ddlmoduleName.SelectedValue;

        if (hidid.Value != "")
        {
            sql = "select id from module_info where moduleName='" + bjmkname + "' and id<>" + hidid.Value;
            string r = DB.ExecuteSqlValue(sql, null);
            if (r != "" && r != "no")
            {
                SystemTool.AlertShow(this, "模块名称已存在");
                return;
            }
            //更新操作

            sql         = "update module_info set paixu=" + px + " ,moduleName='" + bjmkname + "',parentId=" + pid + ",modelHref='" + mkdz + "',tubiao='" + tb + "' where id=" + hidid.Value;
            result      = DB.ExecuteSql(sql, null);
            hidid.Value = "";
        }
        else
        {
            sql = "select id from module_info where moduleName='" + bjmkname + "'";
            string r = DB.ExecuteSqlValue(sql, null);
            if (r != "" && r != "no")
            {
                SystemTool.AlertShow(this, "模块名称已存在");
                return;
            }
            sql         = "insert into module_info (moduleName,parentId,modelHref,paixu,tubiao) values('" + bjmkname + "'," + pid + ",'" + mkdz + "'," + px + ",'" + tb + "')";
            result      = DB.ExecuteSql(sql, null);
            hidid.Value = "";
        }

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "mokuaiguanlilist.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
예제 #9
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        string navid = "8";
        string title = txttitle.Text;

        if (title == "")
        {
            SystemTool.AlertShow(this, "标题不能为空");
            return;
        }
        string author = txtauthor.Text;

        if (author == "")
        {
            SystemTool.AlertShow(this, "作者不能为空");
            return;
        }
        string suoluetu = jiexi_picture(txtname.Text);

        if (suoluetu == "")
        {
            SystemTool.AlertShow(this, "缩略图不能为空");
            return;
        }
        string descr = txtdescr.Text;

        if (descr == "")
        {
            SystemTool.AlertShow(this, "简介不能为空");
            return;
        }
        string tuijian = ddl_tuijian.SelectedValue;
        string detail  = txtbeizhu.Value;

        if (detail == "")
        {
            SystemTool.AlertShow(this, "内容不能为空");
            return;
        }
        string isshow  = ddl_show.SelectedValue;
        string mubanid = "0";
        string sql     = "insert into article_info(nav_id,title,article_image,author,descr,detail,isshow,istuijian,muban_id) values(@nav_id,@title,@article_image,@author,@descr,@detail,@isshow,@istuijian,@muban_id)";

        if (Request.QueryString["id"] != null)
        {
            sql = "update article_info set nav_id=@nav_id,title=@title,article_image=@article_image,author=@author,descr=@descr,detail=@detail,isshow=@isshow,istuijian=@istuijian,muban_id=@muban_id where id=" + Request.QueryString["id"].ToString();
        }
        SqlParameter[] parm = new SqlParameter[] {
            new SqlParameter("@nav_id", SqlDbType.Int)
            {
                Value = navid
            },
            new SqlParameter("@title", SqlDbType.NVarChar)
            {
                Value = title
            },
            new SqlParameter("@article_image", SqlDbType.NVarChar)
            {
                Value = suoluetu
            },
            new SqlParameter("@author", SqlDbType.NVarChar)
            {
                Value = author
            },
            new SqlParameter("@descr", SqlDbType.NVarChar)
            {
                Value = descr
            },
            new SqlParameter("@detail", SqlDbType.NText)
            {
                Value = detail
            },
            new SqlParameter("@isshow", SqlDbType.Int)
            {
                Value = isshow
            },
            new SqlParameter("@istuijian", SqlDbType.Int)
            {
                Value = tuijian
            },
            new SqlParameter("@muban_id", SqlDbType.Int)
            {
                Value = mubanid
            },
        };
        int result = DB.ExecuteSql(sql, parm);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "xuexibiji_list.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
예제 #10
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        string navid    = "6";
        string title    = "";
        string author   = "";
        string suoluetu = "";
        string descr    = "";
        string tuijian  = "1";
        string detail   = txtbeizhu.Value;

        if (detail == "")
        {
            SystemTool.AlertShow(this, "内容不能为空");
            return;
        }
        string isshow  = "1";
        string mubanid = "0";
        string sql     = "if not exists (select * from article_info where  nav_id=" + Request.QueryString["nid"].ToString() + ") insert into article_info(nav_id,title,article_image,author,descr,detail,isshow,istuijian,muban_id) values(@nav_id,@title,@article_image,@author,@descr,@detail,@isshow,@istuijian,@muban_id)";

        if (Request.QueryString["id"] != null)
        {
            sql = "update article_info set nav_id=@nav_id,title=@title,article_image=@article_image,author=@author,descr=@descr,detail=@detail,isshow=@isshow,istuijian=@istuijian,muban_id=@muban_id where nav_id=" + Request.QueryString["nid"].ToString();
        }
        SqlParameter[] parm = new SqlParameter[] {
            new SqlParameter("@nav_id", SqlDbType.Int)
            {
                Value = navid
            },
            new SqlParameter("@title", SqlDbType.NVarChar)
            {
                Value = title
            },
            new SqlParameter("@article_image", SqlDbType.NVarChar)
            {
                Value = suoluetu
            },
            new SqlParameter("@author", SqlDbType.NVarChar)
            {
                Value = author
            },
            new SqlParameter("@descr", SqlDbType.NVarChar)
            {
                Value = descr
            },
            new SqlParameter("@detail", SqlDbType.NText)
            {
                Value = detail
            },
            new SqlParameter("@isshow", SqlDbType.Int)
            {
                Value = isshow
            },
            new SqlParameter("@istuijian", SqlDbType.Int)
            {
                Value = tuijian
            },
            new SqlParameter("@muban_id", SqlDbType.Int)
            {
                Value = mubanid
            },
        };
        int result = DB.ExecuteSql(sql, parm);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh(this, "保存成功", "gerenjianjie.aspx?nid=6");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }