예제 #1
0
    protected void init()
    {
        string  sql = "select * from role_info where state='启用' order by paixu";
        DataSet ds  = DB.ExecuteSqlDataSet(sql, null);

        SystemTool.bindDropDownList_0(ddljiaose, ds.Tables[0], "id", "roleName", "--请选择--");
    }
예제 #2
0
    protected void lbtDelAll_OnClick(object sender, EventArgs e)
    {
        string ids = "";

        for (int i = 0; i < rptlist.Items.Count; i++)
        {
            CheckBox ckb = rptlist.Items[i].FindControl("ckb") as CheckBox;
            if (ckb.Checked == true)
            {
                ids += ckb.ToolTip + ",";
            }
        }
        if (ids.Length > 0)
        {
            ids = ids.Substring(0, ids.Length - 1);
        }
        else
        {
            SystemTool.AlertShow(this, "请选择需要删除的用户");
            return;
        }
        string sql    = "delete from manager_info where man_id in(" + ids + ")";
        int    result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            BindInfo();
            SystemTool.AlertShow(this, "删除成功");
        }
        else
        {
            SystemTool.AlertShow(this, "删除失败");
        }
    }
예제 #3
0
    protected void lbtn_delete_Click(object sender, EventArgs e)
    {
        string ids = "";

        for (int i = 0; i < rpt_taizhang.Items.Count; i++)
        {
            CheckBox ckb = rpt_taizhang.Items[i].FindControl("ckb") as CheckBox;
            if (ckb.Checked == true)
            {
                ids += "'" + ckb.ToolTip + "',";
            }
        }
        if (ids.Length > 0)
        {
            ids = ids.Substring(0, ids.Length - 1);
        }
        else
        {
            SystemTool.AlertShow(this, "请选择需要操作的数据");
            return;
        }
        string sql    = "update taizhang_info set isdelete=1 where dingdanbianhao in(" + ids + ")";
        int    result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            BindInfo();
            SystemTool.AlertShow(this, "操作成功");
        }
        else
        {
            SystemTool.AlertShow(this, "操作失败");
        }
    }
예제 #4
0
    protected void lbtn_export_Click(object sender, EventArgs e)
    {
        string url = panel1.BackImageUrl;

        if (url == "")
        {
            SystemTool.AlertShow(this, "图片为空,请先查询");
            return;
        }
        string ReportFileName = Server.MapPath("~/" + url);

        System.IO.FileInfo filet = new System.IO.FileInfo(ReportFileName);
        Response.Clear();
        Response.Charset         = "GB2312";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        // 添加头信息,为"文件下载/另存为"对话框指定默认文件名
        Response.AddHeader("Content-Disposition", "attachment; filename=顶板离层数据分析.jpg");
        // 添加头信息,指定文件大小,让浏览器能够显示下载进度
        Response.AddHeader("Content-Length", filet.Length.ToString());
        // 指定返回的是一个不能被客户端读取的流,必须被下载
        Response.ContentType = "application/ms-excel";
        // 把文件流发送到客户端
        Response.WriteFile(filet.FullName);
        // 停止页面的执行
        Response.End();
    }
