Exemple #1
0
    private void onEnterSoundGameState()
    {
        aSource.Stop();
        if (musicRepaired)
        {
            aSource.clip = goodMusic;
        }
        else
        {
            aSource.clip = brokenMusic;
        }
        aSource.loop = true;
        aSource.Play();
        Menu.SetActive(false);
        credits.SetActive(false);
        storyText.SetActive(false);
        characterChoice.SetActive(false);
        soundGame.SetActive(true);
        designGame.SetActive(false);
        qAGame.SetActive(false);
        replayGame.SetActive(false);
        lostGameScreen.SetActive(false);
        gameWonScreen.SetActive(false);
        GameObject go = Instantiate(shootThemUpPrefab, new Vector3(), new Quaternion(), soundGame.transform);

        gameInstance = go.GetComponent <StuManager>();
        gameInstance.StuffToRepair = StuffToRepair.Music;
        inGameCanvas.SetActive(true);
        Debug.Log("zik repaired");
    }
        public ActionResult ModifyStuPaw(string StuId)
        {
            StuId = Session["CurrentUser"].ToString();    //获取登陆用户名
            Stu stu = new StuManager().GetStuById(StuId); //通过登陆id获取学生信息

            return(View(stu));
        }
Exemple #3
0
        /// <summary>
        /// 删除学生信息
        /// </summary>
        /// <param name="category">下拉列表传值</param>
        /// <param name="keyWord">查询关键字</param>
        /// <param name="pageIndex">每页索引数</param>
        /// <returns></returns>
        public ActionResult DeleteStu(string category, string keyWord, int pageIndex = 1)
        {
            string     id      = Request.QueryString["id"];//获取学生id
            StuManager manager = new StuManager();

            manager.DeleteStuById(id);         //调用删除学生方法
            List <Stu> stu = new List <Stu>(); //定义学生列表对象

            //判断查询关键字是否为空
            if (!String.IsNullOrEmpty(category))
            {
                StuQuery cate = (StuQuery)Enum.Parse(typeof(StuQuery), category);
                stu = new StuManager().GetStu(cate, keyWord);
            }
            else
            {
                stu = new StuManager().GetStu();
            }
            //定义一个pagedList对象
            PagedList <Stu> pagedStus = new PagedList <Stu>(stu, pageIndex, pageSize);

            //提供教师查询方式的下拉框
            //调用查询方式
            SetDropDownList(category);
            ViewData["keyWord"] = keyWord;
            return(View("StuList", pagedStus));
        }
Exemple #4
0
        public ActionResult EditStu()
        {
            string id = Request.QueryString["id"];     //从前台获取id值

            Stu stu = new StuManager().GetStuById(id); //调用通过id值获取学生信息方法

            return(View(stu));
        }
Exemple #5
0
    private void onEnterGameWonState()
    {
        aSource.Stop();
        aSource.clip = victoryMusic;
        aSource.loop = false;
        aSource.Play();
        Menu.SetActive(false);
        credits.SetActive(false);
        storyText.SetActive(false);
        characterChoice.SetActive(false);
        soundGame.SetActive(false);
        designGame.SetActive(false);
        qAGame.SetActive(false);
        replayGame.SetActive(false);
        lostGameScreen.SetActive(false);
        gameWonScreen.SetActive(true);
        inGameCanvas.SetActive(false);
        switch (gameInstance.StuffToRepair)
        {
        case StuffToRepair.Music:
            musicRepaired = true;
            break;

        case StuffToRepair.GameDesign:
            gDRepaired = true;
            break;

        case StuffToRepair.QA:
            qARepaired = true;
            break;

        default:
            break;
        }
        GameObject temp = gameInstance.gameObject;

        gameInstance = null;
        Destroy(temp);
    }
Exemple #6
0
    private void onEnterLostGameScreenState()
    {
        aSource.Stop();
        aSource.clip = defeatMusic;
        aSource.loop = false;
        aSource.Play();
        Menu.SetActive(false);
        credits.SetActive(false);
        storyText.SetActive(false);
        characterChoice.SetActive(false);
        soundGame.SetActive(false);
        designGame.SetActive(false);
        qAGame.SetActive(false);
        replayGame.SetActive(false);
        lostGameScreen.SetActive(true);
        gameWonScreen.SetActive(false);
        inGameCanvas.SetActive(false);
        GameObject temp = gameInstance.gameObject;

        gameInstance = null;
        Destroy(temp);
    }
Exemple #7
0
        /// <summary>
        /// 学生列表
        /// </summary>
        /// <param name="category"></param>
        /// <param name="keyWord"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ActionResult StuList(string category, string keyWord, int pageIndex = 1)
        {
            List <Stu> stu = new List <Stu>();//定义学生列表对象

            //判断查询关键字是否为空
            if (!String.IsNullOrEmpty(category))
            {
                StuQuery cate = (StuQuery)Enum.Parse(typeof(StuQuery), category);
                stu = new StuManager().GetStu(cate, keyWord);
            }
            else
            {
                stu = new StuManager().GetStu();
            }
            //定义一个PagedList对象
            PagedList <Stu> pagedStus = new PagedList <Stu>(stu, pageIndex, pageSize);

            //提供学生查询方式的下拉框书籍
            //
            SetDropDownList(category);

            ViewData["keyWord"] = keyWord;
            return(View("StuList", pagedStus));
        }
