// Start is called before the first frame update
 void Awake()
 {
     if (Menu == null)
     {
         Menu = FindObjectOfType <LanMenu>();
     }
     Menu.Btn_Jouer.onClick.AddListener(() => {
         Menu.Rpc_StartGame();
         Invoke("SpawnAllPlayers", .1f);
     });
 }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     GridView2.ShowHeaderWhenEmpty = true;
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     if (Request.QueryString["id"] != null)
     {
         string id = Request.QueryString["id"].ToString();
         GridView1.DataSource = Class1.excuDatSet("select top 10 * from [news] order by hitCount desc");
         GridView1.DataBind();
         GridView2.DataSource = Class1.excuDatSet("select * from View_News where lanId=" + id);
         GridView2.DataBind();
     }
 }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GridView1.EmptyDataText = "无结果";
     GridView2.EmptyDataText = "无结果";
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     if (Request.QueryString["newsName"] != null)
     {
         string newsname = Request.QueryString["newsName"].ToString();
         GridView1.DataSource = Class1.excuDatSet("select top 10 * from [news] order by hitCount desc");
         GridView1.DataBind();
         GridView2.DataSource = Class1.excuDatSet("select * from View_News where newsName like '%" + newsname + "%'");
         GridView2.DataBind();
     }
 }
Example #4
0
    protected void LinkButton2_Click(object sender, EventArgs e)   //删除栏目
    {
        LinkButton  btn = (LinkButton)sender;
        GridViewRow gvr = (GridViewRow)btn.NamingContainer;
        string      id  = gvr.Cells[0].Text;

        if (LanMenu.deleteLan(id))
        {
            Response.Write("<script>alert('删除成功')</script>");
            GridView1.DataSource = Class1.excuDatSet("select * from [lanMenu] order by lanId");
            GridView1.DataBind();
        }
        else
        {
            Response.Write("<script>alert('删除失败')</script>");
        }
    }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     if (Request.QueryString["id"] != null)
     {
         string id = Request.QueryString["id"].ToString();
         news   n  = news.getNewsId(id);
         news.addClick(id);
         Label1.Text = n.newsName;
         Label2.Text = "发布时间:" + n.time.ToString();
         Label3.Text = "点击量:" + n.hitCount.ToString();
         Label4.Text = n.contents;
     }
 }
Example #6
0
    public static LanMenu getLanId(string id)
    {
        LanMenu       show      = new LanMenu();
        string        sqlString = "select * from lanMenu where lanId=" + id;
        SqlConnection con       = Class1.create();

        con.Open();
        SqlCommand    cmd = new SqlCommand(sqlString, con);
        SqlDataReader sdr = cmd.ExecuteReader();

        while (sdr.Read())
        {
            show.lanId   = Convert.ToInt32(sdr[0]);
            show.lanName = Convert.ToString(sdr[1]);
        }
        con.Close();
        return(show);
    }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     GridView1.DataSource = Class1.excuDatSet("select * from View_News order by time");
     GridView1.DataBind();
     news.getImgs(ref pics, ref texts, ref links);
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     string[] arry  = lanname.Split(',');
     string[] sarry = lanid.Split(',');
     Label1.Text          = arry[0];
     Label2.Text          = arry[1];
     Label3.Text          = arry[2];
     GridView2.DataSource = Class1.excuDatSet("select * from [news] where lanId=" + sarry[0]);
     GridView2.DataBind();
     GridView3.DataSource = Class1.excuDatSet("select * from [news] where lanId=" + sarry[1]);
     GridView3.DataBind();
     GridView4.DataSource = Class1.excuDatSet("select * from [news] where lanId=" + sarry[2]);
     GridView4.DataBind();
 }
Example #8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        LanMenu lan = new LanMenu();

        lan.lanName = TextBox1.Text;
        string sql = "select count(*) from lanMenu where lanName='" + lan.lanName + "'";

        if (Class1.excuint(sql) == 0)
        {
            if (LanMenu.addLan(lan))
            {
                Response.Write("<script>alert('创建成功')</script>");
            }
            else
            {
                Response.Write("<script>alert('创建失败')</script>");
            }
        }
        else
        {
            Response.Write("<script>alert('栏目名已存在')</script>");
        }
    }
Example #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user"] == null)
        {
            Response.Redirect("../logon/index.aspx");
        }
        Users m = (Users)Session["user"];

        if (m.username != "admin")
        {
            Response.Redirect("../logon/manage.aspx");
        }
        if (!this.Page.IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                string  id  = Request.QueryString["id"].ToString();
                LanMenu lan = LanMenu.getLanId(id);
                s             = lan.lanName;
                TextBox1.Text = lan.lanName;
            }
        }
    }
Example #10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        LanMenu lan = new LanMenu();

        lan.lanName = TextBox1.Text;
        lan.lanId   = Convert.ToInt32(Request.QueryString["id"].ToString());
        string sql = "select count(*) from lanMenu where lanName='" + lan.lanName + "'";

        if (Class1.excuint(sql) == 0 || lan.lanName == s)
        {
            if (LanMenu.editLan(lan))
            {
                Response.Write("<script>alert('修改成功')</script>");
            }
            else
            {
                Response.Write("<script>alert('修改失败')</script>");
            }
        }
        else
        {
            Response.Write("<script>alert('栏目名已存在')</script>");
        }
    }
Example #11
0
    public static bool addLan(LanMenu lan)
    {
        string sql = "insert into lanMenu (lanName) values('" + lan.lanName + "')";

        return(Class1.excubool(sql));
    }
Example #12
0
    public static bool editLan(LanMenu lan)
    {
        string sql = "update lanMenu set lanName='" + lan.lanName + "' where lanId=" + lan.lanId + "";

        return(Class1.excubool(sql));
    }