예제 #5
0
    protected string getLocation()
    {
        string id = "0";

        if (null != Request.QueryString["id"] && SystemTool.IsInt(Request.QueryString["id"].ToString()))
        {
            id = DB.ExecuteSqlValue("select nav_id from article_info where id=" + Request.QueryString["id"].ToString() + " and isshow=1", null);
            if (id == "" || id == "no")
            {
                id = "-1";
            }
        }
        string  sql = @"select isnull(n0.nav_name,'') nav_name0,n.nav_name from nav_info n
left join nav_info n0 on n0.id=n.parent_id
 where n.id=" + id;
        DataSet ds  = DB.ExecuteSqlDataSet(sql, null);

        if (ds.Tables[0].Rows.Count > 0)
        {
            return("<a href='index.aspx' target='_blank'>网站首页</a>>><a href='#' target='_blank'>" + ds.Tables[0].Rows[0]["nav_name0"].ToString() + "</a></span><b>" + ds.Tables[0].Rows[0]["nav_name"].ToString() + "</b>");
        }
        else
        {
            return("");
        }
    }
    protected void lbtn_cequ_Click(object sender, EventArgs e)
    {
        string aname = txtcequ.Value;

        if (aname == "")
        {
            SystemTool.AlertShow(this, "测区名称不能为空");
            return;
        }
        string  sqlck = "select * from areainfo where areaname='" + aname + "'";
        DataSet dsck  = DB.ExecuteSqlDataSet(sqlck, null);

        if (dsck.Tables[0].Rows.Count > 0)
        {
            SystemTool.AlertShow(this, "测区名称已存在");
            return;
        }
        string sql    = "insert into areainfo (areaname) values('" + aname + "')";
        int    result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            SystemTool.JavascriptShow(this, "changclass1()");
            sql = "select * from AreaInfo";
            DataSet ds = DB.ExecuteSqlDataSet(sql, null);
            rpt_cequ.DataSource = ds.Tables[0];
            rpt_cequ.DataBind();
            txtcequ.Value = "";
            BindData();
        }
        else
        {
            SystemTool.AlertShow(this, "操作失败");
        }
    }
    protected void rptlist_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string cmd    = e.CommandName.ToString();
        string userid = e.CommandArgument.ToString();
        string sql    = "";

        if (cmd == "lbtshan")
        {
            sql = "delete from manager_info where man_id=" + userid;
        }
        if (cmd == "lbtn_open")
        {
            sql = "update manager_info set state='启用' where man_id=" + userid;
        }
        if (cmd == "lbtn_close")
        {
            sql = "update manager_info set state='禁止' where man_id=" + userid;
        }
        int result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            SystemTool.AlertShow(this, "保存成功");
            BindInfo();
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
        }
    }
    protected void lbtn_add_Click(object sender, EventArgs e)
    {
        string ids = "";

        for (int i = 0; i < rpt_shiyongdanwei.Items.Count; i++)
        {
            CheckBox ckb = rpt_shiyongdanwei.Items[i].FindControl("ckb") as CheckBox;
            if (ckb.Checked == true)
            {
                ids += ckb.ToolTip + ",";
            }
        }
        if (ids.Length > 0)
        {
            ids = ids.Substring(0, ids.Length - 1);
        }
        else
        {
            SystemTool.AlertShow(this, "请选择需要操作的数据");
            return;
        }
        string sql    = "update shiyongdanwei set isxianzhi=1 where shiyongdanwei_id in(" + ids + ")";
        int    result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            BindInfo();
            SystemTool.AlertShow(this, "操作成功");
        }
        else
        {
            SystemTool.AlertShow(this, "操作失败");
        }
    }
    protected void lbtn_dels_Click(object sender, EventArgs e)
    {
        string ids = "";

        for (int i = 0; i < rpt_shiyongdanwei.Items.Count; i++)
        {
            CheckBox ckb = rpt_shiyongdanwei.Items[i].FindControl("ckb") as CheckBox;
            if (ckb.Checked == true)
            {
                ids += ckb.ToolTip + ",";
            }
        }
        if (ids.Length > 0)
        {
            ids = ids.Substring(0, ids.Length - 1);
        }
        else
        {
            SystemTool.AlertShow(this, "请选择需要删除的数据");
            return;
        }
        string sql    = "delete from gonghuochangshang where gonghuochangshang_id in(" + ids + ")";
        int    result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            BindInfo();
            SystemTool.AlertShow(this, "删除成功");
        }
        else
        {
            SystemTool.AlertShow(this, "删除失败");
        }
    }