Exemple #8
0
        /// <summary>
        /// 登陆处理
        /// </summary>
        /// <param name="loginId">登陆账号</param>
        /// <param name="password">登录密码</param>
        /// <returns></returns>

        public ActionResult Login(string loginId, string password)
        {
            //1、获取数据

            string charge = Request.Form["identity"];

            //2、非空验证

            if (string.IsNullOrEmpty(loginId))
            {
                return(View("Login"));//返回login视图
            }
            if (string.IsNullOrEmpty("password"))
            {
                return(View("Login"));//返回login视图
            }
            //3、数据库验证,判定登陆是否成功
            if (charge == "教师")
            {
                TeacherManager tm      = new TeacherManager();
                Teacher        teacher = new Teacher();
                if (tm.TeacherLogIn(loginId, password, out teacher))
                {
                    //4、记住用户名和密码 cookie
                    string recordMe = Request.Form["RecordMe"];
                    if (!string.IsNullOrEmpty(recordMe))//记录用户名和密码
                    {
                        HttpCookie nameCookie = new HttpCookie("loginId", loginId);
                        nameCookie.Expires = DateTime.MaxValue;
                        Response.Cookies.Add(nameCookie);
                        HttpCookie passwordCookie = new HttpCookie("password", password);
                        nameCookie.Expires = DateTime.MaxValue;
                        Response.Cookies.Add(passwordCookie);
                    }
                    else
                    {
                        //让Cookie失效
                        Response.Cookies["loginId"].Expires  = DateTime.Now.AddDays(-1);
                        Response.Cookies["password"].Expires = DateTime.Now.AddDays(-1);
                    }
                    //5、保存用户的状态 sesion
                    teacher = new TeacherManager().GetTeacherById(loginId);
                    Session["CurrentUser"] = loginId;
                    Session["UserName"]    = teacher.TeacherName;
                    //登陆成功页面
                    return(Redirect("~/Teacher/Index"));
                }
                else
                {
                    //返回登陆页面

                    return(View("Login"));
                }
            }
            if (charge == "学生")
            {
                StuManager tm  = new StuManager();
                Stu        stu = new Stu();
                if (tm.StuLogIn(loginId, password, out stu))
                {
                    //4、记住用户名和密码 cookie
                    string recordMe = Request.Form["RecordMe"];
                    if (!string.IsNullOrEmpty(recordMe))//记录用户名和密码
                    {
                        HttpCookie nameCookie = new HttpCookie("loginId", loginId);
                        nameCookie.Expires = DateTime.MaxValue;
                        Response.Cookies.Add(nameCookie);
                        HttpCookie passwordCookie = new HttpCookie("password", password);
                        nameCookie.Expires = DateTime.MaxValue;
                        Response.Cookies.Add(passwordCookie);
                    }
                    else
                    {
                        //让Cookie失效
                        Response.Cookies["loginId"].Expires  = DateTime.Now.AddDays(-1);
                        Response.Cookies["password"].Expires = DateTime.Now.AddDays(-1);
                    }
                    //5、保存用户的状态 sesion

                    stu = new StuManager().GetStuById(loginId);
                    Session["CurrentUser"] = loginId;
                    Session["UserName"]    = stu.StuName;

                    //登陆成功页面
                    return(Redirect("~/Stu/Index"));
                }
                else
                {
                    //返回登陆页面
                    return(View("Login"));
                }
            }
            if (charge == "管理员")
            {
                AdminManager tm    = new AdminManager();
                Admin        admin = new Admin();
                if (tm.AdminLogIn(loginId, password, out admin))
                {
                    //4、记住用户名和密码 cookie
                    string recordMe = Request.Form["RecordMe"];
                    if (!string.IsNullOrEmpty(recordMe))//记录用户名和密码
                    {
                        HttpCookie nameCookie = new HttpCookie("loginId", loginId);
                        nameCookie.Expires = DateTime.MaxValue;
                        Response.Cookies.Add(nameCookie);
                        HttpCookie passwordCookie = new HttpCookie("password", password);
                        nameCookie.Expires = DateTime.MaxValue;
                        Response.Cookies.Add(passwordCookie);
                    }
                    else
                    {
                        //让Cookie失效
                        Response.Cookies["loginId"].Expires  = DateTime.Now.AddDays(-1);
                        Response.Cookies["password"].Expires = DateTime.Now.AddDays(-1);
                    }
                    //5、保存用户的状态 sesion


                    Session["CurrentUser"] = loginId;
                    Session["UserName"]    = loginId;

                    //登陆成功页面
                    return(Redirect("~/Admin/Index"));
                }
                else
                {
                    //返回登陆页面
                    return(View("Login"));
                }
            }
            else
            {
                //返回登陆页面
                return(View("Login"));
            }
        }