예제 #10
0
        public static void Generate()
        {
            Logger.LogAllLine("Generate update server================>");

            //copy all res to server!
            SystemTool.ClearDirectory(PathManager.UpdateServerPath);
            SystemTool.CopyDirectory(PathManager.OutputPath, PathManager.UpdateServerPath);

            Logger.LogAllLine("Copy all res to UpdateServer!");

            var server = new UpdateServer
            {
                Status      = PublishTarget.Current.UpdateServerStatus,
                MinVersion  = PublishTarget.Current.UpdateServerMinClientVersion.ToProtoVersion(),
                CurVersion  = PublishTarget.Current.ClientVersion.ToProtoVersion(),
                Description = PublishTarget.Current.UpdateServerDescription
            };

            //save
            using (var file = File.Open(PathManager.UpdateServerConfigPath.FullName, FileMode.Create, FileAccess.ReadWrite))
            {
                Serializer.Serialize(file, server);
            }

            //FileSystemGenerator.FileListGenerator.CodeFile(PathManager.UpdateServerConfigPath);
            Logger.LogAllLine("Generate:\t{0}", PathManager.UpdateServerConfigPath.FullName);
        }
    protected void lbtn_excel_Click(object sender, EventArgs e)
    {
        string url = panel1.BackImageUrl;

        if (url == "")
        {
            SystemTool.AlertShow(this, "图片为空,请先刷新");
            return;
        }
        DataTable dt = (DataTable)ViewState["excel"];
        //模板文件
        string TempletFileName = Server.MapPath("~/template/blank.xlsx");//路径
        //导出文件
        string dts            = DateTime.Now.ToString("yyyyMMddHHmmss");
        string ReportFileName = Server.MapPath("~/xiazai/ChuChengLiMoZuLi" + dts + ".xlsx");

        TableToExcel(dt, TempletFileName, ReportFileName);

        System.IO.FileInfo filet = new System.IO.FileInfo(ReportFileName);
        Response.Clear();
        Response.Charset         = "GB2312";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        // 添加头信息,为"文件下载/另存为"对话框指定默认文件名
        Response.AddHeader("Content-Disposition", "attachment; filename=初掌力与末阻力.xlsx");
        // 添加头信息,指定文件大小,让浏览器能够显示下载进度
        Response.AddHeader("Content-Length", filet.Length.ToString());
        // 指定返回的是一个不能被客户端读取的流,必须被下载
        Response.ContentType = "application/ms-excel";
        // 把文件流发送到客户端
        Response.WriteFile(filet.FullName);
        // 停止页面的执行
        Response.End();
    }
예제 #12
0
    protected void search_Click(object sender, EventArgs e)
    {
        ViewState["search"] = " 1=1";
        string qita = SystemTool.NoHtml(qitatiaojian.Value.ToString().Trim());
        string id   = ddlmoduleName.SelectedValue;
        string mkdz = mokuaidizhi.Value;
        string px   = paixu.Value;
        string tb   = tubiao.Value;

        if (qita != "")
        {
            ViewState["search"] += " and m.moduleName like '%" + qita + "%'";
        }
        if (id != "--")
        {
            ViewState["search"] += " and m.parentId=" + id;
        }
        if (mkdz != "")
        {
            ViewState["search"] += " and m.modelHref like '%" + mkdz + "%'";
        }
        if (px != "")
        {
            ViewState["search"] += " and m.paixu =" + px;
        }
        if (tb != "")
        {
            ViewState["search"] += " and m.tubiao like '%" + tb + "%'";
        }
        BindInfo();
    }
예제 #13
0
    protected void init()
    {
        string    sql = "select id,moduleName from dbo.module_info where parentId=0";
        DataTable dt  = DB.ExecuteSqlDataSet(sql, null).Tables[0];

        SystemTool.bindDropDownList(ddlmoduleName, dt, "id", "moduleName", "--请选择--");
    }
예제 #14
0
    protected void lbtn_save_Click(object sender, EventArgs e)
    {
        string wdh = weidaohuo.Text.Trim();

        if (wdh == "")
        {
            wdh = "0";
        }
        string cq = chaoqi.Text.Trim();

        if (cq == "")
        {
            cq = "0";
        }

        string sql    = "update tiaojian_info set chaoqi=" + cq + ",weidaohuo=" + wdh + "";
        int    result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh1(this, "保存成功", "tiaojian_info.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
예제 #15
0
        public void Analyze()
        {
            Logger.LogAllLine("Analyze Scripts================>");
            MissionScripts.Clear();
            HeroScripts.Clear();
            MonsterScripts.Clear();
            SkillScripts.Clear();
            BufferScripts.Clear();


            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputMissionScriptPath);
                foreach (var scriptFile in files)
                {
                    MissionScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputHeroScriptPath);
                foreach (var scriptFile in files)
                {
                    HeroScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputMonsterScriptPath);
                foreach (var scriptFile in files)
                {
                    MonsterScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputSkillScriptPath);
                foreach (var scriptFile in files)
                {
                    SkillScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputBufferScriptPath);
                foreach (var scriptFile in files)
                {
                    BufferScripts.Add(scriptFile.Name, false);
                }
            }

            //copy all scripts
            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputScriptPath);
                foreach (var scriptFile in files)
                {
                    var resourceFile = new FileListFile(scriptFile, true, true);
                    FileSystemGenerator.CopyFileToOutput(resourceFile);
                }
            }
        }
예제 #16
0
    protected string getPage()
    {
        double total     = 0;
        double totalPage = 1;
        double pPage     = 6;
        double cPage     = 1;

        if (null != Request.QueryString["cpage"] && SystemTool.IsInt(Request.QueryString["cpage"].ToString()))
        {
            cPage = Convert.ToDouble(Request.QueryString["cpage"].ToString());
        }
        double prev = cPage - 1 <= 0 ? 1 : cPage - 1;
        string id   = "0";

        if (null != Request.QueryString["id"] && SystemTool.IsInt(Request.QueryString["id"].ToString()))
        {
            id = Request.QueryString["id"].ToString();
        }
        string sql    = "select count(id) from article_info where nav_id=" + id;
        string result = DB.ExecuteSqlValue(sql, null);

        if (result != "" && result != "no")
        {
            total     = Convert.ToInt32(result);
            totalPage = Math.Ceiling(total / pPage);
        }
        double next = (cPage + 1) >= totalPage ? totalPage : cPage + 1;

        return("页次:" + cPage + "/" + totalPage + " 每页" + pPage + " 总数" + total + "<a href='articlelist.aspx?id=" + id + "'>首页</a><a href='articlelist.aspx?id=" + id + "&cpage=" + prev + "'>上一页</a><a href='articlelist.aspx?id=" + id + "&cpage=" + next + "'>下一页</a><a href='articlelist.aspx?id=" + id + "&cpage=" + totalPage + "'>尾页</a>");
    }
예제 #17
0
    protected void lbtn_search_Click(object sender, EventArgs e)
    {
        string dt1 = datemin.Value;
        string dt2 = datemax.Value;

        if (dt1 == "")
        {
            SystemTool.AlertShow(this, "开始时间不能为空");
            return;
        }
        if (dt2 == "")
        {
            SystemTool.AlertShow(this, "结束时间不能为空");
            return;
        }
        ViewState["search"] = " dingdanriqi>='" + dt1 + "' and dingdanriqi<='" + dt2 + "'";
        BindInfo();
        //表头
        string sql    = "select count(taizhang_id) from taizhang_info where jihualeixing='应急采购' and " + ViewState["search"];
        string result = DB.ExecuteSqlValue(sql, null);

        if (result == "" || result == "no")
        {
            result = "0";
        }
        sql = "select count(taizhang_id) from taizhang_info where " + ViewState["search"];
        string resulta = DB.ExecuteSqlValue(sql, null);

        if (resulta == "" || resulta == "no")
        {
            resulta = "0";
        }
        divheader.InnerHtml = dt1 + "--" + dt2 + "(单位:元) 共实施各类采购" + resulta + "次,其中应急采购" + result + "次";
    }
예제 #18
0
    private void BindInfo()
    {
        if (!SystemTool.IsInt(Request.QueryString["nid"].ToString()))
        {
            Response.Redirect("404.html");
        }
        string  sql = "select * from article_info where nav_id=" + Request.QueryString["nid"];
        DataSet ds  = DB.ExecuteSqlDataSet(sql, null);

        if (ds.Tables[0].Rows.Count > 0)
        {
            string   article_image = ds.Tables[0].Rows[0]["article_image"].ToString();
            string[] images        = article_image.Split('#');
            string   html          = "";
            for (int i = 0; i < images.Length - 1; i++)
            {
                string bianhao = "b" + i;
                string _width  = "100";
                string _height = "100";
                var    aaa     = "<div id='div" + bianhao + "'  class='imgbox hasboth'  style='background-color:#fff;width:" + _width + "px;height:" + _height + "px;'>";
                var    aa      = " <div class='w_upload' style='width:" + _width + "px;height:" + _height + "px;' >    <a class='item_close' onclick=deletepic('" + bianhao + "')>删除</a><span style='width:" + _width + "px;height:" + _height + "px;' class='item_box'>";
                var    bb      = "<img id='img" + bianhao + "' src='/" + images[i] + "'  style='background:url(images/aa1.gif) no-repeat center;width:" + _width + "px;height:" + _height + "px;'/></span>";
                var    dds     = "</div></div>";
                html += aaa + aa + bb + dds;
            }
            txtname.Text  = article_image;
            box.InnerHtml = html;
        }
    }
예제 #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (null != Request.Cookies[Cookie.ComplanyId] && Request.Cookies[Cookie.ComplanyId] != null)
         {
             string dt1 = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
             string dt2 = DateTime.Now.ToString("yyyy-MM-dd");
             datemin.Value       = dt1;
             datemax.Value       = dt2;
             ViewState["search"] = " dingdanriqi>='" + dt1 + "' and dingdanriqi<='" + dt2 + "'";
             BindInfo();
             //表头
             string sql    = "select count(taizhang_id) from taizhang_info where jihualeixing='应急采购' and " + ViewState["search"];
             string result = DB.ExecuteSqlValue(sql, null);
             if (result == "" || result == "no")
             {
                 result = "0";
             }
             sql = "select count(taizhang_id) from taizhang_info where " + ViewState["search"];
             string resulta = DB.ExecuteSqlValue(sql, null);
             if (resulta == "" || resulta == "no")
             {
                 resulta = "0";
             }
             divheader.InnerHtml = dt1 + "--" + dt2 + "(单位:元) 共实施各类采购" + resulta + "次,其中应急采购" + result + "次";
         }
         else
         {
             SystemTool.AlertShow_Refresh2(this, "Login.aspx");
         }
     }
 }
예제 #20
0
    protected string getLocation()
    {
        string id = "0";

        if (null != Request.QueryString["id"] && SystemTool.IsInt(Request.QueryString["id"].ToString()))
        {
            id = DB.ExecuteSqlValue("select nav_id from article_info where id=" + Request.QueryString["id"].ToString() + " and isshow=1", null);
            if (id == "" || id == "no")
            {
                id = "-1";
            }
        }
        if (id == "7")
        {
            return("<a href='index.aspx' target='_blank'>网站首页</a>>><a href='#' target='_blank'>我的日记</a></span><b>个人日记</b>");
        }
        if (id == "8")
        {
            return("<a href='index.aspx' target='_blank'>网站首页</a>>><a href='#' target='_blank'>我的日记</a></span><b>学习笔记</b>");
        }
        if (id == "11")
        {
            return("<a href='index.aspx' target='_blank'>网站首页</a>>><a href='#' target='_blank'>技术文章</a></span><b></b>");
        }
        return("");
    }
예제 #21
0
 protected void btnsubmit_Click(object sender, EventArgs e)
 {
     if (txtpass1.Text == "" && txtpass2.Text == "")
     {
         SystemTool.AlertShow(this, "密码不能为空!");
         return;
     }
     if (txtpass1.Text != "" || txtpass2.Text != "")
     {
         if (txtpass1.Text.Trim() != txtpass2.Text.Trim())
         {
             SystemTool.AlertShow(this, "两次密码不一致!");
             return;
         }
     }
     if (txtpass1.Text != "")
     {
         string sql = "update manager_info set man_psw='" + SystemTool.jimi(txtpass1.Text) + "'  where man_id=" + ViewState["userid"];
         int    i   = DB.ExecuteSql(sql, null);
         if (i > 0)
         {
             SystemTool.AlertShow(this, "操作成功!");
         }
         else
         {
             SystemTool.AlertShow(this, "操作失败!");
         }
     }
 }
예제 #22
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;
        }
    }
예제 #23
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, "保存失败");
            }
        }
    }
예제 #24
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        if (txtname.Text == "")
        {
            SystemTool.AlertShow(this, "管理员名称不能为空");
            return;
        }
        if (txtpassok.Text != txtpassok2.Text)
        {
            SystemTool.AlertShow(this, "两次输入密码不一致");
            return;
        }
        string sql    = "";
        int    result = 0;

        if (null != Request.QueryString["manId"])
        {
            //更新操作
            if (txtpassok.Text == "")
            {//密码不更新
                sql = "UPDATE manager_info set roleId='" + ddljiaose.SelectedValue + "',remark='" + SystemTool.NoHtml(txtbeizhu.Value) + "',state='" + ddlState.SelectedValue + "' where man_id=" + SystemTool.NoHtml(Request.QueryString["manId"]);
            }
            else
            {
                sql = "UPDATE manager_info set man_psw='" + SystemTool.jimi(SystemTool.NoHtml(txtpassok.Text)) + "',roleId='" + ddljiaose.SelectedValue + "',remark='" + SystemTool.NoHtml(txtbeizhu.Value) + "',state='" + ddlState.SelectedValue + "' where man_id=" + SystemTool.NoHtml(Request.QueryString["manId"]);
            }

            result = DB.ExecuteSql(sql, null);
        }
        else
        {
            sql = "select man_id from manager_info where man_name='" + SystemTool.NoHtml(txtname.Text) + "'";
            string r = DB.ExecuteSqlValue(sql, null);
            if (r != "" && r != "no")
            {
                SystemTool.AlertShow(this, "管理员名称已存在");
                return;
            }
            if (txtpassok.Text == "")
            {
                SystemTool.AlertShow(this, "管理员密码不能为空");
                return;
            }
            sql    = "insert into manager_info (man_name,man_psw,roleId,remark,state) values('" + SystemTool.NoHtml(txtname.Text) + "','" + SystemTool.jimi(SystemTool.NoHtml(txtpassok.Text)) + "'," + ddljiaose.SelectedValue + ",'" + SystemTool.NoHtml(txtbeizhu.Value) + "','" + ddlState.SelectedValue + "')";
            result = DB.ExecuteSql(sql, null);
        }

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh1(this, "保存成功", "guanliyuanlist.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
예제 #25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (null != Request.Cookies[Cookie.ComplanyId] && Request.Cookies[Cookie.ComplanyId] != null)
     {
         HttpCookie userid = Request.Cookies[Cookie.ComplanyId];
         ViewState["userid"] = userid.Value;
     }
     else
     {
         SystemTool.AlertShow_Refresh2(this, "Login.aspx");
     }
 }
예제 #26
0
        public void Analyze()
        {
            Logger.LogAllLine("Analyze Other================>");

            var files = SystemTool.GetDirectoryFiles(PathManager.InputOtherPath);

            foreach (var animationFile in files)
            {
                var resourceFile = new FileListFile(animationFile);
                FileSystemGenerator.CopyFileToOutput(resourceFile);
            }
        }
예제 #27
0
    private void BindInfo()
    {
        string id  = "0";
        string nid = "0";

        if (null != Request.QueryString["id"] && SystemTool.IsInt(Request.QueryString["id"].ToString()))
        {
            id = Request.QueryString["id"].ToString();
        }
        string  sql = "select * from article_info where id=" + id + " and isshow=1 and detail !='album'";
        DataSet ds  = DB.ExecuteSqlDataSet(sql, null);

        if (ds.Tables[0].Rows.Count > 0)
        {
            p_title.InnerHtml  = ds.Tables[0].Rows[0]["title"].ToString();
            p_box.InnerHtml    = "<span>发布时间:" + ds.Tables[0].Rows[0]["addtime"].ToString() + "</span><span>作者:" + ds.Tables[0].Rows[0]["author"].ToString() + "</span><span>点击:" + ds.Tables[0].Rows[0]["visited"].ToString() + "</span>";
            p_detail.InnerHtml = ds.Tables[0].Rows[0]["detail"].ToString();
            nid = ds.Tables[0].Rows[0]["nav_id"].ToString();
        }
        else
        {
            p_title.InnerHtml  = "";
            p_box.InnerHtml    = "";
            p_detail.InnerHtml = "参数有误!";
        }
        prev.InnerHtml = "上一篇:没有了";
        sql            = "select max(id) from article_info where id<" + id + " and isshow=1 and nav_id=" + nid;
        string previd = DB.ExecuteSqlValue(sql, null);

        if (previd != "" && previd != "no")
        {
            sql = "select a.title,m.muban_url from article_info a left join muban_info m on m.id=a.muban_id where a.id=" + previd;
            DataSet result = DB.ExecuteSqlDataSet(sql, null);
            if (result.Tables[0].Rows.Count > 0)
            {
                prev.InnerHtml = "上一篇:<a href='" + result.Tables[0].Rows[0]["muban_url"].ToString() + "?id=" + previd + "'>" + result.Tables[0].Rows[0]["title"].ToString() + "</a>";
            }
        }
        next.InnerHtml = "下一篇:没有了";
        sql            = "select min(id) from article_info where id>" + id + " and isshow=1 and nav_id=" + nid;
        string nextid = DB.ExecuteSqlValue(sql, null);

        if (nextid != "" && nextid != "no")
        {
            sql = "select a.title,m.muban_url from article_info a left join muban_info m on m.id=a.muban_id where a.id=" + nextid;
            DataSet result = DB.ExecuteSqlDataSet(sql, null);
            if (result.Tables[0].Rows.Count > 0)
            {
                next.InnerHtml = "下一篇:<a href='" + result.Tables[0].Rows[0]["muban_url"].ToString() + "?id=" + nextid + "'>" + result.Tables[0].Rows[0]["title"].ToString() + "</a>";
            }
        }
    }
예제 #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("success");
        string outTradeNo = Request.Form["outTradeNo"];
        string status     = Request.Form["status"];

        SystemTool.SaveTxtInfo(status, "1.txt");
        if (status == "2")
        {
            SystemTool.SaveTxtInfo(status + "0", "1.txt");
            Response.Redirect("success.aspx");
        }
    }
예제 #29
0
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        string name = SystemTool.NoHtml(txt_name.Text);
        string pass = SystemTool.NoHtml(txt_psw.Text);

        if (name == "" || pass == "")
        {
            SystemTool.AlertShow(this, "账户和密码不能为空");
            return;
        }
        if (vCode.Value == "")
        {
            SystemTool.AlertShow(this, "验证码不能为空");
            return;
        }
        if (Session["Code"] == null)
        {
            SystemTool.AlertShow(this, "验证码已过期");
            return;
        }
        if (Session["Code"].ToString() != vCode.Value)
        {
            SystemTool.AlertShow(this, "验证码不正确");
            return;
        }
        //string sql = "select man_id from manager_info where man_name='" + name + "' and man_psw='" + SystemTool.jimi(pass) + "'";
        string  sql = "select man_id,manager_info.state mstate,role_info.state rstate from manager_info,role_info where roleId=id and man_name='" + name + "' and man_psw='" + SystemTool.jimi(pass) + "'";
        DataSet ds  = DB.ExecuteSqlDataSet(sql, null);

        if (ds.Tables[0].Rows.Count == 0)
        {
            SystemTool.AlertShow(this, "账号或密码错误");
            return;
        }
        if (ds.Tables[0].Rows[0]["mstate"].ToString() == "禁止")
        {
            SystemTool.AlertShow(this, "该用户被禁用");
            return;
        }
        if (ds.Tables[0].Rows[0]["rstate"].ToString() == "禁止")
        {
            SystemTool.AlertShow(this, "该用户所在的组被禁用");
            return;
        }
        HttpCookie cookid = new HttpCookie(Cookie.ComplanyId, ds.Tables[0].Rows[0]["man_id"].ToString());

        cookid.Expires = DateTime.Now.AddDays(1);
        Response.Cookies.Add(cookid);
        Response.Redirect("index.aspx");
    }
예제 #30
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, "添加失败");
            }
        }
    }